CULTY OF ENGINEERING AND INFORMATION TECHNOLOGY JEPARTMENT OF Computer Science Q3) Assume each Building has an id, number of rooms and consist of array of rooms. Each object of class Room has a length...

NoneCULTY OF ENGINEERING AND INFORMATION TECHNOLOGY<br>JEPARTMENT OF Computer Science<br>Q3) Assume each Building has an id, number of rooms and consist of array of rooms. Each object of<br>class Room has a length and width attributes and Arca() method. The following code represents the<br>above description.<br>Note that the pointer in class building points to array of rooms.<br>class Room<br>int length, width;<br>public:<br>int area () :<br>class Building {<br>int id ;<br>const int num;//number of rooms<br>Room r;<br>public:<br>building (int, int , Room );<br>int sum ();<br>Hint: In all your answers, implement all the methods out of the classes<br>1. Define a constructor with parameters for class Building to initialize its data members. Hint:<br>create all the rooms inside the constructor<br>2. Implement the sum method in the class building. (it returns sum of area of the rooms in the<br>building).<br>3. Write setter and getter in class room.<br>2 Rocm * a : this-snium (nun)<br>

Extracted text: CULTY OF ENGINEERING AND INFORMATION TECHNOLOGY JEPARTMENT OF Computer Science Q3) Assume each Building has an id, number of rooms and consist of array of rooms. Each object of class Room has a length and width attributes and Arca() method. The following code represents the above description. Note that the pointer in class building points to array of rooms. class Room int length, width; public: int area () : class Building { int id ; const int num;//number of rooms Room r; public: building (int, int , Room ); int sum (); Hint: In all your answers, implement all the methods out of the classes 1. Define a constructor with parameters for class Building to initialize its data members. Hint: create all the rooms inside the constructor 2. Implement the sum method in the class building. (it returns sum of area of the rooms in the building). 3. Write setter and getter in class room. 2 Rocm * a : this-snium (nun)

Jun 09, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here