C/C++ Final Project 1. Create a program that interacts with the user. 2. Use at least 3 objects (instances of different classes) 3. Use at least one example of inheritance 4. Use at least one example of polymorphism (EXTRA CREDIT) 5. Use at least one pointer 6. Use at least one pass by reference 7. Use at least one overloaded function 8. Use separate files for class definition, class function definition, cpp file that has main 9. Use at least 2 loops 10. Use at least 2 selection statements 11. Include at least one array 12. Include a write to a file 13. Include a read from file 14. Include data validation.
Explanation / Answer
#include using namespace std; class inheritance // base class { public: void setWidthhere(int w) { width = w; } void setWidthhere() //overloaded functions with same name { width=0; } void settheheight(int h) { height = h; } protected: int width; int height; }; // This is the Derived class here class calculatearea: public inheritance { public: int getArea() { return (width * height); } }; int main(void) { inheritance ob1; // object ob1.setWidthhere(8); ob1.settheheight(9); ob1.setWidth(); // Print the area of the object. cout