Answer:
HouseBoat and BoatHouses can be child classes of House. because they will have properties of house and they can use those properties from parent class.
boat is objects of boathouses. because boathouses will store boats.
in java Suppose you have classes Boat, House, HouseBoat, and BoatHouse for representing boats, houses, houseboats...
You are given a specification for some Java classes as follows. A building has a number of floors, and a number of windows. A house is a building. A garage is a building. (This isn’t Florida-like … it’s a detached garage.) A room has a length, width, a floor covering, and a number of closets. You can never create an instance of a building, but every object that is a building must have a method that calculates the floor space,...
You are playing the game of Monopoly and you decide you wish to construct houses on one of your property groups. The rules of the game require that the number of houses on the properties within each group may not differ by more than one. You will be given an amount of money to spend, the cost per house, and the number of properties in the group. The goal is to determine how many houses will go on each. And...
Java Lab
In this lab, you will be implementing the following class hierarchy. Your concrete classes must call the superclass constructor with the proper number of sides (which is constant for each concrete shape). The perimeter method is implemented in the superclass as it does not change based on the number of sides. The area method must be overridden in each subclass as the area is dependent on the type of polygon. The areas of an equilateral triangle, square, and...
Suppose you are representing the employees at a large corporation during contract negotiations. You have a list of the salaries of all the employees at the corporation. The company has many lower level employees and only a few high paid management employees. There is a complicated system of raises that makes it so that there are many different salaries for the lower level employees. a. Which measure of center would you use to represent the employees? You are trying to...
JAVA :The following are descriptions of classes that you will create. Think of these as service providers. They provide a service to who ever want to use them. You will also write a TestClass with a main() method that fully exercises the classes that you create. To exercise a class, make some instances of the class, and call the methods of the class using these objects. Paste in the output from the test program that demonstrates your classes’ functionality. Testing...
Suppose you have a set of classes to schedule among a large number of lecture halls, where any class can class place in any lecture hall. Each class cj has a start time sj and finish time fj. We wish to schedule all classes using as few lecture halls as possible. Verbally describe an efficient greedy algorithm to determine which class should use which lecture hall at any given time. What is the running time of your algorithm?
Suppose we have two hierarchies of classes. C1 is a superclass with D1, E1, and F1 as concrete subclasses and C2 is a superclass with D2 and E2 as concrete subclasses. C1 has abstract methods f1() and g1() and C2 has abstract methods f2() and g2(). There is Bridge from C1 to C2. Use the above scenario for answering questions 1-3. Question 1 (1 point) Each object of type C1 should hold a reference to an object of type C2....
Java Activity 1. Suppose we want to have an object-oriented design for an invoicing system, that includes invoices, one or more line items in each invoice, address of the invoice, list of products, etc. Try to design this system by indicating the required classes, responsibilities of each class, and the collaborating classes to fulfill each responsibility, and draw the CRC cards as well as UML diagram of the classes and their relationships. Then, indicate the methods of each class, provide...
Please help me with the following question. This is for Java programming. In this assignment you are going to demonstrate the uses of inheritance and polymorphism. You will create an Animals class and a Zoo class that holds all the animals. You should create a general Animalclass where all other classes are derived from (except for the Zoo class). You should then create general classes such as Mammal, Reptile, and whatever else you choose based off of the Animalclass. For...
Marion Boats Fred Cunningham was a fire truck salesman for many years, while Bill, his brother, worked as a book salesman for a major publishing house. Although they had done fairly well financially, they wanted to "be their own bosses," so they decided to go into business together. They agreed that selling small fishing and recreational boats would be a good line for them to go into as both had been interested in fishing and boating for many years. Also,...