Question: Write a program that defines a shape base class with a constructor that gives value to width and height. Then define two derived classes triangle
Write a program that defines a shape base class with a constructor that gives value to width and height.
Then define two derived classes triangle and rectangle, that calculate the area of the shape. In the main,
define two variables a triangle and a rectangle and then compute their area.
Step by Step Solution
3.58 Rating (159 Votes )
There are 3 Steps involved in it
Solution Code and output include include using namespa... View full answer
Get step-by-step solutions from verified subject matter experts
