Question: You are asked to implement a program which can display the elevation information of cities in different countries. The elevation information is stored in an
You are asked to implement a program which can display the elevation information of cities in different countries. The elevation information is stored in an input file. The format of the input file is as follows:
| ... |
In the input file, the first line contains a positive integer,
The program firstly reads the input file. After that, it displays a menu and supports three functions as follows:
- Search the highest city in different countries: This function will display the highest city of all countries in the file.
- Search a city: This function will display the elevation information of the cities containing the keyword (case insensitive) given by the user.
- Search the N lowest cities: This function will display N lowest cities, where N can be any positive integer and is inputted by the user.
the
elevations.txt
10 South Africa##Bloemfontein##1395 China##Beijing##63 China##Kunming##1892 Japan##Tokyo##17 Canada##Calgary##1045 Zimbabwe##Harare##1480 Estonia##Tallinn##37 Canada##Ottawa##70 Bulgaria##Sofia##591 Canada##Edmonton##645
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
