Question: make an application that will choose the best route to take given both the distance and the current traffic conditions. Create two arrays. The first

make an application that will choose the best route to take given both the distance and the current traffic conditions.

Create two arrays. The first has the travel distance between two points. There can be more than one path between origination and destination. You should make a file with 3 points and 3 paths between each pair.

The second array is the current update file. It will have the route numbers and the average speed at the current time.

Example:

SourceDestinationroute#distance

ABAB112.3

ABAB213.1

ABAB313.3

ACAC13.4

ACAC23.6

ACAC34.5

Sample update file:

RouteSpeed

AB123.3

AB228.0

AB334.4

AC116.5

AC215.4

AC345.6

Loop and ask the user for the source and destination of their trip. Use the data you stored to find the most efficient route.

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 Programming Questions!