Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please create 2 real life object car and house with .h and .cpp file in C++. thank you Instructions Identify a two (2) real-world objects

please create 2 real life object car and house with .h and .cpp file in C++.
thank you image text in transcribed
image text in transcribed
Instructions Identify a two (2) real-world objects related by inheritance such as vehicle-car, building-house, computer-macbook, person-student. Then, design both classes which represent each category of those objects. Finally, implement it in C++. Class requirements The name of the classes must be related to the category of the object such as car, vehicle, building, house, etc. The base class must contain at least 2 attributes (member variables). These must be private. The derived class must contain at least 2 additional attributes (member variables). These must be private. Each attribute must have at least one accessor and one mutator. These must be public. Accessors must have the const access modifier. The accessors and mutators inherited to the derived classes may be overridden if needed. In each class, at least one mutator must have a business rule which limits the values stored in the attribute. Examples: a) The attribute can only store positive numbers. b) The attribute can only store a set of values such as "True", "False", "NA". c) The maximum value for the attribute is 100. Each class must have at least 2 constructors. At least one of the derived class' constructors must call one of the base class' constructors. Each class must have one destructor. The destructor will display "An X object has been removed from memory." where X is the name of the class. Additional private and public member functions can be implemented if needed in the class. Implementation Create h and cpp files to implement the design of each class

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

Database Design Application And Administration

Authors: Michael Mannino, Michael V. Mannino

2nd Edition

0072880678, 9780072880670

More Books

Students also viewed these Databases questions