Consider a program that can calculate the distance between cities. The program should ask for the city names and calculate the results based on the following table:
| f r o m |
|||||
|---|---|---|---|---|---|
| 0) Indianapolis | 1) New York | 2) Tokyo | 3) London | ||
| 0) Indianapolis | 0 | 648 | 6476 | 4000 | |
| 1) New York | 648 | 0 | 6760 | 3470 | |
| 2) Tokyo | 6476 | 6760 | 0 | 5956 | |
| 3) London | 4000 | 3470 | 5956 | 0 | |
How would menus and arrays be used in such a program?
One possible solution is shown here. The more important idea is the process.