Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

COEN 2 4 4 ( Summer 2 0 2 4 ) - Assignment # 2 Deadline: May 2 7 , Monday by 1 1 :

COEN 244(Summer 2024)- Assignment #2Deadline: May 27, Monday by 11:59PMWeight: This assignment is worth 5% 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 set/get 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 7/26/2024 to 8/3/2024. The duration of each month is assumed to be 30 days and the year 360 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 1Availability True ..... True True False True True False .... FalseWe have identified the following classes and their data members for this system, ....154155156157158159....3601) Date class, month(int) day (int) year (int)2) Room class,// Each room is assigned a room number when its created, which has a nonzerovalue. roomNo (int) availabilityArray(Boolean)// Assume that when a room is// created, its available for the entire year3) Guest class,This class has been defined to request room reservation. guestName (string) checkinDate (Date) checkoutDate (Date),4) 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)5) ReservationManager class,Assume that the hotel has 100 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 1000. 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 & guest)ii) A function that stores a pointer to the reservation object in theReservationArray. If ResevationArray is full it returns false.bool insert (Reservation & reservation)iii) 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 search(int reservation)iv) A function that cancels a reservation with the given reservationNo,bool cancelReservation(int reservationNo)6) 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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2015 Porto Portugal September 7 11 2015 Proceedings Part 1 Lnai 9284

Authors: Annalisa Appice ,Pedro Pereira Rodrigues ,Vitor Santos Costa ,Carlos Soares ,Joao Gama ,Alipio Jorge

1st Edition

3319235273, 978-3319235271

More Books

Students also viewed these Databases questions

Question

Brief the importance of span of control and its concepts.

Answered: 1 week ago

Question

What is meant by decentralisation?

Answered: 1 week ago

Question

Write down the Limitation of Beer - Lamberts law?

Answered: 1 week ago

Question

Discuss the Hawthorne experiments in detail

Answered: 1 week ago

Question

Explain the characteristics of a good system of control

Answered: 1 week ago