SlideShare a Scribd company logo
package reservation;
import java.util.*; //For Scanner Class
import java.time.*; //For LocalDate
import java.time.format.*; //For DateTimeFormatter
public class Reservation
{
double perNight = 105.00, finalAmt;
long noDays;
int m, d, y;
LocalDate std, end;
//Sets the Arrival date inputed by the user
void setArrivalDate(LocalDate arrivalDate)
{
std = arrivalDate;
}
//Sets the Departure date inputed by the user
void setDepartureDate(LocalDate departureDate)
{
end = departureDate;
}
//Returns the Arrival date
LocalDate getArrivalDate()
{
return std;
}
//Returns the Departure date
LocalDate getDepartureDate()
{
return end;
}
//Formats the Arrival date as per the requirement given question
String getArrivalDateFormatted()
{
String stdFormat;
stdFormat = "Arrival Date: " + std.getMonth() + " " + String.valueOf(std.getDayOfMonth())
+ ", " + String.valueOf(std.getYear());
return stdFormat;
}
//Formats the Departure date as per the requirement given question
String getDepartureDateFormatted()
{
String stdFormat;
stdFormat = "Departure Date: " + end.getMonth() + " " +
String.valueOf(end.getDayOfMonth()) + ", " + String.valueOf(end.getYear());
return stdFormat;
}
//Returns the Price per night as per the format
String getPricePerNightFormatted()
{
String pr = "Price: $" + String.valueOf(perNight) + " per night";
return pr;
}
//Returns the number of nights
long getNumberOfNights()
{
//toEpochDay() returns number of days
noDays = end.toEpochDay() - std.toEpochDay();
return noDays;
}
//Calculates final Amount to be paid
double getTotalPrice()
{
finalAmt = (double)getNumberOfNights() * perNight;
return finalAmt;
}
//Returns the Total amount to be paid as per the format given in the question
String getTotalPriceFormatted()
{
String finA = "Total price: $" + String.valueOf(getTotalPrice()) + " for " +
String.valueOf(getNumberOfNights()) + " night" ;
return finA;
}
//Accepts the Arrival date and Departure date from console
void accept()
{
//Creates object of LocaleDate
LocalDate std1, end1;
//Creates the Date Time Formater object and applies Format Style
//SHORT in mm/dd/yy format
DateTimeFormatter fmt = DateTimeFormatter.ofLocalizedDate(FormatStyle.SHORT);
//Creates Scanner class object to accept data from console
Scanner s = new Scanner(System.in);
System.out.println("Enter starting date mm/dd/yyyy: ");
System.out.println("Enter the arrival month (1-12):");
m = s.nextInt(); //Accept data in integer format
System.out.println("Enter the arrival day (1-31):") ;
d = s.nextInt();
System.out.println("Enter the arrival year:") ;
y = s.nextInt();
//Initializes the LocalDate object for Arrival date
std1 = LocalDate.of(y, m, d);
//Sets the SHORT date format
fmt.format(std1);
//Assigns Arrival date to class data member
setArrivalDate(std1);
System.out.println("Enter ending date mm/dd/yyyy: ");
System.out.println("Enter the departure month (1-12):");
m = s.nextInt(); //Accept data in integer format
System.out.println("Enter the departure day (1-31):") ;
d = s.nextInt();
System.out.println("Enter the departure year:") ;
y = s.nextInt();
//Initializes the LocalDate object for Departure date
end1 = LocalDate.of(y, m, d);
//Sets the SHORT date format
fmt.format(std1);
//Assigns Departure date to class data member
setDepartureDate(end1);
}
public static void main(String[] args)
{
char ch;
System.out.println("Welcome to the Reservation Calculator  ");
//Creates Reservation class object
Reservation cc = new Reservation();
Scanner s = new Scanner(System.in);
//Loops till Y is pressed
do
{
cc.accept();
System.out.println(cc.getArrivalDateFormatted());
System.out.println(cc.getDepartureDateFormatted());
System.out.println(cc.getPricePerNightFormatted());
System.out.println(cc.getTotalPriceFormatted());
System.out.println("Would you like to continue? (y/n)");
ch = s.next().charAt(0);
if(ch == 'y' || ch == 'Y')
continue;
else
break;
}while(true);
}
}
Output
Welcome to the Reservation Calculator
Enter starting date mm/dd/yyyy:
Enter the arrival month (1-12):
5
Enter the arrival day (1-31):
16
Enter the arrival year:
2016
Enter ending date mm/dd/yyyy:
Enter the departure month (1-12):
5
Enter the departure day (1-31):
18
Enter the departure year:
2016
Arrival Date: MAY 16, 2016
Departure Date: MAY 18, 2016
Price: $105.0 per night
Total price: $210.0 for 2 night
Would you like to continue? (y/n)
y
Enter starting date mm/dd/yyyy:
Enter the arrival month (1-12):
7
Enter the arrival day (1-31):
20
Enter the arrival year:
2016
Enter ending date mm/dd/yyyy:
Enter the departure month (1-12):
7
Enter the departure day (1-31):
27
Enter the departure year:
2016
Arrival Date: JULY 20, 2016
Departure Date: JULY 27, 2016
Price: $105.0 per night
Total price: $735.0 for 7 night
Would you like to continue? (y/n)
n
Solution
package reservation;
import java.util.*; //For Scanner Class
import java.time.*; //For LocalDate
import java.time.format.*; //For DateTimeFormatter
public class Reservation
{
double perNight = 105.00, finalAmt;
long noDays;
int m, d, y;
LocalDate std, end;
//Sets the Arrival date inputed by the user
void setArrivalDate(LocalDate arrivalDate)
{
std = arrivalDate;
}
//Sets the Departure date inputed by the user
void setDepartureDate(LocalDate departureDate)
{
end = departureDate;
}
//Returns the Arrival date
LocalDate getArrivalDate()
{
return std;
}
//Returns the Departure date
LocalDate getDepartureDate()
{
return end;
}
//Formats the Arrival date as per the requirement given question
String getArrivalDateFormatted()
{
String stdFormat;
stdFormat = "Arrival Date: " + std.getMonth() + " " + String.valueOf(std.getDayOfMonth())
+ ", " + String.valueOf(std.getYear());
return stdFormat;
}
//Formats the Departure date as per the requirement given question
String getDepartureDateFormatted()
{
String stdFormat;
stdFormat = "Departure Date: " + end.getMonth() + " " +
String.valueOf(end.getDayOfMonth()) + ", " + String.valueOf(end.getYear());
return stdFormat;
}
//Returns the Price per night as per the format
String getPricePerNightFormatted()
{
String pr = "Price: $" + String.valueOf(perNight) + " per night";
return pr;
}
//Returns the number of nights
long getNumberOfNights()
{
//toEpochDay() returns number of days
noDays = end.toEpochDay() - std.toEpochDay();
return noDays;
}
//Calculates final Amount to be paid
double getTotalPrice()
{
finalAmt = (double)getNumberOfNights() * perNight;
return finalAmt;
}
//Returns the Total amount to be paid as per the format given in the question
String getTotalPriceFormatted()
{
String finA = "Total price: $" + String.valueOf(getTotalPrice()) + " for " +
String.valueOf(getNumberOfNights()) + " night" ;
return finA;
}
//Accepts the Arrival date and Departure date from console
void accept()
{
//Creates object of LocaleDate
LocalDate std1, end1;
//Creates the Date Time Formater object and applies Format Style
//SHORT in mm/dd/yy format
DateTimeFormatter fmt = DateTimeFormatter.ofLocalizedDate(FormatStyle.SHORT);
//Creates Scanner class object to accept data from console
Scanner s = new Scanner(System.in);
System.out.println("Enter starting date mm/dd/yyyy: ");
System.out.println("Enter the arrival month (1-12):");
m = s.nextInt(); //Accept data in integer format
System.out.println("Enter the arrival day (1-31):") ;
d = s.nextInt();
System.out.println("Enter the arrival year:") ;
y = s.nextInt();
//Initializes the LocalDate object for Arrival date
std1 = LocalDate.of(y, m, d);
//Sets the SHORT date format
fmt.format(std1);
//Assigns Arrival date to class data member
setArrivalDate(std1);
System.out.println("Enter ending date mm/dd/yyyy: ");
System.out.println("Enter the departure month (1-12):");
m = s.nextInt(); //Accept data in integer format
System.out.println("Enter the departure day (1-31):") ;
d = s.nextInt();
System.out.println("Enter the departure year:") ;
y = s.nextInt();
//Initializes the LocalDate object for Departure date
end1 = LocalDate.of(y, m, d);
//Sets the SHORT date format
fmt.format(std1);
//Assigns Departure date to class data member
setDepartureDate(end1);
}
public static void main(String[] args)
{
char ch;
System.out.println("Welcome to the Reservation Calculator  ");
//Creates Reservation class object
Reservation cc = new Reservation();
Scanner s = new Scanner(System.in);
//Loops till Y is pressed
do
{
cc.accept();
System.out.println(cc.getArrivalDateFormatted());
System.out.println(cc.getDepartureDateFormatted());
System.out.println(cc.getPricePerNightFormatted());
System.out.println(cc.getTotalPriceFormatted());
System.out.println("Would you like to continue? (y/n)");
ch = s.next().charAt(0);
if(ch == 'y' || ch == 'Y')
continue;
else
break;
}while(true);
}
}
Output
Welcome to the Reservation Calculator
Enter starting date mm/dd/yyyy:
Enter the arrival month (1-12):
5
Enter the arrival day (1-31):
16
Enter the arrival year:
2016
Enter ending date mm/dd/yyyy:
Enter the departure month (1-12):
5
Enter the departure day (1-31):
18
Enter the departure year:
2016
Arrival Date: MAY 16, 2016
Departure Date: MAY 18, 2016
Price: $105.0 per night
Total price: $210.0 for 2 night
Would you like to continue? (y/n)
y
Enter starting date mm/dd/yyyy:
Enter the arrival month (1-12):
7
Enter the arrival day (1-31):
20
Enter the arrival year:
2016
Enter ending date mm/dd/yyyy:
Enter the departure month (1-12):
7
Enter the departure day (1-31):
27
Enter the departure year:
2016
Arrival Date: JULY 20, 2016
Departure Date: JULY 27, 2016
Price: $105.0 per night
Total price: $735.0 for 7 night
Would you like to continue? (y/n)
n

More Related Content

Similar to package reservation; import java.util.; For Scanner Class .pdf

please help with java questionsJAVA CODEplease check my code and.pdf
please help with java questionsJAVA CODEplease check my code and.pdfplease help with java questionsJAVA CODEplease check my code and.pdf
please help with java questionsJAVA CODEplease check my code and.pdf
arishmarketing21
 
struct procedure {    Date dateOfProcedure;    int procedureID.pdf
struct procedure {    Date dateOfProcedure;    int procedureID.pdfstruct procedure {    Date dateOfProcedure;    int procedureID.pdf
struct procedure {    Date dateOfProcedure;    int procedureID.pdf
anonaeon
 
Quest 1 define a class batsman with the following specifications
Quest  1 define a class batsman with the following specificationsQuest  1 define a class batsman with the following specifications
Quest 1 define a class batsman with the following specifications
rajkumari873
 
Production.javapublic class Production {    Declaring instance.pdf
Production.javapublic class Production {    Declaring instance.pdfProduction.javapublic class Production {    Declaring instance.pdf
Production.javapublic class Production {    Declaring instance.pdf
sooryasalini
 
PROGRAMING IN JAVA 4TH SEM DIGVIJAY COLLAGE
PROGRAMING IN JAVA 4TH SEM DIGVIJAY COLLAGEPROGRAMING IN JAVA 4TH SEM DIGVIJAY COLLAGE
PROGRAMING IN JAVA 4TH SEM DIGVIJAY COLLAGE
yash production
 
Creating an Uber Clone - Part III.pdf
Creating an Uber Clone - Part III.pdfCreating an Uber Clone - Part III.pdf
Creating an Uber Clone - Part III.pdf
ShaiAlmog1
 
Reloj en java
Reloj en javaReloj en java
Reloj en java
cathe26
 
operating system linux,ubuntu,Mac Geometri.pdf
operating system linux,ubuntu,Mac Geometri.pdfoperating system linux,ubuntu,Mac Geometri.pdf
operating system linux,ubuntu,Mac Geometri.pdf
aquadreammail
 
So Far I have these two classes but I need help with my persontest c.pdf
So Far I have these two classes but I need help with my persontest c.pdfSo Far I have these two classes but I need help with my persontest c.pdf
So Far I have these two classes but I need help with my persontest c.pdf
arihantgiftgallery
 
JAVA.pdf
JAVA.pdfJAVA.pdf
JAVA.pdf
jyotir7777
 
computer project by sandhya ,shital,himanshi.pptx
computer project by sandhya ,shital,himanshi.pptxcomputer project by sandhya ,shital,himanshi.pptx
computer project by sandhya ,shital,himanshi.pptx
IshooYadav
 
Tank Battle - A simple game powered by JMonkey engine
Tank Battle - A simple game powered by JMonkey engineTank Battle - A simple game powered by JMonkey engine
Tank Battle - A simple game powered by JMonkey engine
Farzad Nozarian
 
I Have the following Java program in which converts Date to Words an.pdf
I Have the following Java program in which converts Date to Words an.pdfI Have the following Java program in which converts Date to Words an.pdf
I Have the following Java program in which converts Date to Words an.pdf
allystraders
 
URGENTJavaPlease updated the already existing Java program and m.pdf
URGENTJavaPlease updated the already existing Java program and m.pdfURGENTJavaPlease updated the already existing Java program and m.pdf
URGENTJavaPlease updated the already existing Java program and m.pdf
erremmfab
 
I am having a hard time with this problem, can you help me #5. .pdf
I am having a hard time with this problem, can you help me #5. .pdfI am having a hard time with this problem, can you help me #5. .pdf
I am having a hard time with this problem, can you help me #5. .pdf
aroramobiles1
 
Modify the Date class that was covered in the lecture which overload.pdf
Modify the Date class that was covered in the lecture which overload.pdfModify the Date class that was covered in the lecture which overload.pdf
Modify the Date class that was covered in the lecture which overload.pdf
saxenaavnish1
 
I have the following code and I need to know why I am receiving the .pdf
I have the following code and I need to know why I am receiving the .pdfI have the following code and I need to know why I am receiving the .pdf
I have the following code and I need to know why I am receiving the .pdf
ezzi552
 
  import java.util.;import acm.program.;public class FlightPla.pdf
  import java.util.;import acm.program.;public class FlightPla.pdf  import java.util.;import acm.program.;public class FlightPla.pdf
  import java.util.;import acm.program.;public class FlightPla.pdf
anushasarees
 
proj6Collision.javaproj6Collision.javapackage proj6;import.docx
proj6Collision.javaproj6Collision.javapackage proj6;import.docxproj6Collision.javaproj6Collision.javapackage proj6;import.docx
proj6Collision.javaproj6Collision.javapackage proj6;import.docx
wkyra78
 
Help with the following code1. Rewrite to be contained in a vecto.pdf
Help with the following code1. Rewrite to be contained in a vecto.pdfHelp with the following code1. Rewrite to be contained in a vecto.pdf
Help with the following code1. Rewrite to be contained in a vecto.pdf
ezzi97
 

Similar to package reservation; import java.util.; For Scanner Class .pdf (20)

please help with java questionsJAVA CODEplease check my code and.pdf
please help with java questionsJAVA CODEplease check my code and.pdfplease help with java questionsJAVA CODEplease check my code and.pdf
please help with java questionsJAVA CODEplease check my code and.pdf
 
struct procedure {    Date dateOfProcedure;    int procedureID.pdf
struct procedure {    Date dateOfProcedure;    int procedureID.pdfstruct procedure {    Date dateOfProcedure;    int procedureID.pdf
struct procedure {    Date dateOfProcedure;    int procedureID.pdf
 
Quest 1 define a class batsman with the following specifications
Quest  1 define a class batsman with the following specificationsQuest  1 define a class batsman with the following specifications
Quest 1 define a class batsman with the following specifications
 
Production.javapublic class Production {    Declaring instance.pdf
Production.javapublic class Production {    Declaring instance.pdfProduction.javapublic class Production {    Declaring instance.pdf
Production.javapublic class Production {    Declaring instance.pdf
 
PROGRAMING IN JAVA 4TH SEM DIGVIJAY COLLAGE
PROGRAMING IN JAVA 4TH SEM DIGVIJAY COLLAGEPROGRAMING IN JAVA 4TH SEM DIGVIJAY COLLAGE
PROGRAMING IN JAVA 4TH SEM DIGVIJAY COLLAGE
 
Creating an Uber Clone - Part III.pdf
Creating an Uber Clone - Part III.pdfCreating an Uber Clone - Part III.pdf
Creating an Uber Clone - Part III.pdf
 
Reloj en java
Reloj en javaReloj en java
Reloj en java
 
operating system linux,ubuntu,Mac Geometri.pdf
operating system linux,ubuntu,Mac Geometri.pdfoperating system linux,ubuntu,Mac Geometri.pdf
operating system linux,ubuntu,Mac Geometri.pdf
 
So Far I have these two classes but I need help with my persontest c.pdf
So Far I have these two classes but I need help with my persontest c.pdfSo Far I have these two classes but I need help with my persontest c.pdf
So Far I have these two classes but I need help with my persontest c.pdf
 
JAVA.pdf
JAVA.pdfJAVA.pdf
JAVA.pdf
 
computer project by sandhya ,shital,himanshi.pptx
computer project by sandhya ,shital,himanshi.pptxcomputer project by sandhya ,shital,himanshi.pptx
computer project by sandhya ,shital,himanshi.pptx
 
Tank Battle - A simple game powered by JMonkey engine
Tank Battle - A simple game powered by JMonkey engineTank Battle - A simple game powered by JMonkey engine
Tank Battle - A simple game powered by JMonkey engine
 
I Have the following Java program in which converts Date to Words an.pdf
I Have the following Java program in which converts Date to Words an.pdfI Have the following Java program in which converts Date to Words an.pdf
I Have the following Java program in which converts Date to Words an.pdf
 
URGENTJavaPlease updated the already existing Java program and m.pdf
URGENTJavaPlease updated the already existing Java program and m.pdfURGENTJavaPlease updated the already existing Java program and m.pdf
URGENTJavaPlease updated the already existing Java program and m.pdf
 
I am having a hard time with this problem, can you help me #5. .pdf
I am having a hard time with this problem, can you help me #5. .pdfI am having a hard time with this problem, can you help me #5. .pdf
I am having a hard time with this problem, can you help me #5. .pdf
 
Modify the Date class that was covered in the lecture which overload.pdf
Modify the Date class that was covered in the lecture which overload.pdfModify the Date class that was covered in the lecture which overload.pdf
Modify the Date class that was covered in the lecture which overload.pdf
 
I have the following code and I need to know why I am receiving the .pdf
I have the following code and I need to know why I am receiving the .pdfI have the following code and I need to know why I am receiving the .pdf
I have the following code and I need to know why I am receiving the .pdf
 
  import java.util.;import acm.program.;public class FlightPla.pdf
  import java.util.;import acm.program.;public class FlightPla.pdf  import java.util.;import acm.program.;public class FlightPla.pdf
  import java.util.;import acm.program.;public class FlightPla.pdf
 
proj6Collision.javaproj6Collision.javapackage proj6;import.docx
proj6Collision.javaproj6Collision.javapackage proj6;import.docxproj6Collision.javaproj6Collision.javapackage proj6;import.docx
proj6Collision.javaproj6Collision.javapackage proj6;import.docx
 
Help with the following code1. Rewrite to be contained in a vecto.pdf
Help with the following code1. Rewrite to be contained in a vecto.pdfHelp with the following code1. Rewrite to be contained in a vecto.pdf
Help with the following code1. Rewrite to be contained in a vecto.pdf
 

More from anitasahani11

2.Kernel need to be protected because non-root user execute kernel.pdf
2.Kernel need to be protected because non-root user execute kernel.pdf2.Kernel need to be protected because non-root user execute kernel.pdf
2.Kernel need to be protected because non-root user execute kernel.pdf
anitasahani11
 
1.C. Fate of the blastopore becomes the mouth.2.C. Endodermis Casp.pdf
1.C. Fate of the blastopore becomes the mouth.2.C. Endodermis Casp.pdf1.C. Fate of the blastopore becomes the mouth.2.C. Endodermis Casp.pdf
1.C. Fate of the blastopore becomes the mouth.2.C. Endodermis Casp.pdf
anitasahani11
 
1. a. -8 to 4 is 12 unitsb. D to B is 8 unitsc. idk what that de.pdf
1. a. -8 to 4 is 12 unitsb. D to B is 8 unitsc. idk what that de.pdf1. a. -8 to 4 is 12 unitsb. D to B is 8 unitsc. idk what that de.pdf
1. a. -8 to 4 is 12 unitsb. D to B is 8 unitsc. idk what that de.pdf
anitasahani11
 
1. Confidential or privileged information cannot be denied to the co.pdf
1. Confidential or privileged information cannot be denied to the co.pdf1. Confidential or privileged information cannot be denied to the co.pdf
1. Confidential or privileged information cannot be denied to the co.pdf
anitasahani11
 
The three different 3SolutionThe three different 3.pdf
The three different 3SolutionThe three different 3.pdfThe three different 3SolutionThe three different 3.pdf
The three different 3SolutionThe three different 3.pdf
anitasahani11
 
Whales are mammals that breathe into the lungs. Whales contain blow .pdf
Whales are mammals that breathe into the lungs. Whales contain blow .pdfWhales are mammals that breathe into the lungs. Whales contain blow .pdf
Whales are mammals that breathe into the lungs. Whales contain blow .pdf
anitasahani11
 
w12-8v6Solutionw12-8v6.pdf
w12-8v6Solutionw12-8v6.pdfw12-8v6Solutionw12-8v6.pdf
w12-8v6Solutionw12-8v6.pdf
anitasahani11
 
This site provides illustrative experience in the use of Excel for d.pdf
This site provides illustrative experience in the use of Excel for d.pdfThis site provides illustrative experience in the use of Excel for d.pdf
This site provides illustrative experience in the use of Excel for d.pdf
anitasahani11
 
The conch symbolizes social order, respect and power. When the boys .pdf
The conch symbolizes social order, respect and power. When the boys .pdfThe conch symbolizes social order, respect and power. When the boys .pdf
The conch symbolizes social order, respect and power. When the boys .pdf
anitasahani11
 
The bone marrow is the wellspring of numerous immune and blood cells.pdf
The bone marrow is the wellspring of numerous immune and blood cells.pdfThe bone marrow is the wellspring of numerous immune and blood cells.pdf
The bone marrow is the wellspring of numerous immune and blood cells.pdf
anitasahani11
 
Stanley Miller experiment explains the origin and evolution of earth.pdf
Stanley Miller experiment explains the origin and evolution of earth.pdfStanley Miller experiment explains the origin and evolution of earth.pdf
Stanley Miller experiment explains the origin and evolution of earth.pdf
anitasahani11
 
service revenueSolutionservice revenue.pdf
service revenueSolutionservice revenue.pdfservice revenueSolutionservice revenue.pdf
service revenueSolutionservice revenue.pdf
anitasahani11
 
public class DecimalToBinary {    public void printBinaryFormat(in.pdf
public class DecimalToBinary {    public void printBinaryFormat(in.pdfpublic class DecimalToBinary {    public void printBinaryFormat(in.pdf
public class DecimalToBinary {    public void printBinaryFormat(in.pdf
anitasahani11
 
#includeiostream #includequeue #includefstream using nam.pdf
#includeiostream #includequeue #includefstream using nam.pdf#includeiostream #includequeue #includefstream using nam.pdf
#includeiostream #includequeue #includefstream using nam.pdf
anitasahani11
 
Traffic intersection is a piece of transportation infrastructure wha.pdf
  Traffic intersection is a piece of transportation infrastructure wha.pdf  Traffic intersection is a piece of transportation infrastructure wha.pdf
Traffic intersection is a piece of transportation infrastructure wha.pdf
anitasahani11
 
Step1 pH =2 ; [H+] = 1 x10^-2 moleslitre Step2 .pdf
                     Step1 pH =2 ; [H+] = 1 x10^-2 moleslitre  Step2 .pdf                     Step1 pH =2 ; [H+] = 1 x10^-2 moleslitre  Step2 .pdf
Step1 pH =2 ; [H+] = 1 x10^-2 moleslitre Step2 .pdf
anitasahani11
 
ZnOCu2OV2O3,Ni2O3MnO .pdf
                     ZnOCu2OV2O3,Ni2O3MnO                         .pdf                     ZnOCu2OV2O3,Ni2O3MnO                         .pdf
ZnOCu2OV2O3,Ni2O3MnO .pdf
anitasahani11
 
There is actually a few differences. Firstly, a p.pdf
                     There is actually a few differences. Firstly, a p.pdf                     There is actually a few differences. Firstly, a p.pdf
There is actually a few differences. Firstly, a p.pdf
anitasahani11
 
Hg^2+ is soft acid and thus akin to bind to soft .pdf
                     Hg^2+ is soft acid and thus akin to bind to soft .pdf                     Hg^2+ is soft acid and thus akin to bind to soft .pdf
Hg^2+ is soft acid and thus akin to bind to soft .pdf
anitasahani11
 
HCl dissociates into H+ and Cl- in solution. The .pdf
                     HCl dissociates into H+ and Cl- in solution. The .pdf                     HCl dissociates into H+ and Cl- in solution. The .pdf
HCl dissociates into H+ and Cl- in solution. The .pdf
anitasahani11
 

More from anitasahani11 (20)

2.Kernel need to be protected because non-root user execute kernel.pdf
2.Kernel need to be protected because non-root user execute kernel.pdf2.Kernel need to be protected because non-root user execute kernel.pdf
2.Kernel need to be protected because non-root user execute kernel.pdf
 
1.C. Fate of the blastopore becomes the mouth.2.C. Endodermis Casp.pdf
1.C. Fate of the blastopore becomes the mouth.2.C. Endodermis Casp.pdf1.C. Fate of the blastopore becomes the mouth.2.C. Endodermis Casp.pdf
1.C. Fate of the blastopore becomes the mouth.2.C. Endodermis Casp.pdf
 
1. a. -8 to 4 is 12 unitsb. D to B is 8 unitsc. idk what that de.pdf
1. a. -8 to 4 is 12 unitsb. D to B is 8 unitsc. idk what that de.pdf1. a. -8 to 4 is 12 unitsb. D to B is 8 unitsc. idk what that de.pdf
1. a. -8 to 4 is 12 unitsb. D to B is 8 unitsc. idk what that de.pdf
 
1. Confidential or privileged information cannot be denied to the co.pdf
1. Confidential or privileged information cannot be denied to the co.pdf1. Confidential or privileged information cannot be denied to the co.pdf
1. Confidential or privileged information cannot be denied to the co.pdf
 
The three different 3SolutionThe three different 3.pdf
The three different 3SolutionThe three different 3.pdfThe three different 3SolutionThe three different 3.pdf
The three different 3SolutionThe three different 3.pdf
 
Whales are mammals that breathe into the lungs. Whales contain blow .pdf
Whales are mammals that breathe into the lungs. Whales contain blow .pdfWhales are mammals that breathe into the lungs. Whales contain blow .pdf
Whales are mammals that breathe into the lungs. Whales contain blow .pdf
 
w12-8v6Solutionw12-8v6.pdf
w12-8v6Solutionw12-8v6.pdfw12-8v6Solutionw12-8v6.pdf
w12-8v6Solutionw12-8v6.pdf
 
This site provides illustrative experience in the use of Excel for d.pdf
This site provides illustrative experience in the use of Excel for d.pdfThis site provides illustrative experience in the use of Excel for d.pdf
This site provides illustrative experience in the use of Excel for d.pdf
 
The conch symbolizes social order, respect and power. When the boys .pdf
The conch symbolizes social order, respect and power. When the boys .pdfThe conch symbolizes social order, respect and power. When the boys .pdf
The conch symbolizes social order, respect and power. When the boys .pdf
 
The bone marrow is the wellspring of numerous immune and blood cells.pdf
The bone marrow is the wellspring of numerous immune and blood cells.pdfThe bone marrow is the wellspring of numerous immune and blood cells.pdf
The bone marrow is the wellspring of numerous immune and blood cells.pdf
 
Stanley Miller experiment explains the origin and evolution of earth.pdf
Stanley Miller experiment explains the origin and evolution of earth.pdfStanley Miller experiment explains the origin and evolution of earth.pdf
Stanley Miller experiment explains the origin and evolution of earth.pdf
 
service revenueSolutionservice revenue.pdf
service revenueSolutionservice revenue.pdfservice revenueSolutionservice revenue.pdf
service revenueSolutionservice revenue.pdf
 
public class DecimalToBinary {    public void printBinaryFormat(in.pdf
public class DecimalToBinary {    public void printBinaryFormat(in.pdfpublic class DecimalToBinary {    public void printBinaryFormat(in.pdf
public class DecimalToBinary {    public void printBinaryFormat(in.pdf
 
#includeiostream #includequeue #includefstream using nam.pdf
#includeiostream #includequeue #includefstream using nam.pdf#includeiostream #includequeue #includefstream using nam.pdf
#includeiostream #includequeue #includefstream using nam.pdf
 
Traffic intersection is a piece of transportation infrastructure wha.pdf
  Traffic intersection is a piece of transportation infrastructure wha.pdf  Traffic intersection is a piece of transportation infrastructure wha.pdf
Traffic intersection is a piece of transportation infrastructure wha.pdf
 
Step1 pH =2 ; [H+] = 1 x10^-2 moleslitre Step2 .pdf
                     Step1 pH =2 ; [H+] = 1 x10^-2 moleslitre  Step2 .pdf                     Step1 pH =2 ; [H+] = 1 x10^-2 moleslitre  Step2 .pdf
Step1 pH =2 ; [H+] = 1 x10^-2 moleslitre Step2 .pdf
 
ZnOCu2OV2O3,Ni2O3MnO .pdf
                     ZnOCu2OV2O3,Ni2O3MnO                         .pdf                     ZnOCu2OV2O3,Ni2O3MnO                         .pdf
ZnOCu2OV2O3,Ni2O3MnO .pdf
 
There is actually a few differences. Firstly, a p.pdf
                     There is actually a few differences. Firstly, a p.pdf                     There is actually a few differences. Firstly, a p.pdf
There is actually a few differences. Firstly, a p.pdf
 
Hg^2+ is soft acid and thus akin to bind to soft .pdf
                     Hg^2+ is soft acid and thus akin to bind to soft .pdf                     Hg^2+ is soft acid and thus akin to bind to soft .pdf
Hg^2+ is soft acid and thus akin to bind to soft .pdf
 
HCl dissociates into H+ and Cl- in solution. The .pdf
                     HCl dissociates into H+ and Cl- in solution. The .pdf                     HCl dissociates into H+ and Cl- in solution. The .pdf
HCl dissociates into H+ and Cl- in solution. The .pdf
 

Recently uploaded

Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
GeoBlogs
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
Fish and Chips - have they had their chips
Fish and Chips - have they had their chipsFish and Chips - have they had their chips
Fish and Chips - have they had their chips
GeoBlogs
 
How to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS ModuleHow to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS Module
Celine George
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
PART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePART A. Introduction to Costumer Service
PART A. Introduction to Costumer Service
PedroFerreira53928
 
Basic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumersBasic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumers
PedroFerreira53928
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
RaedMohamed3
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxStudents, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
EduSkills OECD
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
MIRIAMSALINAS13
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
beazzy04
 

Recently uploaded (20)

Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
Fish and Chips - have they had their chips
Fish and Chips - have they had their chipsFish and Chips - have they had their chips
Fish and Chips - have they had their chips
 
How to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS ModuleHow to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS Module
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
PART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePART A. Introduction to Costumer Service
PART A. Introduction to Costumer Service
 
Basic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumersBasic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumers
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxStudents, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 

package reservation; import java.util.; For Scanner Class .pdf

  • 1. package reservation; import java.util.*; //For Scanner Class import java.time.*; //For LocalDate import java.time.format.*; //For DateTimeFormatter public class Reservation { double perNight = 105.00, finalAmt; long noDays; int m, d, y; LocalDate std, end; //Sets the Arrival date inputed by the user void setArrivalDate(LocalDate arrivalDate) { std = arrivalDate; } //Sets the Departure date inputed by the user void setDepartureDate(LocalDate departureDate) { end = departureDate; } //Returns the Arrival date LocalDate getArrivalDate() { return std; } //Returns the Departure date LocalDate getDepartureDate() { return end;
  • 2. } //Formats the Arrival date as per the requirement given question String getArrivalDateFormatted() { String stdFormat; stdFormat = "Arrival Date: " + std.getMonth() + " " + String.valueOf(std.getDayOfMonth()) + ", " + String.valueOf(std.getYear()); return stdFormat; } //Formats the Departure date as per the requirement given question String getDepartureDateFormatted() { String stdFormat; stdFormat = "Departure Date: " + end.getMonth() + " " + String.valueOf(end.getDayOfMonth()) + ", " + String.valueOf(end.getYear()); return stdFormat; } //Returns the Price per night as per the format String getPricePerNightFormatted() { String pr = "Price: $" + String.valueOf(perNight) + " per night"; return pr; } //Returns the number of nights long getNumberOfNights() { //toEpochDay() returns number of days noDays = end.toEpochDay() - std.toEpochDay(); return noDays; } //Calculates final Amount to be paid
  • 3. double getTotalPrice() { finalAmt = (double)getNumberOfNights() * perNight; return finalAmt; } //Returns the Total amount to be paid as per the format given in the question String getTotalPriceFormatted() { String finA = "Total price: $" + String.valueOf(getTotalPrice()) + " for " + String.valueOf(getNumberOfNights()) + " night" ; return finA; } //Accepts the Arrival date and Departure date from console void accept() { //Creates object of LocaleDate LocalDate std1, end1; //Creates the Date Time Formater object and applies Format Style //SHORT in mm/dd/yy format DateTimeFormatter fmt = DateTimeFormatter.ofLocalizedDate(FormatStyle.SHORT); //Creates Scanner class object to accept data from console Scanner s = new Scanner(System.in); System.out.println("Enter starting date mm/dd/yyyy: "); System.out.println("Enter the arrival month (1-12):"); m = s.nextInt(); //Accept data in integer format System.out.println("Enter the arrival day (1-31):") ; d = s.nextInt(); System.out.println("Enter the arrival year:") ; y = s.nextInt(); //Initializes the LocalDate object for Arrival date
  • 4. std1 = LocalDate.of(y, m, d); //Sets the SHORT date format fmt.format(std1); //Assigns Arrival date to class data member setArrivalDate(std1); System.out.println("Enter ending date mm/dd/yyyy: "); System.out.println("Enter the departure month (1-12):"); m = s.nextInt(); //Accept data in integer format System.out.println("Enter the departure day (1-31):") ; d = s.nextInt(); System.out.println("Enter the departure year:") ; y = s.nextInt(); //Initializes the LocalDate object for Departure date end1 = LocalDate.of(y, m, d); //Sets the SHORT date format fmt.format(std1); //Assigns Departure date to class data member setDepartureDate(end1); } public static void main(String[] args) { char ch; System.out.println("Welcome to the Reservation Calculator "); //Creates Reservation class object Reservation cc = new Reservation(); Scanner s = new Scanner(System.in); //Loops till Y is pressed do
  • 5. { cc.accept(); System.out.println(cc.getArrivalDateFormatted()); System.out.println(cc.getDepartureDateFormatted()); System.out.println(cc.getPricePerNightFormatted()); System.out.println(cc.getTotalPriceFormatted()); System.out.println("Would you like to continue? (y/n)"); ch = s.next().charAt(0); if(ch == 'y' || ch == 'Y') continue; else break; }while(true); } } Output Welcome to the Reservation Calculator Enter starting date mm/dd/yyyy: Enter the arrival month (1-12): 5 Enter the arrival day (1-31): 16 Enter the arrival year: 2016 Enter ending date mm/dd/yyyy: Enter the departure month (1-12): 5 Enter the departure day (1-31): 18 Enter the departure year: 2016 Arrival Date: MAY 16, 2016 Departure Date: MAY 18, 2016 Price: $105.0 per night Total price: $210.0 for 2 night Would you like to continue? (y/n)
  • 6. y Enter starting date mm/dd/yyyy: Enter the arrival month (1-12): 7 Enter the arrival day (1-31): 20 Enter the arrival year: 2016 Enter ending date mm/dd/yyyy: Enter the departure month (1-12): 7 Enter the departure day (1-31): 27 Enter the departure year: 2016 Arrival Date: JULY 20, 2016 Departure Date: JULY 27, 2016 Price: $105.0 per night Total price: $735.0 for 7 night Would you like to continue? (y/n) n Solution package reservation; import java.util.*; //For Scanner Class import java.time.*; //For LocalDate import java.time.format.*; //For DateTimeFormatter public class Reservation { double perNight = 105.00, finalAmt; long noDays; int m, d, y; LocalDate std, end;
  • 7. //Sets the Arrival date inputed by the user void setArrivalDate(LocalDate arrivalDate) { std = arrivalDate; } //Sets the Departure date inputed by the user void setDepartureDate(LocalDate departureDate) { end = departureDate; } //Returns the Arrival date LocalDate getArrivalDate() { return std; } //Returns the Departure date LocalDate getDepartureDate() { return end; } //Formats the Arrival date as per the requirement given question String getArrivalDateFormatted() { String stdFormat; stdFormat = "Arrival Date: " + std.getMonth() + " " + String.valueOf(std.getDayOfMonth()) + ", " + String.valueOf(std.getYear()); return stdFormat; } //Formats the Departure date as per the requirement given question String getDepartureDateFormatted()
  • 8. { String stdFormat; stdFormat = "Departure Date: " + end.getMonth() + " " + String.valueOf(end.getDayOfMonth()) + ", " + String.valueOf(end.getYear()); return stdFormat; } //Returns the Price per night as per the format String getPricePerNightFormatted() { String pr = "Price: $" + String.valueOf(perNight) + " per night"; return pr; } //Returns the number of nights long getNumberOfNights() { //toEpochDay() returns number of days noDays = end.toEpochDay() - std.toEpochDay(); return noDays; } //Calculates final Amount to be paid double getTotalPrice() { finalAmt = (double)getNumberOfNights() * perNight; return finalAmt; } //Returns the Total amount to be paid as per the format given in the question String getTotalPriceFormatted() { String finA = "Total price: $" + String.valueOf(getTotalPrice()) + " for " + String.valueOf(getNumberOfNights()) + " night" ; return finA; }
  • 9. //Accepts the Arrival date and Departure date from console void accept() { //Creates object of LocaleDate LocalDate std1, end1; //Creates the Date Time Formater object and applies Format Style //SHORT in mm/dd/yy format DateTimeFormatter fmt = DateTimeFormatter.ofLocalizedDate(FormatStyle.SHORT); //Creates Scanner class object to accept data from console Scanner s = new Scanner(System.in); System.out.println("Enter starting date mm/dd/yyyy: "); System.out.println("Enter the arrival month (1-12):"); m = s.nextInt(); //Accept data in integer format System.out.println("Enter the arrival day (1-31):") ; d = s.nextInt(); System.out.println("Enter the arrival year:") ; y = s.nextInt(); //Initializes the LocalDate object for Arrival date std1 = LocalDate.of(y, m, d); //Sets the SHORT date format fmt.format(std1); //Assigns Arrival date to class data member setArrivalDate(std1); System.out.println("Enter ending date mm/dd/yyyy: "); System.out.println("Enter the departure month (1-12):"); m = s.nextInt(); //Accept data in integer format System.out.println("Enter the departure day (1-31):") ; d = s.nextInt();
  • 10. System.out.println("Enter the departure year:") ; y = s.nextInt(); //Initializes the LocalDate object for Departure date end1 = LocalDate.of(y, m, d); //Sets the SHORT date format fmt.format(std1); //Assigns Departure date to class data member setDepartureDate(end1); } public static void main(String[] args) { char ch; System.out.println("Welcome to the Reservation Calculator "); //Creates Reservation class object Reservation cc = new Reservation(); Scanner s = new Scanner(System.in); //Loops till Y is pressed do { cc.accept(); System.out.println(cc.getArrivalDateFormatted()); System.out.println(cc.getDepartureDateFormatted()); System.out.println(cc.getPricePerNightFormatted()); System.out.println(cc.getTotalPriceFormatted()); System.out.println("Would you like to continue? (y/n)"); ch = s.next().charAt(0); if(ch == 'y' || ch == 'Y') continue; else break; }while(true);
  • 11. } } Output Welcome to the Reservation Calculator Enter starting date mm/dd/yyyy: Enter the arrival month (1-12): 5 Enter the arrival day (1-31): 16 Enter the arrival year: 2016 Enter ending date mm/dd/yyyy: Enter the departure month (1-12): 5 Enter the departure day (1-31): 18 Enter the departure year: 2016 Arrival Date: MAY 16, 2016 Departure Date: MAY 18, 2016 Price: $105.0 per night Total price: $210.0 for 2 night Would you like to continue? (y/n) y Enter starting date mm/dd/yyyy: Enter the arrival month (1-12): 7 Enter the arrival day (1-31): 20 Enter the arrival year: 2016 Enter ending date mm/dd/yyyy: Enter the departure month (1-12): 7 Enter the departure day (1-31): 27
  • 12. Enter the departure year: 2016 Arrival Date: JULY 20, 2016 Departure Date: JULY 27, 2016 Price: $105.0 per night Total price: $735.0 for 7 night Would you like to continue? (y/n) n