Computers and Technology

A large hotel needs a program to store information about rooms at the hotel. Each of the rooms will be represented by an object which will store the number of beds in the room, and whether the room has a bath. Some rooms at the hotel are suites, in which case in addition to the information above they also need to store the number of sub-rooms in the suite. Which of the following is the best object-oriented program design? a. Create a Suite class with the instance variables int numBeds, boolean hasBath, and int numSubrooms .Create a subclass Room of Suite which wil inherit the instance variables numBeds and hasBath from Room, but not the instance variable int numSubrooms
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.
c. Create each of the following as separate classes, Room. Beds, Bath, Suite, SubRoom Create a single Roomor Suite class with the instance variables int numBeds, boolean hasBath, and int numSubrooms.
d. Create a Room class with the instance variables int numBeds, and boolean hasBath. Create a separate class Suite with the instance variable int numSubrooms

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 20:00, serellehunt
Which type of file can be used to import data into a spreadsheet?
Answers: 1
image
Computers and Technology, 22.06.2019 21:00, depression4eternity
The average cost of one year at a private college in 2012-2013 is $43,289. the average grant aid received by a student at a private college in 2012-2013 is $15,680.   what is the average student contribution for one year at a private college in 2012-2013?
Answers: 3
image
Computers and Technology, 24.06.2019 11:00, abolton04
In three to five sentences, describe how you can organize written information logically and sequentially
Answers: 1
image
Computers and Technology, 24.06.2019 12:00, yagalneedshelp8338
Match the function to its purpose. fast worth 50pts.
Answers: 1
Do you know the correct answer?
A large hotel needs a program to store information about rooms at the hotel. Each of the rooms will...

Questions in other subjects:

Konu
Spanish, 08.01.2022 15:50
Konu
Mathematics, 08.01.2022 16:00