Question: C programming help. I have this assignment: I know how to read the file and put all 100 hundred cities, id, xoord, y coord (there

C programming help.

I have this assignment:

C programming help. I have this assignment: I know how to read

I know how to read the file and put all 100 hundred cities, id, xoord, y coord (there are more then what is in the pic), and put them in arrays, I know how to make my menu work well. But how do I do part 3, how do I automatically know whether they used an int (for id) or they typed in a string? It makes no sense to me, please help. I can provide my code if that helps.

Given a file with the following format: int double double c-string For example 42.4 35.05 35.11 61.13 33.45 30.16 73.45 106.39 101.5 149.54 84.23 97.44 Albany, N.Y. Albuquerque, N.IM Amarillo, Tex. Anchorage, Alaska Atlanta, Ga Austin, Tex. 1 4 6 Table 1: File Format Where Column 1 is the ID - Unique integer value. It may not be continuous, Column 2 is X coordinate, Column 3 is Y coordinate, - Column 4 is city name. It may include state/province and country Write a program to 1) Read the data from the input file, Store the information using parallel arrays: one array for ID, one for X coordinates, one for Y coordinates and one for string names. Assume that the maximum number of entries(i.e. 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 Make sure your options are letters( numbers are not allowed) o 3) When option a) or b) is selected, the program should determine automatically if the user entered the city id or the city name (20 points) a. (20 points) If the city name is given partially (i.e. the user entered only Al), the program should display a list of city names that start with Al. Note: only the city names that start with the entered text (10 points) If city 1 and city 2 are the same (either id or city name), a message should warn the user and ask to try to enter the city again. b

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!