Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

A hotel manager is looking for a Java programmer who can develop a reservation system that shall maintain information about the hotel guests and can

A hotel manager is looking for a Java programmer who can develop a reservation system that shall maintain information about the hotel guests and can manage the reservation of hotel rooms.

To solve this problem you are required to do the following:

  1. Create a java class reservation that has data members : guestName, passportNo, CheckInDay, CheckInMonth, , CheckOutDay, CheckOutMonth, and pricePerNight. (0.5 Mark)
  1. Create a method setAll(), that shall fill the class data members. (0.5 Mark)
  1. Create a method calculateNights() , this method shall return the number of nights that the guest stayed in the hotel. Consider that all the year months has 30 days. (3 Marks)
  1. Create a method invoice().This method shall return the room total price . The total price includes the total cost of staying in the hotel for number of nights in addition to 20% municipality tax. (2 Marks)
  1. Create a method printInvoice() , this method shall return the following : (2 Marks) - Guest name. - Passport number. - Check-in date - Check-out date. - Number of nights. - Total cost before and after tax.

QUESTION 2

  1. Write a main class and test your program.
  2. Declare one objects guest1 and fill the objects data from the keyboard. (1 Mark)
  3. Print the invoice of guest1 in a nice format. (1 Mark)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Learning MySQL Get A Handle On Your Data

Authors: Seyed M M Tahaghoghi

1st Edition

0596529465, 9780596529468

More Books

Students also viewed these Databases questions