Create a struct called airport with the following fields


Airport information.

Create a struct called Airport with the following fields:

Identifier. This should be an array of four character or a pointer to an array of characters.

The following properties are doubles:

Coordinates which consist of Latitude and Longitude. Latitude is positive to indicate is North of the Equator and negative when it's located in the southern hemisphere. Longitude is negative to indicate is West and positive to indicate it's East of the Greenwich median.

A magnetic variation which also is indicated negative for West and positive for East. It is OK to have no magnetic variation.

Elevation above sea level in feet.

For example San Diego airport has the values ID: SAN, Lat: 32.7335556, Long: -117.1896667, Var: 14, Elev: 16.8' (https://www.airnav.com/airport/SAN)

Also create a method inside the structure called getDistance that takes four doubles and use the formula from Project 1.

Create another method inside the structure called getDistance2, this method should take one and only one Airport as parameter. This method should break down the elements of each airport and call the getDistance method to return the distance in nautical miles.

To test your program, you will declare two Airport variables and will ask the user to enter their ID, Coordinates, Elevation and Magnetic Variation. Then you will calculate the distance between the two using the getDistance2 method. Assuming the user entered the values below, the program should work if it had the following code:

// Variable declaration

double dist;

Airport SAN, SFO;

// // User input

SAN.Latitude = 32.7335556;

SAN.Longitude = -117.1896667;

SFO.Latitude = 37.6188056;

SFO.Longitude = -122.3754167;

// Calculations

dist = SAN.getDistance2(SFO);

Don't forget your documentation.

Solution Preview :

Prepared by a verified Expert
Computer Engineering: Create a struct called airport with the following fields
Reference No:- TGS01702415

Now Priced at $25 (50% Discount)

Recommended (93%)

Rated (4.5/5)