// Boolean variables and flags // Find the maximum temperature, and determine if the // temperature ever goes below 60 import java.util.*; public class Temp { public static void main(String[] args) { Scanner console = new Scanner(System.in); boolean below60 = false; int maxTemp = -500; // Less than absolute 0 for (int i=1; i<=6; i++) { System.out.print("Enter temperature: "); int temp = console.nextInt(); if (temp > maxTemp) { maxTemp = temp; } if (temp < 60) { below60 = true; } } System.out.println("The max temperature was " + maxTemp); if (below60) { System.out.println("Temperature went below 60"); } } }