Question: A Reservation Calculation System Sample Output Reservation Calculation System Startup Enter the arrival month (1-12): 11 Enter the arrival day (1-31): 21 Enter the arrival

A Reservation Calculation System

Sample Output Reservation Calculation System Startup

Enter the arrival month (1-12): 11

Enter the arrival day (1-31): 21

Enter the arrival year: 2017

Enter the departure month (1-12): 11

Enter the departure day (1-31): 23

Enter the departure year: 2017 Arrival Date: November 21, 2017 Departure Date: November 23, 2017 Price: $95.00 per night Total price: $190.00 for 2 nights Continue? (y/n): n

Operation

This application calculates the charges for a stay at a hotel based on the arrival and departure dates. The application prompts 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

1. Create a presentation layer class named ReservationApp which contains the Main Method. All input/output is done through this class.

2. Create a 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 $95.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() 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.

3. Create a Java Reservation Calculation program with NetBeans that satisfies the specifications stated above.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!