Question: Can you adapt the sample python code for this activity? As an enhancement, please implement the Triangle class. It should have base, height, sideLeft and

Can you adapt the sample python code for this activity?

Can you adapt the sample python code for this activity? As an

enhancement, please implement the Triangle class. It should have base, height, sideLeft

and sideRight properties. Improve the program so that the user can perform

As an enhancement, please implement the Triangle class. It should have base, height, sideLeft and sideRight properties. Improve the program so that the user can perform the followings: 1) Add a shape In this case the program should ask the user to choose the type of the shape (e.g., rectangle, circle, or triangle) and require proper user input depending on the shape (in addition to id, name, and borderColor). Then, the shape should be created and added to a list. 3) Display a single shape In this option, the shapes (stored in a list) should be listed by their Id and Name. The user should enter the Id of the shape, and the system should print all properties of the shape (e.g., base, height, sideleft and sideRight for a triangle) as well as its Area and Parameter. 2) List all shapes In this option, the shapes should be listed by their Id and Name. import math cass shape: class Rectangle(Shape): def __init _(self, id, name, bordercolor, width, length): self.width=width self.length=length super().__init _(id, name, bordercolor) def CalculatePerimeter ( self): return 2 * (self. length + self.width) def CalculateArea(self) : return self, length * self.width ss circle(Shape): , bordercolor

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!