Program in C++ using GRAPHS Assignment

Added on - 18 Sep 2019

  • 3

    Pages

  • 1098

    Words

  • 96

    Views

  • 0

    Downloads

Trusted by +2 million users,
1000+ happy students everyday
Showing pages 1 to 1 of 3 pages
program in C++ using GRAPHSAn airline company needs an abstract data structure to represent the available flights. The company'sIT department chose agraph.You must use a graphto write the program required by thisassignment.Cities, Connections and Distances, andload.txtfileThe vertices of the graph represent cites. The edges represented the connections between one cityand another. The weights represented the distance in miles between the two cites connected by anedge.You choose the cities and connections. Include enough cities and connections that I will be able tomeaningful test your program.Make the distances between the cities realistic. You can use Google Maps and round off the distance.These vertices, edges and weights should be stored in a text file namedload.txt, which you will turn inwith your assignment. When your program starts, it will use theload.txtfile to load the vertices, edgesand weights into your program.Readme.txtfileDocument in areadme.txtfile (which you will turn in with your assignment) the cities and connectionsyou choose, and the distances assigned to each connection. When describing connections, separatelylistdirectconnections fromthroughconnections.Adirectconnection means you can fly from the departure city to the destination city without having tofirst fly through another city. For this type of connection, you list the departure city, the destinationcity, and the distance between the two cities.Athroughconnection means you can fly from the departure city to the destination city, but you firsthave to first fly to at least one another city. For this type of connection, you list the departure city, thedestination city, each city between the departure city and the destination city which is part of theconnection, and the total distance between the departure city and the destination city.Project StartupAs mentioned above, when your program starts, it will use theload.txtfile to load the vertices, edgesand weights into your graph. The program then will display a menu, and prompt the user to enter achoice:1. Choose departure city2. ExitYou may assume the user enters 1 or 2. No input validation is required.If the user chooses 2. Exit, then the program ends.Program lists Departure Cities, and user choosesIf the user choose 1. Choose departure city, then the program lists the cities. The cities don't have tobe listed in any particular order. However, an ascending letter or number should be to the left of eachcity so the user can use that letter or number to choose a city. For example:
desklib-logo
You’re reading a preview
Preview Documents

To View Complete Document

Click the button to download
Subscribe to our plans

Download This Document