(Program) The roads of Kansas are laid out in a rectangular grid at exactly one-mile intervals, as shown in Figure 3.10. Farmer Pete drives his 1939 Ford pickup x miles east and y miles north to get to farmer Joe’s farm. Both x and y are integer numbers. Using this information, write, test, and run a C++ program that prompts the user for the values of x and y, and then uses this formula to find the shortest driving distance across the fields to Joe’s farm:
distance = sqrt(x 2 + y 2 );
Round the answer to the nearest integer value before it’s displayed.
Reference:
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.