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: triangle_name, side1, side2, side3
Instance methods:
constructor: it initializes all the instance variables
calc_perimeter: this method returns the perimeter of the triangle, calculated using: perimeter = side 1+ side 2+ side3
calc_area: this method returns the area of the triangle using:
where area =s(s-side1)(s-side2)(s-side3)2
q,s=side1+side2+side32getname: this method returns the name of 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
 Design and implement the following class Class name: Triangle Instance variables:

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!