Question: C++ In this program, you create a map and find the route from a source location to a destination location. You will use structure(s), pointer(s)
C++ In this program, you create a map and find the route from a source location to a destination location. You will use structure(s), pointer(s) and class(es) to accomplish this task. Let's begin by looking at the following map: The letters of the alphabet represent the locations. Each line represents a highway and each location has one exit highway and one entry highway. You may only leave a location through its exit highway and enter it through its entry highway. (For example The route from location A to D using this map is A rightarrow E rightarrow C rightarrow B rightarrow D) Your code will implement this First, you will begin by creating the map above in your code using class(es), structure(s), pointer(s) and anything else you may want to use. Once you have the map, you will prompt the user to enter new names for the locations represented by A, B, C, D, E, above. Once you have accomplished that, you have created your map. Next, you will prompt the user for the starting location and destination location. You will use the map to figure out and then display the route from the starting location to the destination location. You must keep track of how many times a location is chosen as a destination. You must, then, display the following menu and continue to do so until the user decides to exit the program: C - to enter another source & destination pair P - to see the most popular destination locations E - to exit If the user enters P, you must display the locations from most popular (chosen the most number of times as destination) to least popular. If two or more locations have been chosen as the destination the same number of times, list them in alphabetical order. Please remember to place appropriate error checks
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
