<sample run>
Enter the number of vertices: 6
The number of vertices is 6
Enter the triplets in one line: 0, 1, 100 | 0, 2, 3 | 1, 3, 20 | 2, 3,
40 | 2, 4, 2 | 3, 4, 5 | 3, 5, 5 | 4, 5, 9
*29.5 (Find shortest paths) Write a program that reads a connected graph from the console. The graph is
represented in the same format as specified in Exercise29_04Extra. Your program should
prompt the user to enter the number of vertices, the edges, and then two vertices, and should
display a shortest path between the two vertices. For example, for the graph in Figure 23.16, a
shortest path between 0 and 1 can be displayed as 0 2 4 3 1.
Read the input using nextLine() as a string and then
extract string into integers. Use
https://liangpy.pearsoncmg.com/test/Exercise29_05Extra.txt
to test your code. When you submit it to REVEL. When you
test the code using the CheckExercise tool, you need to
submit the entire code.
<sample run>
Enter the number of vertices: 6
Extra Exercise for Chapter 30