Get Academic Help Instantly!

Program to Calculate the Distance Between Cities on A Map Project


Program Information

Write a program to allow the user to calculate the distance between cities on a map.

Sounds pretty complicated, eh? Don’t worry, we’ll make a few simplifications here:

  • The distances are calculated in map units on the 2D map.
  • Each city is given a set of coordinates relative to some point on the map. We’ll call this origin (0,0).
  • There can only be a finite number of cities in the system at a given time (you decide this maximum).

But in order to make the system useful, we’ll have to add a few other features:

  • Each city has a name in addition to its coordinates (you can assume a maximum length for these names; but they must be able to hold spaces: Los Angeles, New York, etc.).
  • The user selects what action to take from a menu:
        1) Enter city Information
        2) calculate Distance between two cities
        3) Print All cities
        4) Quit

    Make sure you allow them to choose their options by both the number and the capitalized letter(s) of the choice.

  • They cannot calculate a distance until at least two cities have been entered.
  • When they have exactly two cities, assume they are the ends and print their distance.
  • When they have more than two cities, show them the list of cities and have them pick the two cities to calculate the distance between. Don’t let them choose the same city for both ends of the ‘trip’.
  • If your list is full and they choose to enter another city, have them choose to either NOT enter the new city or to overwrite one of the earlier cities (they choose which one). Print the list of cities for them to choose from. (Remember, you still can’t exceed your maximum list size!)


10% off for this assignment.

Our Prices Start at $11.99. As Our First Client, Use Coupon Code GET10 to claim 10% Discount This Month!!

Why US?

100% Confidentiality
100% Timely Delivery
100% Original Writing

100% Money Back

Cheap Essay Writing

Do my Assignment

Order custom essay

Sample Essays

Custom term paper

Write My Research Paper

Affiliate program

Custom essay

Research paper

Write my essay

Write my paper

Essay writers

Become a Freelance Writer

Contact us



Terms and conditions

Privacy policy

Proficient Concepts  is a professional writing service that provides original papers. Our products include academic papers of varying complexity and other personalized services, along with research materials for assistance purposes only. All the materials from our website should be used with proper references.