Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In Java prepare class for House. This class will contain 4 attributes: (int) number of rooms (int) number of bathrooms booleanis it occupied. (string) address
In Java prepare class for House. This class will contain 4 attributes:
- (int) number of rooms
- (int) number of bathrooms
- booleanis it occupied.
- (string) address
(you will have to create the actual variables names.)
Then create two subclasses which extend the class House.
- rental. A rental house has the following attributes:
- (int) rent
- (boolean) is rented
- owned. An owned house has the following attributes:
- (int) mortgage
- (int) insurance
- (boolean) is paid in full : a house paid in full has a mortgage of 0.
For all the classes:
- create the constructors, the mutators, the accessors for all the attributes.
- You should have at least one constructor which is not a default constructor.
- Create the driver, and 3 objects: one house, one rental and one owned house. Your driver should create the objects, fill them and display the information for the houses.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started