I'm also getting "tempinput cannot be resolved to a variable", how can I fix that? I am new to Java btw.
import java.util.Scanner;
public class TemperatureCheck {
public static void main(String [] args){
Scanner cin = new Scanner(System.in);
try{
while(cin.nextLine().isEmpty()){
System.out.print("Input a tempature to check: ");
int tempinput = cin.nextInt();
}
if(tempinput >= 65){
System.out.println("It is hot outside");
}else if(tempinput >= 50 && tempinput <= 64){
System.out.println("It is warm outside");
}else{
System.out.println("It is cold outside");
}
}finally{
cin.close();
}
}
}