Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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)

image text in transcribed

image text in transcribed

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:

image text in transcribed

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 triangle

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing

Authors: David J. Auer David M. Kroenke

13th Edition

B01366W6DS, 978-0133058352

More Books

Students also viewed these Databases questions

Question

3. How has Starbucks changed since its early days?

Answered: 1 week ago