#else if statement trouble

3 messages · Page 1 of 1 (latest)

wooden niche
#

the boolean is set to false by default,, but everything I input, even things that wouldn't make it true, the output is always as if it is true.

feral pagoda
#

What is receiveGrade?

hearty laurel
#

Because recieveGrade is set to false by default, you can treat your recievedGrade in the if statement as "false". If the user inputs "no", response.equalsIgnoreCase("yes") evaluates to false. Because false == false, it goes through with the if statement as true.