High School

We appreciate your visit to A new fancy hotel has requested your help to build a system to manage guests reservations The hotel has 6 categories of rooms Additionally the. This page offers clear insights and highlights the essential aspects of the topic. Our goal is to provide a helpful and engaging learning experience. Explore the content and find the answers you need!

A new fancy hotel has requested your help to build a system to manage guests’ reservations. The hotel has 6 categories of rooms. Additionally, the rooms vary in capacity. The price for each room depends on the type, capacity, and number of nights. Your program will handle both making new reservations and checking out.

- Guests should be asked if they would like to make a new reservation or check out of their current room.
- Your program will ask each guest who wishes to make a new booking the details of their reservation then check availability. If there are rooms available, a booking will be placed in the system.
- When a guest makes a reservation or checks out, the system needs to be updated to reflect the current availability of rooms.
- At the end of the day, a summary must be generated for the management.

Your program must use loops, lists, functions, and files in order to work correctly.

**Instructions:**

1. Begin with a text file called `room_details.txt`, which will contain the details for the rooms offered by the hotel. Each line in the file will represent a room category and is formatted as follows:

`"Category name", number of rooms, capacity, price per night, price per 7 nights, price per 30 nights, number of rooms occupied`

An example of a line in the file:

`"Wonderful",20,2,1200,8000,30000,2`

Notice that each detail is separated by a comma.

2. You will need to create a function called `LoadDetails` which reads each line from the text file into a multidimensional list. The function needs to separate the details in each line so that the data can be used by your system.

3. Use a loop to handle each request since there is no way to know exactly how many guests will interact with the system. When there are no more guests to be processed, the user needs to enter the letter `q` to stop asking for more details.

4. Create a function called `CheckAvailability` that will check if a particular room is available. This function must accept three input parameters called `roomData`, `category`, and `numberOfGuests`. The function will use the data provided to check the category and capacity, then return `True` if a room is available, or `False` if not. `CheckAvailability` will also return the index location of the room that is a match.

5. Create a function `CalculatePrice` which will calculate the price of the guest’s reservation. You will notice that each room category and size have different rates depending on the duration of the booking. This needs to be taken into account when calculating the final price. This function must accept three input parameters called `roomData`, `durationOfStay`, and `roomIndex`. This function must then return the calculated price.

6. Create a function called `CreateSummary` which generates a summary of the availability of the rooms. This function must accept an input parameter called `roomData`. The summary must display the following information for each type of room:

- Category name
- Number of rooms occupied

7. Create a function called `UpdateTextFile` which will save all the updated information into the text file called `room_details.txt`. This update will replace the old information so that the new data will be loaded when the program runs again.

It is extremely important that the system is implemented as specified, meaning that all names must be exactly as required. Your system must also check that the correct information is entered by the user so that the program functions as intended.

**Please see the following output example before starting the program.**

Note: Need this program in Python. Thank you!

Answer :

The task at hand is to build a system that manages guest reservations for a new fancy hotel. The system should handle both making new reservations and checking out guests. The program needs to ask guests if they want to make a new reservation or check out of their current room.

For new reservations, the program should ask for the details of the reservation and check the availability of rooms.

To start with, you will be provided with a text file called "room_details.txt" which contains the details for the rooms offered by the hotel. Each line in the file represents a room category and is formatted as follows: "Category name", number of rooms, capacity, price per night, price per 7 nights, price per 30 nights, and number of rooms occupied.

The first function you need to create is called "LoadDetails". This function reads each line from the text file and stores the details in a multidimensional list so that the data can be used by the system. Each detail in the line is separated by a comma.

Next, you need to handle each guest request using a loop. Since there is no way to know the exact number of guests, the loop should continue until the user enters the letter 'q' to stop asking for more details.

For checking room availability, you need to create a function called "CheckAvailability". This function takes three input parameters: roomData (the details of the rooms), category (the desired room category), and numberOfGuests (the number of guests). The function uses the provided data to check the category and capacity of each room and returns True if a room is available or False if not. It also returns the index location of the available room.

Next, you need to create a function called "CalculatePrice". This function calculates the price of the guest's reservation. It takes three input parameters: roomData, durationOfStay, and roomIndex. The function uses the roomData to determine the rate based on the room category and size, and the duration of the stay. It then returns the calculated price.

To generate a summary of the availability of the rooms, you need to create a function called "CreateSummary". This function accepts the roomData as an input parameter and displays the following information for each type of room: category name and number of rooms occupied.

Lastly, you need to create a function called "UpdateTextFile" to save all the updated information back into the "room_details.txt" file. This function replaces the old information with the new data, so that it will be loaded correctly when the program runs again.

It's important to implement the system as specified, using the exact function names and following the given instructions. The program should also validate the input to ensure the correct information is entered by the user.

By following these steps and using loops, lists, functions, and files, you will be able to build a system to manage the reservations for the new fancy hotel.

To know more about returns, refer here

https://brainly.com/question/1789817

#SPJ11

Thanks for taking the time to read A new fancy hotel has requested your help to build a system to manage guests reservations The hotel has 6 categories of rooms Additionally the. We hope the insights shared have been valuable and enhanced your understanding of the topic. Don�t hesitate to browse our website for more informative and engaging content!

Rewritten by : Barada