Thanks for the help. I changed the input to playAgain instead but I'm now getting another error.
Okay, I'm obviously a beginner. Here is my way of thinking. Maybe you guys and gals can tell me where I'm off. I get most of the code up till this part and am confused with the repeat line below. Why would the error say
string is out of range?
// Ask the user if they want to play again.
System.out.println("Would you like to play again?");
System.out.println("Y = yes, N = no ");
playAgain = keyboard.nextLine(); // Read a line.
repeat = playAgain.charAt(0); // Get the first char.
} while (repeat == 'Y' || repeat == 'y');
The system.out seems simple. It prints the message to the user and asks if they want to play again and gives them options.
Next the line starting with playAgain takes what the user types and assigns it to the playAgain string. Does that sound correct?
The line with the repeat is where I'm confused. It sounds like the repeat is assigning the first character of playAgain as what is used to determine if we're going to play again or not.
The last while statement just means to repeat if the user enters a Y or y.