Answered step by step
Verified Expert Solution
Question
1 Approved Answer
in C++ output Write a program that: asks the user for the coordinates of two points calculates the distance between them Use the library functions
in C++
Write a program that: asks the user for the coordinates of two points calculates the distance between them Use the library functions as much as possible. - The formula to find the distance between two points is: V (22 21 )2 + (92 41)? output: The distance between and C.-) is Test your program with the following pairs of points. (Check by hand first using a calculator - use the Windows calculator if you don't have your own. Just to be sure the answers are at the bottom of this paper): (0, 0) and (3, 4): This is easy to work out by hand. (2, 4) and (5,8): To make sure that it still works when the first point's coordinates are non-zero. (2,-4) and (-6, 1): To make sure it works when the coordinates are negative and the answer is not a whole number (-3.49, 7.25) and (5.31, -2.78). To make sure it still works when the coordinates are not whole numbers, or not positive. (1, 1) and (1, 1). Does it still wok when the points are the same? Input x1: 2 Input yl: -5 Input x2: -6 Input y2: 2 The distance between (2, -5 ) and (-6, 2) is 10.6301 output
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