Assignemnt #68 and ReverseHiLo

Code

  /// name: Leila Ordukhani
  /// period: 6
  /// program name: Fifty-Eigth Program
  /// file name: ReverseHiLo.java
  /// date finished: 12/9/15

import java.util.Scanner;

public class ReverseHiLo
{
	public static void main ( String[] args )
	{
        
            Scanner keyboard = new Scanner(System.in);
            
            int hi = 1000;
            int lo = 1;
            int x = (hi + lo)/2;
            String response;
            
            System.out.println("Think of a number from 1 to 1000. I'll try to guess it.");
            System.out.println("My guess is " + x + ". Am I too high, too low, or correct?");
            response = keyboard.next();
            
            while (! response.equals("correct"))
            {
                if (response.equals("high"))
                    hi = x;
                else if (response.equals("low"))
                    lo = x;
                
                x = (hi + lo)/2;
                
                System.out.println("My guess is " + x + ". Am I too high, too low, or correct?");
                response = keyboard.next();
            }
            
            System.out.println("Ha! I am the greatest guesser in the WORLD!");
        }
    }

  

Picture of the output

Assignment 68