What's wrong with my logic (Java syntax)
- by soda
I'm trying to make a simple program that picks a random number and takes input from the user. The program should tell the user if the guess was hot (-/+ 5 units) or cold, but I never reach the else condition.
Here's the section of code:
public static void giveHint (int guess) {
int min = guess - 5;
int max = guess + 5;
if ((guess > min) && (guess < max)) {
System.out.println("Hot..");
} else {
System.out.println("Cold..");
}
}