1. Create the Class Room: A Room is defined by its id (int), name (name) and area (double) Create the constructor and destructor, Create the methods to access all private attributes (get and set for all the attributes) Create a method for printing 2. Create the Class Appartment: An Appartment is defined by its id (id), floor id (int) and composed with a maximum 6 Rooms (array of Room). Create all needed Constructors and the destructor, Create the methods to access all private attributes, Create a method for printing, Create a method able to calculate the total area of the apartment, Create a method to Compare the current object with another, return false if the current Appartment is smaller. 3. Create the method Main able to Create an array of 5 Appartments, Print the area of all the appartments.

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter11: Advanced Inheritance Concepts
Section: Chapter Questions
Problem 5PE
icon
Related questions
Question

in C++

1. Create the Class Room:
A Room is defined by its id (int), name (name) and area (double)
Create the constructor and destructor,
Create the methods to access all private attributes (get and set for all the
attributes)
Create a method for printing
2. Create the Class Appartment:
An Appartment is defined by its id (id), floor id (int) and composed with a maximum 6
Rooms (array of Room).
Create all needed Constructors and the destructor,
Create the methods to access all private attributes,
Create a method for printing,
Create a method able to calculate the total area of the apartment,
Create a method to Compare the current object with another, return false if the
current Appartment is smaller.
3. Create the method Main able to Create an array of 5 Appartments,
Print the area of all the appartments.
Transcribed Image Text:1. Create the Class Room: A Room is defined by its id (int), name (name) and area (double) Create the constructor and destructor, Create the methods to access all private attributes (get and set for all the attributes) Create a method for printing 2. Create the Class Appartment: An Appartment is defined by its id (id), floor id (int) and composed with a maximum 6 Rooms (array of Room). Create all needed Constructors and the destructor, Create the methods to access all private attributes, Create a method for printing, Create a method able to calculate the total area of the apartment, Create a method to Compare the current object with another, return false if the current Appartment is smaller. 3. Create the method Main able to Create an array of 5 Appartments, Print the area of all the appartments.
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Unreferenced Objects
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT