Question: 1) Write a program that defines a Shape class with a constructor that gives value to x(width) and y(height). Create two child classes triangle and

1) Write a program that defines a Shape class with a constructor that gives value to x(width) and y(height). Create two child classes triangle and rectangle, that calculate the area of the shape (Name of the function should be area) In the main, define two variables a triangle and a rectangle and then call the area) function fo rwidth-10 and height-20 in this two variables
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
