Question: C++: Input data contains a list (between 2 to 2000) of cities with their coordinates. The cities in the list are neither guaranteed to be
C++:
Input data contains a list (between 2 to 2000) of cities with their coordinates. The cities in the list are neither guaranteed to be alphabetically sorted, nor unique. If cities are repeated, get rid of the duplicate so it is only on the list once. Each line contains a city (string) and two numbers, geographic coordinates in the decimal notation. Sort the list of the cities by their latitudes and longitudes first going West to East, them sort them going North to South. Display the West-most and East-most cities, then the North-most and South-most.
Example data:
Input: Chicago 36.8297222 -84.8491667
Naperville 37.9886111 -84.4777778
Lisle 37.0833333 -88.6000000
Output
WE: Lisle - Naperville
NS: Naperville - Chicago
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
