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 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.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
