Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

USE JAVA

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

What are the main objectives of Inventory ?

Answered: 1 week ago

Question

Explain the various inventory management techniques in detail.

Answered: 1 week ago

Question

=+4 What are non-union workers representations?

Answered: 1 week ago