Question
Description You are a manager of a hotel. You have a number of rooms and a number of customers requesting rooms. Customers want rooms with
Description You are a manager of a hotel. You have a number of rooms and a number of customers requesting rooms. Customers want rooms with different number of beds. In your hotel, you have 100 rooms with only one bed, 50 rooms with 2 beds and 30 rooms with 3 beds. A. [50 marks] Create two efficient classes: Room, Customer; in their own h and/or cpp files. The room has information such as the customer whos currently occupying it, when the customer gets the room (check in date), when the customer is leaving the room (check out date), and the number of beds in the room. The Customer class carries the customer id and the number of requested beds. Write an efficient program that slots as many as customers into the hotel.
If your best available room has more beds than what customer asked for, you should assign that room to the customer. But switching the room when its assigned is not allowed. If the number of beds requested by customer is more than the biggest number of beds in all rooms, the program must accommodate the customer with more than one room. For example, if the customer asks for 5 beds, and the available rooms of hotel has maximum 3 beds, the best choice is to accommodate the customer with a room of 3 beds and a room of 2 beds. However, if room with 2 beds is not available, then 2 room of 3 beds may be a good choice. Alternatively, there is another choice like 1 room of 3 beds and 2 rooms of 1 bed. Your program must decide which one is the best. In the real worlds problem, you always have to compromise and there is no best solution for all the situations. If it is not possible to assign room(s) to a customer, you program must declare that by sending an appropriate message. Your program cant refuse to accommodate a customer if there are available room(s). Finally, the program must report how many customers have been serviced as total.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started