Question: In C++, Write a function to calculate the distance between two points: Distance( x1, y1, x2, y2 ) For example: Distance(0.0, 3.0, 4.0, 0.0) should
In C++, Write a function to calculate the distance between two points:
Distance( x1, y1, x2, y2 )
For example:
Distance(0.0, 3.0, 4.0, 0.0) should return 5.0
Use the function in main to loop through reading in pairs of points until the all zeros are entered, printing distance with two decimal precision for each pair of points.
For example with input:
32 32 54 12 52 56 8 30 44 94 44 39 65 19 51 91 1 5 89 34 0 0 0 0
your output would be:
29.73 51.11 55.00 73.35 92.66
Example:
#include
// function will come here.
int main(){
Please only use coding in C++
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
