import java.util.Scanner;
public class LazyDays
{
public static void main (String[] args)
{
Scanner scan = new Scanner();
int temp;
System.out.println ("What is the current temperature?");
temp = scan.nextInt();
if (temp < 20)
{
if (temp > 95)
{
System.out.println("Go visit our shops!");
}
}
if (temp >= 80)
{
System.out.println("Go swimming!");
}
if (60 <= temp)
{
if (80 < temp)
{
System.out.println("Go play tennis!");
}
}
if (40 <= temp)
{
if (temp < 60)
{
System.out.println("Go play golf!");
}
}
if (temp < 40)
{
System.out.println("Go skiing!");
}
}
}
Assignment says we must use cascading if statements, which is why I use them. I keep getting this error:
LazyDays.java:8: cannot find symbol
symbol : constructor Scanner()
location: class java.util.Scanner
Scanner scan = new Scanner();
^