Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write the following program using the C++ programming Define a House class which has the following 1- int hno (House number), int roomNo (number of

Write the following program using the C++ programming

Define a House class which has the following

1- int hno (House number), int roomNo (number of rooms in the house),

2- char *StreetName (Street Name), char *City;

3-Room *r (pointer to array of Room Objects defined in the heap). The size of array of room objects is roomNo. Room Class has double area, and char color[10].

4-Door arr[4] which is an array of objects of Door class. Door class has double size and char color[10].

do the following:

A)Define all necessary Constructors + Destructors + functions. Inside constructors, Do all possible initializations for data members (3 points).

B)Define House h1 object with 3 rooms, h2 with 4 rooms and h3 with 3 rooms. Do all necessary initializations for its data members inside a constructor. (3 points)

C)Do what is required to know the number of active objects of class house using static data member and function. Use this inside main function (3 points)

D)Define a function that prints the colors of the doors in h1. (3 points)

E) define a function that prints the total area of house h2.(3 points)

F)Define a function that prints the number of similar door colors in both houses h1 and h3. (3 points)

G) using setColor function member in class Door, change all doors colors in h3 to Yellow. (2 points)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

10. Is the statement easy to read?

Answered: 1 week ago

Question

1 . Television News channels importantance of our Life pattern ?

Answered: 1 week ago

Question

1. How is the newspaper help to our daily life?

Answered: 1 week ago

Question

1. Prepare a short profile of Mikhail Zoshchenko ?

Answered: 1 week ago

Question

What is psychology disorder?

Answered: 1 week ago