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.

- Eddie


All Answers

Answers by Expert:

Ask Experts




I can answer questions about the C++ language, object oriented design and architecture. I am knowledgable in a lot of the math that goes into programming, and am certified by ExpertRating.com. I also know a good deal about graphics via OpenGL, and GUIs.


I have completed numerous games and demos created with the C++ programming language. Currently employed as a software engineer in the modeling and simulation field. I have about 7 years experience.

©2016 About.com. All rights reserved.