Question: . Take input the x and y coordinates of two points and output the straight - line distance between the two points. Also output, LONG

. Take input the x and y coordinates of two points and output the straight-line distance between the two points. Also output, LONG LINE if straight-line distance between the two points is greater than 100, MEDIUM LINE if straight-line distance between two points is between 50 and 100 (both inclusive); SHORT LINE otherwise (i.e. straight-line distance is less than 50).

Lets assume user inputs the x and y coordinates of the first point in variables x1 and y1 and the x and y coordinates of the second point in variables x2 and y2.

It is OK to use digits in variable names as long as they are not at the beginning of the name.

The straight-line distance between the first and second points can be computed using the following formula

dist =

Hint:

You will need variables x1, y1, x2, y2 to hold user inputs.

A^B means A raised to the power of B. Calculating is the same as calculating X ^ 0.5

You will also need a multi-way decision structure in this problem.

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!