public static void main(String[] args) throws IOException {
System.out.println("Hello, come and play a game with me!");
int x = 5;
int guess;
do {
System.out.println("Please input a number...");
guess = System.in.read();
guess = System.in.read();
if (guess < 5) {
System.out.println("You guessed the number!");
break;
}
} while (guess > 5);
}
So here I wrote some code. It's supposed to be a guessing game, but no matter what I input, it always gives me in the output "Please input a number..." NO MATTER WHAT I PUT. Basically, if the "guess" is more than 5, then they guessed the number. If it's not, then they haven't guessed the number. That's the premise of the game. Can someone help me fix my code, so it doesn't just output the same thing regardless?