Question
. Take input the x and y coordinates of two points and output the straight - line distance between the two points. Also output, LONG
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started