Question
NEED HELP PLEASE !! The objective of this practical work is to design an application for managing hotel reservations. This lab allows you to approach
NEED HELP PLEASE !!
The objective of this practical work is to design an application for managing hotel reservations.
This lab allows you to approach object-oriented programming (OOP) by creating a number of simple classes that will interact with each other. This practical work is therefore suitable for students who are new to OOP in C ++.
A Hotel can be made up of the following information:
A unique identifier (eg: Saef), A name (eg: "Krnif"), A city (eg: Las Vegas ), A set of rooms (eg: an array of 1023 rooms). A Chamber can be made up of the following information:
A number (ex: 2024) A type (eg: Single, Double, Suite, ...) One price per night (ex: $ 120) A Client can consist of the following information:
A unique identifier (eg: dginhac) A name (ex: Ginhac) A first name (ex: Dominique) A Reservation can consist of the following information:
A start date, A number of nights A hotel identifier, A room identifier, A customer identifier, A total amount. A Date consists of One day, A month, One year. With the exception of the Date, all the other elements (Hotel, Room, Client, Reservation) can be adapted depending on how you approach the problem of managing reservations.
Part 1: Creating the classes For each of the classes to be created, we will make sure that their constructor (s) create (s) valid objects. For example, before creating a reservation, it is necessary to check that the start date is correct, that the number of nights requested is positive, that the reserved room is available, ... If these conditions are respected then we can create the Reservation object by passing it the list of the correct parameters. Otherwise, an error message is displayed and the information entry is requested again.
Question 1: Creation of the Date class 1.a) Take the Date class seen in progress and adapt it so that it can take years into account.
1.b) Validate its correct operation with a test program.
Question 2: Creation of the Client class 2.a) Create the Client class with its member variables, its getters methods and all the necessary helper methods / functions.
2.b) Validate its correct operation with a test program.
Question 3: Creation of the Room class 3.a) Create the Room class with its member variables, its getters methods and all the necessary helper methods / functions.
3.b) Add a method to modify the price of a room.
3.c) Validate its correct operation with a test program.
Question 4: Creation of the Hotel class 4.a) Create the Hotel class with its member variables and its getters functions.
4.b) Add methods or helper functions allowing to add or remove a room.
4.c) Validate its correct operation with a test program.
Question 5: Creation of the Reservation class 5.a) Create the Reservation class with its member variables and its getters functions.
5.b) Add a method allowing to modify the date of the stay and / or the number of nights of the stay.
5.c) Add a method / helper function allowing to calculate the total amount of the reservation (Number of nights * price per night).
5.d) Validate its correct operation with a test program.
Part 2: Using Classes in an Application The goal of part 2 is to write the code for the main application to create and manage hotel reservations.
Question 6: Creation of a hotel and clients 6.a) In a main program, create a hotel with an array (array or vector) of 10 rooms divided into 3 "Single", 5 "Double" and 2 "Suite" with different prices (Single at the price of 100 , Double at the price of 125 and Suite at the price of 210 for example).
6.b) Add an operator overload << to the Room class allowing the display of the list of room information on the screen. Also add an overload of the operator << to the Hotel class allowing the display on the screen of the list of all the hotel information. Use these functions to verify that the information entered in question 6.a is correct.
6.c) Then create a list of customers in the form of an array (array or vector).
6.d) Add an overload of the operator << to the Client class allowing the display on the screen of the list of client information. Use this method to verify that the information entered in question 6.c is correct.
Question 7: Preparation of a reservation Reservations will be stored in a dynamic array of type std :: vector.
7.a) Write the code used to enter the customer's name on the keyboard and display the information of the selected customer on the screen. If the customer does not exist, add it to the list.
7.b) Write the code allowing you to enter on the keyboard the date and the number of nights of a reservation in the hotel created in question 6. Do not forget to check that the information entered is correct. If the date or the number of days are not valid, request the entry again.
7.c) Add the code allowing you to enter the desired room type on the keyboard and create the function to check if a room of this type is available in the hotel at the given period and use it to select the first possible room. Display on the screen the identifier of the selected room as well as its price per night.
Question 8: Creation of the reservation The dates of the stay, the room and the client being validated, it is necessary to create the reservation.
10.a) Calculate and display the exact price of the stay.
10.b) Add the new reservation in the reservations table and display the information of the reservation created.
10.c) By repeating the previous procedure, create at least 5 reservations covering the different possible cases (date error, more rooms available, etc.) in order to fully validate the different methods.
Question 9: Management of reservations 11.a) Create the function allowing to display all the reservations.
11.b) Create the function allowing to display a reservation by passing it as argument the number of a reservation.
11.c) Create the function allowing to display all the reservations of a customer by passing him in argument either the name of the customer, or the identifier of the customer.
11.d) Create the function allowing to modify a reservation.
11.e) Create the function allowing to cancel a reservation.
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