Question

1   42.4   73.45   Albany, N.Y. 2   35.05   106.39   Albuquerque, N.M. 3   35.11   101.5   Amarillo, Tex. 4  ...

1   42.4   73.45   Albany, N.Y.
2   35.05   106.39   Albuquerque, N.M.
3   35.11   101.5   Amarillo, Tex.
4   61.13   149.54   Anchorage, Alaska
5   33.45   84.23   Atlanta, Ga.
6   30.16   97.44   Austin, Tex.
7   44.47   117.5   Baker, Ore.

the above date is a text file (You can give any file name for the above text file. 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.

QUESTION:

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.

2) Display a menu (10 points ): a. Enter City 1 b. Enter City 2 c. Compute Distance d. Exit

3) When option a) or b) are selected, the program should determine automatically if the user entered the city id or the city name

4) If option c) is chosen: a. Find the index for each city, either using the id array or the city name array, b. Compute the linear distance

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Include <stdo.h? include <stging.h> )→ # そheader 込 ant main t intge declara tious chal chlios], City name → file declaration

the output of the above code is shown below.

output: employee details are: Uniqueinterger xcoordinate 42.4 35.05 35.11 61.13 33.45 30.16 44.47 ycoordinate 73.5 106.39 101

public closs patallel omay public stafic vod main Steringan 33-451 30,1 c , ч double LJ ycoinali 13. 5, 1ot.31, iol.s, 149.54

Add a comment
Know the answer?
Add Answer to:
1   42.4   73.45   Albany, N.Y. 2   35.05   106.39   Albuquerque, N.M. 3   35.11   101.5   Amarillo, Tex. 4  ...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • CPS 276 DOC02-- Assignment 02 Cost of Living Calculator Your client maintains job search website. As...

    CPS 276 DOC02-- Assignment 02 Cost of Living Calculator Your client maintains job search website. As a service on their website, they need an application that compares costs of living between different metropolitan areas. Client will pay $780 for a complete application. Background Information: A person living in an area with a high cost of living will need higher income to maintain the same standard of living as someone living in an area with a low cost of living. For...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT