Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

. 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

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 Security

Authors: Alfred Basta, Melissa Zgola

1st Edition

1435453905, 978-1435453906

More Books

Students also viewed these Databases questions

Question

=+1 Do we have knowledgeable staffing for a global strategy?

Answered: 1 week ago

Question

In an Excel Pivot Table, how is a Fact/Measure Column repeated?

Answered: 1 week ago