In: Computer Science
SUMMER would be 90 or higher
SPRING would be 70 to less than 90
FALL would be 50 to less than 70
WINTER would be less than 50
Consider it an error if the user ever accentually enters a value less than 0, greater than 110.
import java.util.Scanner;
public class Temperature
{
public static void main(String args[])
{
Scanner sc = new
Scanner(System.in);
System.out.println("Enter temperature: ");
int temp =
sc.nextInt();
if(temp < 0 || temp
> 110)
System.out.println("Please enter a valid temperature value");
else if(temp >=
90)
System.out.println("Most Likely SUMMER");
else if(temp >= 70
&& temp < 90)
System.out.println("Most Likely SPRING");
else if(temp >= 50
&& temp < 70)
System.out.println("Most Likely FALL");
else if(temp <
50)
System.out.println("Most Likely WINTER");
}
}