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, 23.06.2019 04:20
4. a1. vince owns a television repair shop that is insured undera commercial package policy. the policy includes thebuilding and personal property coverage form and thecauses-of-loss broad form. the declarations page indicatesthat coverage applies to both the building and the namedinsured's business property. explain whether or not thefollowing losses would be covered under his policy.a. a fire occurs on the premises, and the building isbadly damaged.b. a burglar steals some money and securities from anunlocked safe.c. a business computer is damaged by vandals whobreak into the shop after business hours.d. a tornado touches down near the store. several tel-evision sets of customers in the shop for repair aredamaged in the storm.til
Answers: 2
question
Computers and Technology, 23.06.2019 06:30
On early television stations, what typically filled the screen from around 11pm until 6am? test dummies test patterns tests testing colors
Answers: 1
question
Computers and Technology, 23.06.2019 07:30
To check spelling errors in a document, the word application uses the to determine appropriate spelling. internet built-in dictionary user-defined words other text in the document
Answers: 2
question
Computers and Technology, 23.06.2019 23:00
How do you know if the website is secure if you make a purchase
Answers: 2
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, 04.12.2020 20:30
question
Social Studies, 04.12.2020 20:30
question
Mathematics, 04.12.2020 20:30
question
Mathematics, 04.12.2020 20:30
question
English, 04.12.2020 20:30
question
Mathematics, 04.12.2020 20:30
question
Mathematics, 04.12.2020 20:30