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 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

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_2

Step: 3

blur-text-image_3

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 Administrator Make A Difference

Authors: Mohciine Elmourabit

1st Edition

B0CGM7XG75, 978-1722657802

More Books

Students explore these related Databases questions

Question

4 / 7 b = 5/21

Answered: 3 weeks ago

Question

What are the objectives of job evaluation ?

Answered: 3 weeks ago

Question

Write a note on job design.

Answered: 3 weeks ago

Question

Compute the derivative of f(x)cos(-4/5x)

Answered: 3 weeks ago

Question

Discuss the process involved in selection.

Answered: 3 weeks ago