Assignemnt #68, Reverse Hi-Lo

Code

      /// Name: Alex Pinder
      /// Period: 5
      /// Program Name: Reverse Hi-Lo
      /// File Name: prog68.java
      /// Date Complete: 1/14/16
      
      import java.util.Scanner;
      
      public class prog68
      {
          public static void main( String[] args )
          {
              Scanner keyboard = new Scanner(System.in);
              
              int guess, lo, hi;
              String imput;
              
              lo = 1;
              hi = 1000;
              guess = ( lo + hi ) / 2;
              
              System.out.println( "Think of a number from 1 to 1000. I'll try to guess it." );
              
              System.out.println( "My guess is " + guess + ". Am I too (h)igh, too (l)ow or (c)orrect?" );
              imput = keyboard.next();
              
              while ( !imput.equals("c") )
              {
                  if ( imput.equals("h") )
                      hi = guess;
                  else if ( imput.equals("l") )
                      lo = guess;
                  
                  guess = (lo + hi ) / 2;
                  
                  System.out.println( "My guess is " + guess + ". Am I too (h)igh, too (l)ow or (c)orrect?" );
                  imput = keyboard.next();
              }
              
              System.out.println( "HA! I'm the greatest guesser in the WORLD!" );
          }
      }
    

Picture of the output

Assignment 68