Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Code using C Use a series of latitude and longitude data entered from the command line to calculate the TOTAL distance between 2 points. For

Code using C

Use a series of latitude and longitude data entered from the command line to calculate the TOTAL distance between 2 points. For example, assume the lat/long data is

(32.639987, -116.995167) and

(32.640870, -116.997001).

If the input from the command line is as follows:

E.g. C:\getDist 32.639987 -116.995167 32.640870 -116.997001

The output should be:

The distance between points (32.639987, -116.995167) and (32.640870, -116.997001) is 216.57 yards.

Do not prompt the user for information. Take your input data from the command line. Since the data is entered in lat/long pairs, your program will need at least 4 numbers to calculate distance, where location 1 is the first pair, and location 2 is the second pair.

Latitude and longitude data are typically in degrees so you will need to convert each to radians. Since ? (pi) radians is equivalent to 180 degrees, to convert from degrees to radians, you can multiply the angle in degrees by ?/180. For example, 90 degrees when converted to radians is 90* ? /180 = ? /2= 1.57096.

Use of functions:

Your program should make liberal use of functions. At a minimum, I anticipate your program having the following functions:

double toRadians( double deg); double distanceBetween(double lat1, double long1, double lat2, double long2);

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Pro SQL Server Wait Statistics

Authors: Enrico Van De Laar

1st Edition

1484211391, 9781484211397

More Books

Students also viewed these Databases questions

Question

What are the requirements of a measurable objective?

Answered: 1 week ago

Question

Describe Table Structures in RDMSs.

Answered: 1 week ago