switch(menuChoice)
{
/*case 1: showPlayerScores(tempArray); <-- uncomment this
break;*/
case 2: showAllScores(tempArray);
break;
default: System.out.println("Not A valid choice.");
break;
}
}
public static void showAllScores(int[][] tempArray)
{
for(int p=0; p < tempArray.length; p++)
{
for(int r=0; r < tempArray[p].length; r++)
{
System.out.println("Player "+(p+1)+" Round "+(r+1)+": "+tempArray[p][r]);
}
}
}
public static void showPlayerScores(int[][] tempArray)
{
Scanner keyboard = new Scanner(System.in);
System.out.println("Show scores for which player?");
int whichPlayer = keyboard.nextInt(); <-- your problem is from here on*
for(int p=0; p < tempArray[p].length; p++)
{
for(int r=0; r < tempArray[p].length; r++)
{
System.out.println("Player "+(p+1)+" Round "+(r+1)+": "+tempArray[p][r]);
}
}
}
showPlayerScores is really no different from showAllScores, minus a few lines. You ask for which player and even read it in from the keyboard, but you don't put it to use. In essence, you're making a call to two methods which perform basically the same function, with the array. If I haven't been clear, post back.