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, , which refers to the number of cities in a file; Each of the next lines contains the country , the name of a city , and the elevation separated by "##". A sample input file, elevations.txt, can be found in this question.

The program firstly reads the input file. After that, it displays a menu and supports three functions as follows:

  1. Search the highest city in different countries: This function will display the highest city of all countries in the file.
  2. Search a city: This function will display the elevation information of the cities containing the keyword (case insensitive) given by the user.
  3. 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!