Write a class house that correctly compiles and runs with


Question: Write a class House that correctly compiles and runs with the following TestHouse code. You cannot change a single thing in the TestHouse class, below. Your House class should keep track of the house's street address, city, number of bathrooms and square footage. The House class needs to implement the methods used in the code below. Here are a few special notes on some of the methods:

1. The House constructor, and the setBaths method, will accept  bathroom values such as 0.5, 2, 3.5, etc. The smallest number of baths possible in a house is one half bath (i.e., 0.5 baths). If an attempt is made to give a value less than 0.5 baths, then set the number of baths to 0.5.

2. The House constructor, and the setSquareFeet method, will accept integer square footage values. The smallest possible size for a house is 100 square feet. If an attempt is made to give a value less than 100, then set the square footage to 100.

3. The squareFeetPerBath method divides the number of square feet of the house by the number of bathrooms.

4. A house should have at least one bathroom per 1000 square feet. The boolean returning method hasEnoughBaths returns true if the house has at least one bath per 1000 square feet, and false otherwise.

Define each and every method and provide the code.

Request for Solution File

Ask an Expert for Answer!!
JAVA Programming: Write a class house that correctly compiles and runs with
Reference No:- TGS0944946

Expected delivery within 24 Hours