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

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

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!