View the step-by-step solution to:


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


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.


Source  Destination route# distance

A               B                    AB1    12.3

A               B                    AB2    13.1

A              B                     AB3    13.3

A              C                     AC1      3.4

A             C                      AC2      3.6

A             C                      AC3      4.5


Sample update file:

Route            Speed

AB1                    23.3

AB2                    28.0

AB3                    34.4

AC1                    16.5

AC2                    15.4

AC3                     45.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.


Recently Asked Questions

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.


Educational Resources
  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question
Ask Expert Tutors You can ask 0 bonus questions You can ask 0 questions (0 expire soon) You can ask 0 questions (will expire )
Answers in as fast as 15 minutes