Daniel B. answered 09/16/23
PhD in Computer Science with 42 years in Computer Research
static String getUserGuess(Scanner scanner)
{
String word;
do {
System.out.println("Come up with a prompt for your homework");
word = scanner.next(); // assume "word" implies no blanks
scanner.nextLine(); // consume end of line character
} while(word.length() != 5); // the specification requires 5 CHARACTERS, not LETTERS
return word;
}