Question: The program will read a file with city information that includes city id, locationx y) and city name; after reading the file the program will

 The program will read a file with city information that includes

The program will read a file with city information that includes city id, locationx y) and city name; after reading the file the program will display a menu; using the menu, the user will choose two cities (either by id or name) and compute the lincar (Euclidean) distance between the two chosen cities. Given a file with the following format: int double double c-string For example 73.45 186.39 Albuquerque,N.M. 181.5 149.54 Anchorage, Alaska 84.23 97-44 Albany, N.Y Amarillo, Tex Atlanta, 6a 1 42.4 2 35.05 3 35.11 61.13 5 33.45 6 38.16 Austin, Tex Table i: File Format Where Column I is the ID-Unique integer Column 2 is X coordinate, Column 3 is Y coordinate. Column 4 is city name. It may include state province and country valuc. It may not be contiuous Write a program to l) Read the data from the input file Store the information using parallel arrays: onc array for ID, one for X coordinates, one for Y coordinates and one for string names. Assume that the maximum number of enisie. cities) is 1000(20 points) a. CS1325 page: 2 2) Display a menu (10 points ): a. Enter City 1 b. Enter City 2 c. Compute Distance d. Exit Notice o Make sure your options are letters numbers are not allowed Whon option a) or b) is sclectod, the program should determinc automatically if the user entered the city id or the city mame (20 points) (20 points) If the city names given partially (iche user cnterad only Al), the program should display a list of city names that start with AL Note only the ciry names shat start with the entered sex

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!