Question: Operation This application determines the total charges for a stay at a hotel based on the arrival and departure dates. The application asks the user
Operation
This application determines the total charges for a stay at a hotel based on the arrival and departure dates.
The application asks the user for the month, day, and year of the arrival and the departure. Then, the application displays the arrival date, the departure date, the room rate, the total price, and the number of nights.
Specifications:
Create a presentation layer class named ReservationApp which contains the Main Method. All input/output is done through this class.
Create an additional class named Reservation that defines a reservation. This class should contain instance variables for the arrival date and departure date. It should also contain a constant initialized to the nightly rate of $75.00.
The Reservation class should include the following methods:
setArrivalDate(LocalDate arrivalDate)
LocalDate getArrivalDate()
String getArrivalDateFormatted()
setDepartureDate(LocalDate departureDate)
LocalDate getDepartureDate()
String getDepartureDateFormatted()
int getNumberOfNights()
String getPricePerNightFormatted()
double getTotalPrice()
String getTotalPriceFormatted()
NOTE: To calculate the total number of nights, you can use the toEpochDay method to get the number of days since Jan 1, 1970 for the arrival and departure dates. Then, you can use normal arithmetic operators.
Create a Java Reservation Calculation program within NetBeans that satisfies the specifications stated above.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
