Question: Question No. 3: Answer The Following Questions? O Create Three Classes House, Car And Mobile. O House Class Should Have Attributes Of Area And Location.

 Question No. 3: Answer The Following Questions? O Create Three Classes House, Car And Mobile. O House Class Should Have Attributes Of Area And Location. Car Class Should Have Attributes Of Color And Registration Number. Mobile Class Should Have Attribute Of Model. Write An Abstract Class PollutionEffect With Only A Pure Virtual GetPollutionEffect

 

Question No. 3: Answer the following questions? Create three classes-House, Car and

 

Question No. 3: Answer the following questions? Create three classes-House, Car and Mobile. House class should have attributes of area and location. Car class should have attributes of color and registration number. Mobile class should have attribute of model. Write an abstract class PollutionEffect with only a pure virtual getPollution Effect method. Each of the three classes should inherit from this abstract class and implement the getPollutionEffect method to print an appropriate pollution effect count for that class. The getPollution Effect of House class should print "one", Car class should print "Two" and Mobile class should print "Three". Write an application that creates objects of each of the three classes, places pointers to those objects in a array of PollutionEffect pointers, then iterates through the array, invoking each object's getPollutionEffect method.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!