Question: Write three classes named Rectangle, Circle and Triangle. 1. Each class should contain two methods named calculateArea and DisplayArea Note that: You should specify

Write three classes named Rectangle, Circle and Triangle. 1. Each class should contain two methods named

Write three classes named Rectangle, Circle and Triangle. 1. Each class should contain two methods named calculateArea and DisplayArea Note that: You should specify the attributes of each class and the parameters I that must be passed 1. Provide Constructors for each class to initialize private attributes. 2. Write an application to create three objects of type Rectangle, Circle and Triangle then calculate and print the Area of each object.

Step by Step Solution

3.27 Rating (171 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

import math Create class for Rectangle class Rectangle Define parameters for Rectangle def initself ... 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!