## Note

When you finish, submit the .c file in the designated dropbox on D2L.

The Dropbox will be closed at the end of your lab session

If you cannot submit your code in the designated Dropbox, talk to TA ASAP!

The file placelist.txt contains place information (name, country, latitude and longitude). Write a C program that

• a) Asks the user to enter the file that contains the place database.
• b) Reads places from the place database file and stores them in an array of type place. Assume that no more than 100 places are in the placelist.txt file.
• c) prints places that are located in the USA
• d) allows a user to find the closest place to a given latitude and longitude. Upon a query, it displays the set of places and also the distance.
• e) is interactive (q to quit).

1) Your program MUST use the following structure:

2) Your program MUST use the following two user-defined functions (the first two must be developed, the last one is given):

Note: There is no need to use a linked list. The number of places in the given does not exceed 100 `=>` an array of type place will work. You will not be penalized if you choose to use a linked list.

Make sure you understand the sample code execution thoroughly before writing the code.

## Sample Code Execution:

``````Places in USA
Tucson International Airport, USA
(Latitude, Longitude) = (32.114510, -110.939227)

University of Arizona, USA
(Latitude, Longitude) = (32.231885, -110.950109)

Statue of Liberty, USA
(Latitude, Longitude) = (40.689249, -74.044500)

Golden Gate Bridge, USA
(Latitude, Longitude) = (37.819929, -122.478255)

You can search for the database entry closest to a longitude and latitude:
Enter latitude: 32.2
Enter longitude: -110.9

The database entry closest to (33.2 -110.9) is
University of Arizona, USA
(Latitude, Longitude) = (32.231885, -110.950109)
with a distance of 3.665 miles

Continue? (q to quit): y

You can search for the database entry closest to a longitude and latitude:
Enter latitude: -35
Enter longitude: 150

The database entry closest to (35 150) is
Sydney Opera House, Australia
(Latitude, Longitude) = (-33.856784, 151.215297)
with a distance of 105.051 miles

Continue? (q to quit): q
``````