Question
C++ If Hotel and GuestRoom are two classes and Hotel is a composition of multiple GuestRoom, then, when a Hotel object no longer exists in
C++
If Hotel and GuestRoom are two classes and Hotel is a composition of multiple GuestRoom, then, when a Hotel object no longer exists in the program, every GuestRoom object of this Hotel object must be removed together from the program.
In a real information system, these type of objects are stored and managed not only by a program but also a database. However, we have no interest here on how the database should be designed to handle them but what a program can do to support this relationship and its constraints. Can you write a C++ program to implement the above composition completely?
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