<%java String dayOfWeek = new java.text.SimpleDateFormat("EEEE").format(new java.util.Date()); %> <%java> String[] forecasts = new String[] { "partly cloudy", "mostly cloudy", "sunny", "rain", "snow" }; int whichForecast = (int) (Math.random() * 5); String forecast = forecasts[whichForecast]; Welcome to the free weather site. The weather for <% dayOfWeek %> is <% forecast %>. To get a better forecast, please sign up for our premium service. <%if forecast.equals("sunny") %>Go to the beach!<%else>Stay home and read a book! Our premium service can forecast <%for int i = 1; i < 5; i++ %><% i %>, 5 and 6 days ahead. Check it out! Note: Around here, the weather is always one of: <%for String possibility : forecasts %> <% possibility %>