Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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)

image text in transcribed 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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Internals A Deep Dive Into How Distributed Data Systems Work

Authors: Alex Petrov

1st Edition

1492040347, 978-1492040347

More Books

Students also viewed these Databases questions

Question

Evaluate the integral. Jo 4 + r2 dr

Answered: 1 week ago

Question

Explain the multicultural organization development (MCOD) process.

Answered: 1 week ago

Question

What is Working Capital ? Explain its types.

Answered: 1 week ago

Question

=+ Who do you think is right? Why?

Answered: 1 week ago