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
Get step-by-step solutions from verified subject matter experts
