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

1 Expert Approved Answer
Step: 1 Unlock

Solution Code and output include include using namespa... View full answer

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