Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write the class RoomsDemo with the main method, and follow the instructions bellow: a) Declare an array called rooms of three objects of type Room
Write the class RoomsDemo with the main method, and follow the instructions bellow:
a) Declare an array called rooms of three objects of type Room ..................... [] rooms =new .................................... [3];
b) Assign to the first element of the array an object of type Room with: width=8, length=15 and floor =1.
Rooms [............] = new ................................................
c) Assign to the second object an object of type Classroom with: width=30, length=50,
floor =2 and 20 students.
Rooms [............] = new ................................................
d) Assign to the third object an object of type Officeroom with: width=20, length=25,
floor =3 and 3 employees.
Rooms [............] = new ................................................
e) Use a for loop to get the following output (do not forget to display the areas):
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started