Question
In C++. Inheritance. Create a class building with variables: int rooms, int floors, int area. Write the code for: Constructor(s) for the class, getters-setters for
In C++. Inheritance. Create a class building with variables: int rooms, int floors, int area. Write the code for: Constructor(s) for the class, getters-setters for all the variables. Create a subclass house of building. House has three more variables: string name, int bedrooms, int bathrooms. Write the appropriate code for constructors and getter-setters for the subclass. Include a main function in your code, where you create 2 houses with different properties. Output the rooms, floors, area, names, bathrooms, and bedrooms of the two houses you created. Output the name of the house with the largest area. All the lines must have an explanation.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started