Home / Questions / Prompt the user for two points (x1, y1), (y1, y2). Write a function that calculates the distance bet
Prompt the user for two points (x1, y1), (y1, y2). Write a function that calculates the distance between the points. For a refresher on how to calculate the distance between two points, click here: http://www.mathwarehouse.com/algebra/distance_formula/index.php
Start with this code:
#include // YOUR CODE GOES BELOW HERE
// TO HERE
// DO NOT CHANGE ANYTHING BELOW HERE
int main() {
double x1, y1, x2, y2;
cout
cin >> x1;
cout
cout
cin >> y1;
cout
cout
cin >> x2; cout
cout
cin >> y2;
cout
cout
cout
return 0; }
Sample run #1:
Enter x1: -5
Enter y1: 8
Enter x2: 0
Enter y2: -4
The distance is 13
MORE
Sample run #2:
Enter x1: 12.5
Enter y1: 18.7
Enter x2: -13.9
Enter y2: -29.5
The distance is 54.9563
Apr 02 2020 View more View Less
41.Which of the following is true of how managers may differ from shareholders? A.Managers can diversify the risks more easily.B.Managers are more likely to pursue pr...
Dec 10 2019For each of the following pairs of elements, choose the one that correctly completes the following table.K and CsTe and BrGe and SeThe more favorable (negative) electron ...
Jun 29 2021An is attached to a gusset plate with three bolts spaced at 3 inches with an end and edge distance of 1.5-in. as shown. Determine the available block shear strength of t...
May 25 2020contains (5,1) and parallel to the graph of 3x-y=2?
Mar 25 2020The Modigliani and Miller (MM) articles implicitly assumed thatbankruptcy did not exist. That led to the development of the"trade-off" model, where the firm's value f...
Dec 01 2019I need help with the statement of cash flow for month ended May 31st
Sep 16 2020In a gambling game a man is paid $5 if he gets all heads or all tails when 3 coins are tossed, and he pays out of $3 if either 1 or 2 heads show. what is his expected gai...
Apr 14 2020Prove the close form of sum (n^2), sum(n^3), sum(n^4) series using induction write X^2n+1-1 in close form with real polynomial coefficients. find roots of (X^2n+X^2n-1+X^...
Aug 07 2020Using the income statement for Sentinel Travel Service shown in Practice Exercise 1-4B, prepare a statement of owner's equity for the year ended August 31, 2019. Barb Sch...
Apr 09 2021Here are the most recent balance sheets for Country Kettles, Inc. Excluding accumulated depreciation, determine whether each item is a source or a use of cash, and the am...
Aug 30 2020