Answered step by step
Verified Expert Solution
Question
1 Approved Answer
File has the follwing text: Vancouver International Airport Canada 49.196691 -123.181512 Tucson International Airport USA 32.114510 -110.939227 University of Arizona USA 32.231885 -110.950109 Statue of
File has the follwing text:
Vancouver International Airport Canada 49.196691 -123.181512 Tucson International Airport USA 32.114510 -110.939227 University of Arizona USA 32.231885 -110.950109 Statue of Liberty USA 40.689249 -74.044500 Big Ben UK 51.500729 -0.124625 Forbidden City China 39.916345 116.397155 Sydney Opera House Australia -33.856784 151.215297 Ministro Pistarini International Airport Argentina -34.815004 -58.534828 Colosseo Italy 41.890210 12.492231 Golden Gate Bridge USA 37.819929 -122.478255Problem 2 (35 points): The file placelist.txt contains the place information (name, country, latitude and longitude). Write a C program that a) b) c) Reads places from a file called placelist.txt and stores it in an array of type place Prints, on screen, places in the database that are NOT in USA. Sorts the array of places in distance from Tucson city center and print the sorted array on screen. To do so, you will modify the void selection(int x[], int size) function that sorts ints given on the next page. If you hard-code the list of cities sorted by distance in your code, 0 point for this problem. 1) Your program MUST use the following structure: typedef struct place_s char name [100]; char country[30]; double latitude; double longitude; place; Note: the above structure can be modified (i.e., to include distance) so that it can be used with sorting
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started