Question: C++ program (complete) Q2. User input controlled while-loop (10 marks) The great circle distance is the distance between two points on the surface of a

C++ program (complete)

C++ program (complete) Q2. User input controlled while-loop (10 marks) The great

Q2. User input controlled while-loop (10 marks) The great circle distance is the distance between two points on the surface of a sphere. The average radius of earth is 6,371 km Let (x1, y1) and (x2, y2) be two GPS coordinates. The great circle distance between the two points can be computed using the following formula: d- radius X arccos(sin(x1) X sin(x2)+ cos(x1) X cos(x2) X cos(y1 -y2)) Regina's GPS coordinates is (50.4547,-104.6067). Write a program that prompts the user to enter the GPS coordinates of another city in degrees and display the great circle distance from Regina to that city. The program will then ask the user if you want to compute one to another city. If the answer is Y or '',the program will repeat the above computation. If the answer is 'N' or 'n", the program will terminate. If the user enters any other character, the program should repeat until a valid answer is entered. Q2. User input controlled while-loop (10 marks) The great circle distance is the distance between two points on the surface of a sphere. The average radius of earth is 6,371 km Let (x1, y1) and (x2, y2) be two GPS coordinates. The great circle distance between the two points can be computed using the following formula: d- radius X arccos(sin(x1) X sin(x2)+ cos(x1) X cos(x2) X cos(y1 -y2)) Regina's GPS coordinates is (50.4547,-104.6067). Write a program that prompts the user to enter the GPS coordinates of another city in degrees and display the great circle distance from Regina to that city. The program will then ask the user if you want to compute one to another city. If the answer is Y or '',the program will repeat the above computation. If the answer is 'N' or 'n", the program will terminate. If the user enters any other character, the program should repeat until a valid answer is entered

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!