Answer:
b. Create a Room class with the instance variables int numBeds, and boolean hasBath. Create a subclass Suite of Room which will inherit the Instance variables of Room and has an additional instance variable int numSubrooms.
Step-by-step explanation:
In object-oriented program designs, applications are split into sub-tasks and each sub-task is designed by creating as one or more classes to model it. This allows for flexibility and extensibility among other things.
In the case of the large hotel, two classes are of utmost importance:
i. the Room class to hold information about the number of beds in the room and whether or not the room has a bath.
ii. the Suite class to hold, in addition to the information held by the Room class, information about the number of sub-rooms in the suite.
To apply the concept of object-oriented design, since the suite is a special type of room, the Room class will serve as the super class while the Suite class which contains extra information will serve as the subclass inheriting all the properties of the Room class. Therefore the Suite will have all the properties of the Room and also its own special property - number of sub-rooms in this case.