Suggest a subclass home with additional instance fields for


1. Suggest a class called House to hold details of the location (street number, street name, town) and the year of construction and the property tax. Write the appropriate contructor, selector and mutator methods. Also suggest a toString method to return the details of the house.

2. Suggest a subclass Home with additional instance fields for the name of the occupying family and the date they moved in. You should use the OurDate class we wrote in the class. 

Note the following:

There should be two overloaded constructor methods: 

public Home (int house, String street, String town, String family,
	  	  OurDate movedIn)

and 

public Home (int house, String street, String town, int yearConstructed, int propertyTax, String family, OurDate movedIn)

These should make use of the super keyword where appropriate. 

There should be the usual methods to set and extract the values of the new instance fields:

	setFamily
	getFamily
	setDateMovedIn
	getDateMovedIn

There should be a toString method that calls the toString method provided by the House class to return the details of the house and then return the text "has been occupied by FAMILY since DATE", with suitable values inserted.

You should make the three classes (House, Home, OurDate) part of the package insy.java.hw6.

3. Suggest a simple driver application that prompts the user to enter the appropriate information about a home, creates an instance of the Home class, and then prints out the details of that home. Make sure to use the appropriate import statement(s) to import the above classes

Solution Preview :

Prepared by a verified Expert
Business Economics: Suggest a subclass home with additional instance fields for
Reference No:- TGS02744807

Now Priced at $30 (50% Discount)

Recommended (95%)

Rated (4.7/5)