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:30
Data for which there is temporarily no room in ram is diverted to where on your computer? question 9 options: a) the paging file on the hard drive b) the system file on the hard drive c) the memory file on the hard drive d) the cpu cache
Answers: 2
question
Computers and Technology, 21.06.2019 21:40
Write c function that can replace all the positive elements to 0 and negative to 1 in undefined length one-dimensional array. test your program in the main program by defining one-dimensional array of 6 elements
Answers: 1
question
Computers and Technology, 22.06.2019 05:20
Write a program called assignment3 (saved in a ļ¬le assignment3.java) that computes the greatest common divisor of two given integers. one of the oldest numerical algorithms was described by the greek mathematician, euclid, in 300 b.c. it is a simple but very eā†µective algorithm that computes the greatest common divisor of two given integers. for instance, given integers 24 and 18, the greatest common divisor is 6, because 6 is the largest integer that divides evenly into both 24 and 18. we will denote the greatest common divisor of x and y as gcd(x, y). the algorithm is based on the clever idea that the gcd(x, y) = gcd(x ! y, y) if x > = y and gcd(x, y) = gcd(x, y ! x) if x < y. the algorithm consists of a series of steps (loop iterations) where the ā€œlargerā€ integer is replaced by the diā†µerence of the larger and smaller integer. this continues until the two values are equal. that is then the gcd.
Answers: 3
question
Computers and Technology, 22.06.2019 11:30
Andrina writes letters that are regularly sent to hundreds of her companyā€™s customers. because of this, she would like for the mail merge command to be in her quick access toolbar, and she wants it to be the first button on the left. what should andrina do to place the mail merge button there?
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
Questions on the website: 13722367