cout << rooms.at(i).GetName(); // assumes room has a getter GetName()
}
}
};
Develop this example as follows:
• Create Room class with name and area as private members and appropriate setters/getters
• Modify PrintRooms in House class to print room names and areas.
• Complete the House class by adding a function that calculates the house area (sum of room areas)
• Add a function RemoveRoom to remove a room with given name (research erase function which is a member of vector)
• In main:
• Create a house, add some rooms, print rooms’ names and areas, print total house area
• Remove a room
• Print rooms’ names and areas as well as house’s area after removing the room
1
Expert's answer
2020-04-23T00:28:47-0400
Dear ploi, your question requires a lot of work, which neither of our experts is ready to perform for free. We advise you to convert it to a fully qualified order and we will try to help you. Please click the link below to proceed: Submit order
Comments
Leave a comment