Question
Write a C program 107 18.3 66.1 San Juan, P.R. 45 21.18 157.5 Honolulu, Hawaii 54 24.33 81.48 Key West, Fla. 67 25.46 80.12 Miami,
Write a C program
107 18.3 66.1 "San Juan, P.R."
45 21.18 157.5 "Honolulu, Hawaii"
54 24.33 81.48 "Key West, Fla."
67 25.46 80.12 "Miami, Fla."
119 27.57 82.27 "Tampa, Fla."
103 29.23 98.33 "San Antonio, Tex."
47 29.45 95.21 "Houston, Tex."
79 29.57 90.04 "New Orleans, La."
6 30.16 97.44 "Austin, Tex."
51 30.22 81.4 "Jacksonville, Fla."
70 30.42 88.03 "Mobile, Ala."
35 31.46 106.29 "El Paso, Tex."
109 32.05 81.05 "Savannah, Ga."
50 32.2 90.12 "Jackson, Miss."
71 32.21 86.18 "Montgomery, Ala."
16 32.26 104.15 "Carlsbad, N.M."
111 32.28 93.42 "Shreveport, La."
34 32.38 115.33 "El Centro, Calif."
104 32.42 117.1 "San Diego, Calif."
39 32.43 97.19 "Fort Worth, Tex."
26 32.46 96.46 "Dallas, Tex."
17 32.47 79.56 "Charleston, S.C."
87 33.29 112.04 "Phoenix, Ariz."
10 33.3 86.5 "Birmingham, Ala."
5 33.45 84.23 "Atlanta, Ga."
62 33.46 118.11 "Long Beach, Calif."
24 34 81.02 "Columbia, S.C."
63 34.03 118.15 "Los Angeles, Calif."
128 34.14 77.57 "Wilmington, N.C."
46 34.31 93.03 "Hot Springs, Ark."
2 35.05 106.39 "Albuquerque, N.M."
66 35.09 90.03 "Memphis, Tenn."
3 35.11 101.5 "Amarillo, Tex."
38 35.13 111.41 "Flagstaff, Ariz."
19 35.14 80.5 "Charlotte, N.C."
83 35.26 97.28 "Oklahoma City, Okla."
108 35.41 105.57 "Santa Fe, N.M."
94 35.46 78.39 "Raleigh, N.C."
57 35.57 83.56 "Knoxville, Tenn."
122 36.09 95.59 "Tulsa, Okla."
58 36.1 115.12 "Las Vegas, Nev."
75 36.1 86.47 "Nashville, Tenn."
40 36.44 119.48 "Fresno, Calif."
125 36.51 75.58 "Virginia Beach, Va."
117 37.13 93.17 "Springfield, Mo."
98 37.17 79.57 "Roanoke, Va."
106 37.2 121.53 "San Jose, Calif."
97 37.33 77.29 "Richmond, Va."
127 37.43 97.17 "Wichita, Kan."
105 37.47 122.26 "San Francisco, Calif."
82 37.48 122.16 "Oakland, Calif."
64 38.15 85.46 "Louisville, Ky."
18 38.21 81.38 "Charleston, W. Va."
99 38.35 121.3 "Sacramento, Calif."
101 38.35 90.12 "St. Louis, Mo."
96 38.46 112.05 "Richfield, Utah"
126 38.53 77.02 "Washington, D.C."
41 39.05 108.33 "Grand Junction, Colo."
53 39.06 94.35 "Kansas City, Mo."
22 39.08 84.3 "Cincinnati, Ohio"
8 39.18 76.38 "Baltimore, Md."
95 39.3 119.49 "Reno, Nev."
27 39.45 105 "Denver, Colo."
49 39.46 86.1 "Indianapolis, Ind."
115 39.48 89.38 "Springfield, Ill."
86 39.57 75.1 "Philadelphia, Pa."
25 40 83.01 "Columbus, Ohio"
89 40.27 79.57 "Pittsburgh, Pa."
77 40.44 74.1 "Newark, N.J."
102 40.46 111.54 "Salt Lake City, Utah"
80 40.47 73.58 "New York, N.Y."
60 40.5 96.4 "Lincoln, Neb."
20 41.09 104.52 "Cheyenne, Wyo."
84 41.15 95.56 "Omaha, Neb."
78 41.19 72.55 "New Haven, Conn."
23 41.28 81.37 "Cleveland, Ohio"
28 41.35 93.37 "Des Moines, Iowa"
120 41.39 83.33 "Toledo, Ohio"
21 41.5 87.37 "Chicago, Ill."
92 41.5 71.24 "Providence, R.I."
116 42.06 72.34 "Springfield, Mass."
56 42.1 121.44 "Klamath Falls, Ore."
29 42.2 83.03 "Detroit, Mich."
13 42.21 71.05 "Boston, Mass."
30 42.31 90.4 "Dubuque, Iowa"
1 42.4 73.45 "Albany, N.Y."
14 42.55 78.5 "Buffalo, N.Y."
42 42.58 85.4 "Grand Rapids, Mich."
65 43 71.3 "Manchester, N.H."
61 43.02 81.34 "London, Ont., Can."
68 43.02 87.55 "Milwaukee, Wis."
118 43.02 76.08 "Syracuse, N.Y."
48 43.3 112.01 "Idaho Falls, Idaho"
112 43.33 96.44 "Sioux Falls, S.D."
12 43.36 116.13 "Boise, Idaho"
90 43.4 70.15 "Portland, Maine"
121 43.4 79.24 "Toronto, Ont., Can."
36 44.03 123.05 "Eugene, Ore."
55 44.15 76.3 "Kingston, Ont., Can."
72 44.15 72.32 "Montpelier, Vt."
88 44.22 100.21 "Pierre, S.D."
7 44.47 117.5 "Baker, Ore."
9 44.48 68.47 "Bangor, Maine"
32 44.54 67 "Eastport, Maine"
69 44.59 93.14 "Minneapolis, Minn."
100 45.18 66.1 "St. John, N.B., Can."
85 45.24 75.43 "Ottawa, Ont., Can."
73 45.3 73.35 "Montreal, Que., Can."
91 45.31 122.41 "Portland, Ore."
59 46.24 117.02 "Lewiston, Idaho"
44 46.35 112.02 "Helena, Mont."
11 46.48 100.47 "Bismarck, N.D."
31 46.49 92.05 "Duluth, Minn."
93 46.49 71.11 "Quebec, Que., Can."
37 46.52 96.48 "Fargo, N.D."
110 47.37 122.2 "Seattle, Wash."
114 47.4 117.26 "Spokane, Wash."
124 48.25 123.21 "Victoria, B.C., Can."
43 48.33 109.43 "Havre, Mont."
123 49.13 123.06 "Vancouver, B.C., Can."
76 49.3 117.17 "Nelson, B.C., Can."
129 49.54 97.07 "Winnipeg, Man., Can."
74 50.37 105.31 "Moose Jaw, Sask., Can."
15 51.01 114.01 "Calgary, Alba., Can."
33 53.34 113.28 "Edmonton, Alb., Can."
113 57.1 135.15 "Sitka, Alaska"
52 58.18 134.24 "Juneau, Alaska"
4 61.13 149.54 "Anchorage, Alaska"
81 64.25 165.3 "Nome, Alaska"
The program will read a file with city information that includes city id, location(x,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 linear (Euclidean) distance between the two chosen cities. 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.M. Amarillo, Tex. Anchorage, Alaska Atlanta, Ga. Austin, Tex. 1 2 4 6 Table 1: File Format ere 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) aStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started