Data Structures and Algorithms
Lab 01: Reviewing OOP Concepts (Inheritance and Polymorphism)
Objectives
1. Practice Objects and Classes in little more detail.
2. Understand and practice the Inheritance concepts.
3. Understand and implement the Polymorphism concepts.
Lab Task
A shape hierarchy is given in UML diagram. Implement the same hierarchy in C++ classes. Remember
to have separate files for header(.h) and source(.cpp) while implementing the UML diagram. The main
function is given here. You are not supposed to change anything inside given ‘main.cpp’.
UML Diagram:
,Main.cpp (should not be changed)
, Desired Output:
Lab 01: Reviewing OOP Concepts (Inheritance and Polymorphism)
Objectives
1. Practice Objects and Classes in little more detail.
2. Understand and practice the Inheritance concepts.
3. Understand and implement the Polymorphism concepts.
Lab Task
A shape hierarchy is given in UML diagram. Implement the same hierarchy in C++ classes. Remember
to have separate files for header(.h) and source(.cpp) while implementing the UML diagram. The main
function is given here. You are not supposed to change anything inside given ‘main.cpp’.
UML Diagram:
,Main.cpp (should not be changed)
, Desired Output: