Write a declaration for three classes using the inheritance

Assignment Help JAVA Programming
Reference no: EM13951954

Described below are three classes, Building, Hotel and Home with their respective attributes:

Building: no_of_floors, age , parking_space, size

Hotel: number_of_guests, number_of_rooms, vacancy, no_of_floors, age, parking_space, size

Home: No_of_bedrooms, no_of_occupants, finished_basement, no_of_floors, parking_space, age, size

Questions 1 through 5 are based on the classes described above:

1. Write a declaration for all three classes using the principles of inheritence. Make the Building class abstract

2. Which of the following statements is incorrect:

a. Hotel h = new Hotel();

b. Home m = new Home();

c. Building b = new Building();

3. Do Hotel and Building have an "Is A" relationship or "Has A" relationship?

4. Which of the following is true:

a. Hotel and Home are subclasses of Building

b. Hotel is a subclass of Building, Home is a subclass of Hotel.

c. Home, Hotel and Building are independent classes

d. Hotel and Home are containment classes of Building

5. If Hotel were a subclass of Building, how would you access the size attribute of Building:

a. Hotel h = new Hotel();
h.new Building();
h.size = 5;

b. Hotel h = new Hotel();

h.Building.size = 5;

c. Hotel h = new Hotel();
h.size=5;

Reference no: EM13951954

Questions Cloud

Determine the number of days in the current month : The second should accept two values, determine the modulus and return the value, which the calling statement should then print out.
How many annual events, such as the vernal equinox : The Julian calendar, instituted by Julius Caesar in 46 B.C. and replaced by the modern Gregorian calendar beginning in 1582, averaged 365.25 days in length. How many annual events, such as the vernal equinox, move through the calendar while the Ju..
Wecker corporation uses the activity rates : Wecker Corporation uses the activity rates from its activity-based costing to assign overhead costs to products
Percentage of credit sales method or aging method : 1. Look at the "Reserve for Uncollectible Accounts Receivable" heading to Note 2 (Summary of Significant Accounting Policies). Does Under Armour use the percentage of credit sales method or the aging method to estimate bad debt expense?
Write a declaration for three classes using the inheritance : Write a declaration for all three classes using the principles of inheritence. Make the Building class abstract
Exceptions to the rule of law : All the justification defenses are exceptions to the rule of law. They allow individuals to take the law into their own hands. According to the rule of law, the government has a monopoly on the use of force
Purchases in the fourth quarter amounted : A capital expenditure for $60,000 is planned for the fourth quarter of 2012.
Calculate the density of the air in the bag : A plastic bag filled with air has a volume of 0.008m3. When the air in the bag is squeezed into the rigid container, the mass of the container (with air) increases from 0.02 to 0.03kg . Calculate the density of the air in the bag.
Determine the acceleration vector throughout the flight : Determine the acceleration vector throughout the flight and the velocity vector at O;

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd