Answered step by step
Verified Expert Solution
Question
1 Approved Answer
COEN 2 4 4 ( Summer 2 0 2 4 ) - Assignment # 2 Deadline: May 2 7 , Monday by 1 1 :
COEN Summer Assignment #Deadline: May Monday by :PMWeight: This assignment is worth of your final gradeIMPORTANT: The assignment can be done individually or in groups of two. If its done in a group, only a single copy of the assignment should besubmitted. The name and student ID of both members of a group must beincluded in each file. For each class that you create you need to separate the specification of theclass from its implementation by using header files. Make sure that yousubmit with your answer both the h and cpp files for each class. Compress the files using zip or other tools. Submit the zip file on Moodle, download or check the size of the submittedfile to make sure that submission has occurred. Donot wait the last minute to submit your assignment, because Moodlemay be overloaded and your submission may fail. Assignments sent by email willnot be corrected.Key Considerations for the assignment: The quality of your software will also be evaluated. You must enforce encapsulation by keeping all data membersprivate. You need to make sure that your classes are well defined using the various concepts seen in the class. Each class should have default and regular constructor functions that initializes its data members. If needed copy constructor should also be provided. Objects should be created dynamically and must be deleted when no longer needed. There should be an output statement confirming the deletion of an object from the destructor function. Provide needed setget functions for the data members. In the implementation of the member functions all the changed datastructures should be updated. Each class should be able to print the values of its data members. We have been asked to develop an information management system for room reservation in a hotel. Its assumed that reservations can be made for any period during a year. Each reservation request is for a single room. The checkin and checkout dates are in the same year. For example room reservation may be requested from to The duration of each month is assumed to be days and the year days. The availability of each hotel room during each day of a year is shown in a Boolean array, where true value means room is available for reservation on that day and false means it has already been booked for that day. The following table shows availability of a room during a year,Day no Availability True True True False True True False FalseWe have identified the following classes and their data members for this system, Date class, monthint day int year int Room class, Each room is assigned a room number when its created, which has a nonzerovalue. roomNo int availabilityArrayBoolean Assume that when a room is created, its available for the entire year Guest class,This class has been defined to request room reservation. guestName string checkinDate Date checkoutDate Date Reservation class,If room reservation is successful, an object of Reservation class will be created.Each reservation will be assigned a unique reservationNo generated by the counter data member. reservationNo cannot be zero. guest Guest & counter static int reservationNo int roomNo int ReservationManager class,Assume that the hotel has rooms. This class has an array that stores Roomobjects and another array that stores pointers to the objects of Reservation class. roomArray Room An array of objects of Room class. reservationArray Reservation An array of pointers that stores pointers to Reservation objects. Array size is noReservation Number of reservation objectsThis class should have at least the following member functions,i A function that receives a room reservation request through a Guest object. Guest has to be accommodated in the same room during his stay. If an available room is found then a reservation object is created and it calls to the insert function to store the reservation object in the reservationArray. Finally, this function returns reservationNo or zero if reservation wasnot successful.int makeReservation Guest & guestii A function that stores a pointer to the reservation object in theReservationArray. If ResevationArray is full it returns false.bool insert Reservation & reservationiii A function that searches for a reservation object with the given reservationNo. If the object is found its data members are printed otherwise it prints not found.void searchint reservationiv A function that cancels a reservation with the given reservationNo,bool cancelReservationint reservationNo After implementing all the classes, write a driver program that demonstrates functionality of your program. Creates an object of ReservationManager class. Creates Guest objects and room reservation requests and process them. Show outputs of execution of all the member functions of ReservationManager class.
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