Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please Comment Code, Thanks! Write C code for the fallowing: Here is placelist.txt content: Vancouver International Airport Canada 49.196691 -123.181512 Tucson International Airport USA 32.114510

Please Comment Code, Thanks!

Write C code for the fallowing:

image text in transcribedimage text in transcribedimage text in transcribed

Here is placelist.txt content:

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.478255 
Problem 2 (35 points): The file placelist.cxt contains the place information (name, country latitude and longitude). Write a C program that a) Reads places from a file called placelist.txt and stores it in an array of type place b) Prints, on screen, places in the database that are NOT in USA. c) 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 sclection(int x[], int sizc) 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 f char name [100]; char country[30]; double latitude; double longitude; bplace; 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

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

DB2 11 The Database For Big Data And Analytics

Authors: Cristian Molaro, Surekha Parekh, Terry Purcell, Julian Stuhler

1st Edition

1583473858, 978-1583473856

More Books

Students also viewed these Databases questions