hi, i have a programming task concerned with extracting info from a set of road distances between places and with planning a route. I have been given road distances in miles for 11 cities in the USA. I have to write an interactive program that can store the distances between any given number of cities with input of the type: name1 name 2 distance. Please help to write a program using c++ as I am having huge difficulty. Greatly appreciated.
Hello Pooja, thank you for the question.
What part of the application is giving you difficulty? You have the set of data right? Do you need to read it in from a file? Your question doesn't really specify what you are having problems with. If you take in the first and second names, you can look up their distances since you have it stored, and then subtract the first from the second, take the absolute value (distance is never negative), and the report that to the screen. Sounds easy enough right?
If you could please be a little bit more specific I would love to help.