Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

USING JAVA LANGUAGE Task 1: Create a class name Address with the following private instance fields city, street and zip Code. Your class should have

USING JAVA LANGUAGE

image text in transcribed

Task 1: Create a class name Address with the following private instance fields city, street and zip Code. Your class should have the following methods: . 3 argument constructors that initialize the value of class attributes to the values sent by the parameters. 3 setter methods. 3 getter methods. Public printAddress method to print the address e.g Makkah, King Fahad Street, 63114 Task 2: Create a class name Room with the following private instance fields rType and rArea. Your class should have the following methods: 2 argument constructors that initialize the value of class attributes to the values sent by the parameters. 2 setter methods 2 getter methods. Task 3: Create a class name House with the following private instance fields : hNumber as integer hAddress as an object of class Address hRooms as an array of objects from class Room Your class should have the following methods: No-argument constructor sets the hNumber to 0, hAddress and hRooms to null. . 3 argument constructors that initialize the value of class attributes to the values sent by the parameters. 3 setter methods. 3 getter methods. Private method countRooms that receives nothing and returns the size of the array hRooms Private countRooms that receives the type of the room and return how many rooms of the same type. Public printHouseInfo method to prints the house information e.g. House (4014) Located at Makkah, King Fahad Street, 63114 Has 5 rooms: 2 bed room(s) 2 bathroom(s) 1 kitchen(s) Task 4: Write a class called Test House with a main method, in this method do the following: Input House data by the user Create one object of House using the parameterized constructor. Print House information

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_2

Step: 3

blur-text-image_3

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

Transactions On Large Scale Data And Knowledge Centered Systems Xxxviii Special Issue On Database And Expert Systems Applications Lncs 11250

Authors: Abdelkader Hameurlain ,Roland Wagner ,Sven Hartmann ,Hui Ma

1st Edition

3662583836, 978-3662583838

More Books

Students also viewed these Databases questions

Question

e. What do you know about your ethnic background?

Answered: 1 week ago

Question

b. Why were these values considered important?

Answered: 1 week ago