I am making a simple script that would allow a manager to determine the costs of various paths.
The manager will first enter the costs of each segment (6 inputs).
Then the program must ask the manager to enter a sequence of segment IDs of a path along which they intend to travel (3 inputs) and the program will display the cost of that path. (example of what the end result should look like down bottom of thread)

This is what i have so far, i'm fairly sure that the beginning is correct (my array).
I am unsure of how to link the array of 6 segments with the next set of questions (making the path).




import java.util.Scanner;
public class asdf {


public static void main(String[] args) {
final int Segment = 5 ;

Scanner keyboard = new Scanner(System.in);
for (int count = 0; count <= Segment; count++)
{
System.out.print("Enter cost for Segment # " + count + ": ") ;
int reading = keyboard.nextInt();
}

//missing missing missing ??????????

System.out.println("Please enter your Segment number:" );
int num1 = keyboard.nextInt () ;

System.out.println("Please enter your 2nd Segment number:");
int num2 = keyboard.nextInt () ;

System.out.println("Please enter your 3rd Segment number:");
int num3 = keyboard.nextInt () ;

int Total = num1 + num2 + num3 ;
System.out.println ("Total cost for this path = " + Total) ;





This is what i need to happen at the end result, as an example:

Enter cost for segment 0: 2
Enter cost for segment 1: 3
Enter cost for segment 2: 1
Enter cost for segment 3: 4
Enter cost for segment 4: 2
Enter cost for segment 5: 3
Enter ID of segment 0 of path: 0
Enter ID of segment 1 of path: 3
Enter ID of segment 2 of path: 5
Total cost for this path: 9
Enter 0 to exit or any other number to evaluate another path: 1
Enter ID of segment 0 of path: 2
Enter ID of segment 1 of path: 5
Enter ID of segment 2 of path: 3
Total cost for this path: 8
Enter 0 to exit or any other number to evaluate another path: 0




im a noob at this
what am i missing?