Residence Class
The constructor takes an int for number of rooms, an int for number of external walls, and a boolean for whether or not there is a washer.
Residence also has 4 methods:
-
hasWasher()
, which returns a boolean. It returns whether or not there is a washer in the residence. This method should be protected, which means only classes derived from Residence can access it. -
propertyValue()
, which returns a double. It calculates the property value based on number of rooms * 10000. -
numWindows()
, which returns an int. It calculates the number of windows based on the number of external walls * 2. -
toString()
, which returns a string containing the number of rooms, the number of walls, whether or not there is a washer, the number of windows, and the property value.