Question: USE JAVA Q2. (a) Create a class based on the following class diagram House type: String - zone: char price: double - numberOfBedrooms: int -
USE JAVA

Q2. (a) Create a class based on the following class diagram House type: String - zone: char price: double - numberOfBedrooms: int - freehold: boolean + House( + House (type: String, price: double, numberOfBedrooms: int) +House(type: String, zone: char, price: double, numberOfBedrooms: int, freehold: boolean) +all setters and getters + toString): Strin Note: i) Initalize the value of type to "Apartment", zone to 'A', price to 68000.00, numberOfBedrooms to 3 and freehold to false for no-arg constructor ii) Use toString ) method to print out all house details. (15 marks) Create a driver program for the class you create on part (a) to test all the available constructors and methods i) Create three house objects ii) Create an array to store the three house objects. (b) (4 marks) (6 marks) Modify the House class by using this keyword to refer to the data member(s) and constructor (if possible) (c)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
