Question: Problem Description: 1 - Design a class named Triangle that extends GeometricObject. The class contains: Three data fields are named side 1 , side 2
Problem Description:
Design a class named Triangle that extends GeometricObject. The class contains:
Three data fields are named side side and side with default values to denote three sides of the triangle points
A constructor that creates a triangle with the specified side side side and color, and filled. Make sure you use the parametrized super method. points
The accessor methods for all five data fields that are used in the constructor. points
A method named getArea that returns the area of this triangle. points
A method named getPerimeter returns the perimeter of this triangle. points
A method named toString returns a description for the triangle including the sides and the color and filled from GeometricObject points
Implement the class:
Write a test program TestTriangle.py that creates:
a an object of GeometricObject you call go with: points:
color Blue
filled False
b displays all the parameters of go using the toString created in GeometricObject points
c an object of Triangle you call t with: points
side: side: side:
filled uses the filled of go
color uses the color of go
d displays the area of t points
e displays the perimeter of t points
f displays the color of t points
g displays the filled of t points
h displays all the values of t using the toString created in Triangle points
Files to be submitted:
a GeometricObject.py points
b Triangle.py points
c TestTriangle.py points
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
