You are on page 1of 2

Design a class named Triangle that extends the GeometricObject class.

The Triangle class contains:


 Three float data fields named side1, side2, and side3 to denote the three sides of the
triangle.
 A constructor that creates a triangle with the specified side1, side2, and side3 with default
values 1.0.
 The accessor methods for all three data fields.
 A method named getArea() that returns the area of this triangle.
 A method named getPerimeter() that returns the perimeter of this triangle.
Write a python program that prompts the user to enter the sides of the triangle. The program
should display the
triangle’s area, perimeter and relevant information. Attach Output screenshots also.

m
er as
co
eH w
o.
rs e
ou urc
o
aC s
v i y re

GeometricObject class:
ed d
ar stu
sh is
Th

This study source was downloaded by 100000806593911 from CourseHero.com on 05-09-2021 06:51:06 GMT -05:00

https://www.coursehero.com/file/89597129/ans1docx/
Triangle class:

m
er as
co
eH w
o.
rs e
ou urc
Output:
o
aC s
v i y re
ed d
ar stu
sh is
Th

This study source was downloaded by 100000806593911 from CourseHero.com on 05-09-2021 06:51:06 GMT -05:00

https://www.coursehero.com/file/89597129/ans1docx/
Powered by TCPDF (www.tcpdf.org)

You might also like