Question: Design and implement the following class Class name: Triangle Instance variables: triangle _ name, side 1 , side 2 , side 3 Instance methods: constructor:
Design and implement the following class
Class name: Triangle
Instance variables: trianglename, side side side
Instance methods:
constructor: it initializes all the instance variables
calcperimeter: this method returns the perimeter of the triangle, calculated using: perimeter side side side
calcarea: this method returns the area of the triangle using:
where area
ame: this method returns the name the triangle
where
Then write a Python program that reades the content of the text file "triangle.txt and create a list of Traingle objects. Each object should be constructed from each line of the text file. The program should print the following:
A table of all triangles along with their sizes and perimeters
The triangle name that has the smallest size
triangle.txt
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
