Question: i need a different short answer Implement a basic hotel reservation system, your program should keep track of the rooms that are being rented out.

 i need a different short answer Implement a basic hotel reservationsystem, your program should keep track of the rooms that are being

i need a different short answer

Implement a basic hotel reservation system, your program should keep track of the rooms that are being rented out. You will record the name of the visitor, the room number, the number of beds (1 or 2 or 3 ), the cost of the room rental, and the number of days the room is rented for each room. You will determine the total rental sales and the typical days rented using this data. If a reservation is made, you should be able to locate it and print the details of the accommodation. 1) Implement a class Room. Assume that an object of class Room has the following attributes: (1 Mark) - A room number - A guest's name - A room price - Number of days rented - Number of beds: 1 or 2 or 3 The class Room should implement the following: (1 Mark) - A constructor for a Room that takes as parameters the name of the guest, the room number, the number of beds: 1 or 2 or 3 , the room's nightly price, and the number of days rented. - Override method toString 0 that returns the guest's name, the room number, number of beds ( 1 or2), rental price,and number of days rented. This should all be nicely formatted with one attribute on each line. (see sample output below for an example). Guest's name: Ahmed - Room number: 123 Room beds: 2 Price: 35.000 - Rented for: 10 days 2) Build a Hotel class that will store information about the hotel. A hotel has a name and a set of rooms that are stored in an array of Rooms called theRooms to hold information about each room. Each room is added to the hotel using the addReservation(...) method; a Room instance should be added to the Rooms array. An array needs to be created with a fixed size. The Hotel class will also include an instance field called rooms Rented indicating the actual number of rooms currently rented. This field is needed since an array has to be created with a fixed size, so rooms Rented will store how many rooms are actually stored in the array. The class Hotel should implement the following: - A constructor that takes as a parameter the name of the hotel and the total number of rooms in the hotel and creates an array of Room objects. (1 Mark) - getTotalRentalSales() that returns the total rental income by summing the rental cost for each room rented out. (1 Mark) - getAvgDays 0 that computes and returns the average number of days that rooms are rented out for. (1 Mark) - printRentalList ( that prints out the information for each room by calling the toString method for each Room instance. (1 Mark) - addReservation(...) that will add a room reservation to the hotel if there is still availability.Note that the Room instance should be added to the first available location in the array. (1 Mark) - findReservation(...) takes a room number and checks whether there is a reservation for this room. If a reservation is found, the method will print out the room's information using the room's toString method. If not, the method prints out a message indicating that the reservation was not found. (1 Mark) - Override the method equals to check for the room price if it is greater, lower, or equal to another room price. (1 Mark) 3) Implement the main method that should produce the output below. It should add 4 rooms reservations with information as below and verify the correct operation of the constructor and all methods in the Hotel class. Remember to test the addReservation() method, which should add rooms to the ArrayList, and the findReservation() method, which should be able to find a room in the ArrayList of objects if it exists, in addition to all other methods. Assume the hotel has a total of 100 rooms. You must add an exception handling on the user's input data. (1 Marks)

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!