Question: To demonstrate your understanding of inheritance and polymorphism, write a C + + program that comprises of a class named Shape. Then create two additional

To demonstrate your understanding of inheritance and polymorphism, write a C++ program that comprises of a class named Shape. Then create two additional classes
named Triangle and Rectangle and allow both these classes to inherit from the Shapes class. Using the concept of polymorphism create a method named Area() and calculate the area for all shapes.
Hint: Area of Triangle length ** breadth
 To demonstrate your understanding of inheritance and polymorphism, write a C++

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