I am crashing on my while loop during the second run. The first run goes smoothly. However once it runs for the second time it crashes on my switch statement. Can any one help me find what I did wrong. I'm lost and have been trying to solve it since last night.

} if ((length % 2 == 0) && (question.equalsIgnoreCase("good"))){//checks to see if even and question System.out.println("Yes"); } else if ((length % 2 != 0) && (question.equalsIgnoreCase("good"))){ //checks to see if odd and question System.out.println("No"); } else if (exclam.equalsIgnoreCase("good")){ //checks to see if ! System.out.println("Wow");

Why are you using strings instead of booleans for question and answer in the first place? That's ridiculous and unnecessarily confusing.

Also, there's no point making a separate variable for length - it makes it more confusing and less easy to read. Just use sentence.length - it will make debugging easier and also ensure readers of your code know what you're doing.

EDIT: The problem appears to be with keyboard.nextLine(); - let me read some docs.