Question: the house class sophie sally and jack have decided to...
The House Class
Sophie, Sally and Jack have decided to develop a housing subdivision. The first thing they'll need is a House class. The houses will be all be very similar: a living area for formal entertainment, a family area for everyday activities, and some number of bedrooms, each with a bath. The houses will also have various amounts of land surrounding them.
Write a class House. The purpose of a House object is to represent a single house with its plot of land in a subdivision. The House class has the following specification:
- instance variable of type int for the number of bedrooms.
- instance variable of type double for the size in square feet of the family room
- instance variable of type double for the size in square feet of the living room
- instance variable of type String that describes the style of the house ("Colonial," "Ranch," "motte-and-bailey," etc)
- instance variable of type double for the size in acres of the plot that surrounds the house
House has two constructors
- a no-argument constructors
a constructor that takes five parameterS (in this order):
- the style of the house
- the area of the family room
- the area of the living room
- the number of bedrooms,
- the size of the plot the house sits on
House has getters for all instance variables:
getTotalArea (This method take no parameters, and returns a double value representing the total square feet of the house. Each bedroom is 300 square feet.)
int compareArea(House otherHouse) returns
- a negative value (the exact value doesn't matter--only that it be less than zero) if the current house's total area is smaller than the total area of otherHouse
- a positive number (the exact value doesn't matter--only that it be greater than zero) if the current house's total area is larger than the total area of otherHouse
- 0 if the two houses have exactly the same total area
toString that returns something similar to "House style = Colonial, bedrooms=3, family room area=700.0, living room area=500.0, plot=0.7, square feet=2100.0"
House has setters for all instance variables
Write a class with a main method to test House. Do not put your main method in the House class. Your tester should create at least two House objects, set different values for the Style, Bedrooms, plot, etc. The tester should especially test that compareArea works as expected.