Home C C++ Java Python Perl PHP SQL JavaScript Linux Selenium QT Online Test

Home » Forum » x-Forum » Question

Little help struct room-CppBuzz-Forum

Can someone help with this please, in cpp ? 

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).

Posted by voldyy 2020-11-07 04:13:28

No Ans Posted

Please login to comment

Log In


Ask New Question