Question: 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,

 Problem C. (10 points) Triangle Perimeter Write a program named triangle.py

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 x 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 3-4-5 right triangle, so its perimeter is just 3+4+5=12. Here is a more complex example (user input in bold): Enter x value for point 1: 2.5 Enter y value for point 1: 1.6 Enter x value for point 2: 5.09 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

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!