Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem C. (10 points) Triangle Perimeter Write a program named triangle.py that will calculate the perimeter of a triangle. Ask the user for two points,

image text in transcribed
Problem C. (10 points) Triangle Perimeter Write a program named triangle.py that will calculate the perimeter of a triangle. Ask the user for two points, the third point of the triangle will be the point (0,0). Find the distances between all three points and add them up. Recall that the distance between 2 points (x1,y1),(x2,y2) on a Cartesian plane is given by: (x2x1)2+(y2y1)2 Here is possible output for your program (user input in bold): Enter x value for point 1: 3 Enter y value for point 1: Enter value for point 2: Enter y value for point 2: 4 A triangle formed by those two points and (,) has perimeter: 12. This was an example of a 345 right triangle, so its perimeter is just 3+4+5=12. Here is a more complex example (user input in bold): Enter value for point 1: 2.5 Enter y value for point 1:1.6 Enter x value for point 2: 5.89 Enter y value for point 2:1.32 A triangle formed by those two points and (,) has perimeter: 12.12967845119305

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

More Books

Students also viewed these Databases questions

Question

What lessons in intervention design, does this case represent?

Answered: 1 week ago