Object Oriented Programming - Old Questions

3. Define a Shape class (with necessary constructors and member functions) in Object-Oriented Programming (abstract necessary attributes and their types). (Write a complete code in C++ programming language) 

• Derive Triangle and Rectangle classes from Shape class adding necessary attributes. 

• Use these classes in a main function and display the area of triangle and rectangle.

10 marks | Asked in 2068