Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Write a class called House to hold details of the location (street number, street name, town) and the year of construction and the property

1. Write 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 write a toString method to return the details of the house.

2. Write 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. Write 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. Deliverables: You should submit the four source code files (House.java, Home.java, OurDate.java, HomeDriver.java).

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Readings In Database Systems

Authors: Michael Stonebraker

2nd Edition

0934613656, 9780934613651

More Books

Students also viewed these Databases questions

Question

View writing as a strategic tool

Answered: 1 week ago