/* Author : Michael Robinson Program : whileLoop.java Purpose : To present the while loop Updated : Jan 29, 2099 */ public class whileLoop { public static void theWhileLoop( int temperature ) { boolean x = false; System.out.print( "Temperature is normal" ); while( x != true ) { System.out.print( "." ); if( temperature >= 99 ) { System.out.println( "\nTemperature is > 99 degrees" ); System.out.println( "Turning computer off ....." ); x = true; //reset condition to true & terminate loop } temperature++; //increasing temperature by one degree }//end while( x != true ) }//end public static void theWhileLoop() public static void main( String arg[] ) { theWhileLoop( 60 ); }//end public static void main( String arg[] ) }//end public class whileLoop