Hint Linked List Description C Data Structure Algorithm Manager Hotel Number Rooms Number Q43905948
Hint: Linked-List
Description: C++ (Data Structure and Algorithm
You are a manager of a hotel. You have a number of rooms and anumber of customers requesting rooms. Customers want rooms withdifferent number of beds. In your hotel, you have 100 rooms withonly one bed, 50 rooms with 2 beds and 30 rooms with 3 beds.
A. Create two efficient classes: Room, Customer; in their own hand/or cpp files. The room has information such as the customerwho’s currently occupying it, when the customer gets the room(check in date), when the customer is leaving the room (check outdate), and the number of beds in the room. The Customer classcarries the customer id and the number of requested beds. Write anefficient program that slots as many as customers into thehotel.
• If your best available room has more beds than what customerasked for, you should assign that room to the customer. Butswitching the room when it’s assigned is not allowed. • If thenumber of beds requested by customer is more than the biggestnumber of beds in all rooms, the program must accommodate thecustomer with more than one room.
For example, if the customer asks for 5 beds, and the availablerooms of hotel has maximum 3 beds, the best choice is toaccommodate the customer with a room of 3 beds and a room of 2beds. However, if room with 2 beds is not available, then 2 room of3 beds may be a good choice. Alternatively, there is another choicelike 1 room of 3 beds and 2 rooms of 1 bed. Your program mustdecide which one is the best. In the real world’s problem, youalways have to compromise and there is no best solution for all thesituations.
• If it is not possible to assign room(s) to a customer, youprogram must declare that by sending an appropriate message. • Yourprogram can’t refuse to accommodate a customer if there areavailable room(s). • Finally, the program must report how manycustomers have been serviced as total. • To test your program, youcan use input.txt file which is already provided and simulates therequests of random customers. The file includes data such as date,customer identification number, number of requested bed(s), andduration of stay in terms of day(s). The following shows a line ofthe file:
1/1/2018, JRN65PZSP0, 3, 5
which means customer with id number 843A62A1MR has checked-in to aroom with at least 3 beds on Jan 1, 2018, and (s)he has checked-outthat room on Jan 8, 2018. In other words, this room is availableagain on Jan 8, 2018. To simplify the program, consider that therecords in the file are issued in the same day as check-in date(ie. for each record check-in is today).
input.txt
Check-in-Date, customerID, No.of requested beds, Duration ofStay
1/1/2018, JRN65PZSP0, 3, 5
1/1/2018, URR4XMS2NL, 3, 6
1/1/2018, S9YM7KKOL5, 3, 8
1/1/2018, O3XF3FXUHA, 2, 23
1/1/2018, FGIBAYU99X, 3, 4
1/1/2018, LQ3GCV6ZF0, 3, 7
1/1/2018, AFV6AMQEFT, 3, 17
1/1/2018, 97F7RV2LSE, 1, 4
Expert Answer
Answer to Hint: Linked-List Description: C++ (Data Structure and Algorithm You are a manager of a hotel. You have a number of room…
OR