Question: Write a C++ program that uses an adjacency list to print all possible travel itineraries for a flight trip request between two cities (from and

Write a C++ program that uses an adjacency list to print all possible travel itineraries for a flight trip request between two cities (from and to cities).

For example,

Itinerary 1:

Request is to fly from Albuquerque to San Diego

Flight # 178 from Albuquerque to Chicago Cost: $250

Flight # 703 from Chicago to Sand Diego Cost: $325

Total Cost . $575

Itinerary 2:

Request is to fly from Albuquerque to San Diego

Flight # 178 from Albuquerque to Saint Louis Cost: $500

Flight # 703 from Saint Louis to Sand Diego Cost: $500

Total Cost . $1000

Request is to fly from Albuquerque to Paris

Sorry. We do not fly from Albuquerque to Paris

Your program will maintain the following information:

From City to city cost

A C 250

A B 300

B D 125

B H 50

C E 128

C D 600

C B 340

D E 440

D F 150

D H 300

E I 145

G C 300

F I 250

F G 900

I C 490

H G 130

Your program will:

- ask the user to enter from-city and to-city

- Find all paths between the two cities if they exist and list them. Remember to randomly assign a flight number to each path, list the cost of individual flights and then total cost (similar to the example)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!