subject

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

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 17:10
Can be categorized as popularity, relevancy, and user satisfaction. select one: a. mobile search seo b. ranking factors c. serp d. web analytics
Answers: 1
question
Computers and Technology, 24.06.2019 06:00
Hey i really need some solving this problem: 1. encrypt this binary string into cipher text: 110000. include in your answer the formula the decoder would use to decrypt your cipher text in the format (coded answer) x n mod (m) = y & 2. decrypt this cipher text into a binary string: 106 you.
Answers: 2
question
Computers and Technology, 24.06.2019 13:00
George heard about the benefits of a data warehouse. he wants to try implementing one for his organization. however, he is afraid that transferring data to the data warehouse will affect transaction time. which element ensures that transactions are not affected when moving data to a warehouse? when data is transferred to a data warehouse, the a area frees the source system to continue transaction processing.
Answers: 2
question
Computers and Technology, 24.06.2019 13:00
Your mom wants to purchase a laptop computer. she said she wants her new computer to be able to play her dvds so she can listen to music and wants to know what type of optical drives will play her disk. which type of drive should she look for?
Answers: 1
You know the right answer?
A large hotel needs a program to store information about rooms at the hotel. Each of the rooms will...
Questions
question
Mathematics, 07.01.2020 10:31
question
Mathematics, 07.01.2020 10:31
Questions on the website: 13722360