Question
Must be in Python 3.6 (please have a screen shot on the code) ex 2.14 : # Enter three points for a triangle x1, y1,
Must be in Python 3.6 (please have a screen shot on the code)
ex 2.14 :
# Enter three points for a triangle x1, y1, x2, y2, x3, y3 = eval(input("Enter three points for a triangle: "))
# Compute the length of the three sides side1 = ((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)) ** 0.5 side2 = ((x1 - x3) * (x1 - x3) + (y1 - y3) * (y1 - y3)) ** 0.5 side3 = ((x3 - x2) * (x3 - x2) + (y3 - y2) * (y3 - y2)) ** 0.5
s = (side1 + side2 + side3) / 2; area = (s * (s - side1) * (s - side2) * (s - side3)) ** 0.5
print("The area of the triangle is", area)
GeometricObject class:
12.1 (The Triangle class) Design a class named Triangle that extends the Geometricobject class. The Triangle class contains Three float data fields named sidel, side2, and side3 to denote the three sides of the triangle. A constructor that creates a triangle with the specified sidel, side2, and side3 with default values 1.0 The accessor methods for all three data fields. A method named getArea O that returns the area of this triangle A method named getPerimeterO that returns the perimeter of this triangle. A method named-str-O that returns a string description for the triangleStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started