Question: 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

USING JAVA LANGUAGE Task 1: Create a class name Address with the

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!