In c++ 1. Create a room structure with member-data room dimensions. Write a show () function that displays the room data and an area () function that calculates its face (squaring). In main () create a static array of rooms (Room variables) - the rooms in one apartment. For each of the rooms, display its dimensions and square footage. Determine the total square footage of the apartment.
In c++
1. Create a room structure with member-data room dimensions. Write a show () function that displays the room data and an area () function that calculates its face (squaring).
In main () create a static array of rooms (Room variables) - the rooms in one apartment. For each of the rooms, display its dimensions and square footage. Determine the total square footage of the apartment.
2. Create a Room class with the same member data and member functions:
- constructors - by default and with parameters
- member-functions set () - to set the corresponding size of the room
- member-functions get () - return the corresponding size
-show () - outputting a Room object
-аrea () - returns the face of the room
In main (), create:
(a) single room objects located in the stack and in dynamic memory, respectively, using all defined constructors
(b) 2 arrays of rooms located in the stack and in the dynamic memory (rooms in two apartments), using all defined constructors
For each of the rooms: set the dimensions (if the constructor without parameters is used), display them, determine its square footage. Determine the total square footage of the two apartments from sub-item (b).
Trending now
This is a popular solution!
Step by step
Solved in 2 steps