Question: Write a C + + program to implement a hierarchy of shapes. Your program should create a base class Shape with attributes for color and

Write a C++ program to implement a hierarchy of shapes. Your program should create a base
class Shape with attributes for color and functions to calculate area and perimeter (which will
be overridden). Create derived classes Circle, Rectangle, and Triangle, each implementing
their own versions of area() and perimeter() methods. Create objects of each derived class, and
display the area and perimeter for each shape.
Write a C + + program to implement a hierarchy of

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 Programming Questions!