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 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
import math Create class for Rectangle class Rectangle Define parameters for Rectangle def initself ... View full answer
Get step-by-step solutions from verified subject matter experts
