Question: using c++ Write an abstract class shape (length, width) with pure virtual method area()=0 Inherit class rectangle and triangle from the class shape. Redefine the

using c++

Write an abstract class shape (length, width) with pure virtual method area()=0

Inherit class rectangle and triangle from the class shape.

Redefine the area in each class

Create object of each class and print the area of it. Is there an error? Where? Why? Correct it Create a pointer from the abstract class and let it point to an object of the other classes.

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!