Assignemnt #68 and Reverse Hi-Lo

Code

    
    ///name: nick cerdan
    ///period: 6
    ///program name: Reverse Hi-Lo
    ///file name: RHiLo.java
    ///date finished: 10/23/15
    
    import java.util.Random;
    import java.util.Scanner;
    
    public class RHiLo
    {
        public static void main(String[] args)
        {
            Random r = new Random();
            Scanner keyboard = new Scanner(System.in);
            
            int hi, lo, guess;
            String response;
            
            lo = 1;
            hi = 1000;        
            guess = (lo + hi)/2;
            
            System.out.println("Think of a number between 1-1000, and i'll try to guess it");
            System.out.println("My guess is " + guess + " am I to (h)igh, (l)ow, or (c)orrect?");
            System.out.print("> ");
            response = keyboard.next();
            
            while (!response.equals("c"))
            {
                if (response.equals("h"))
                {
                    hi = guess;
                    guess = (lo + hi)/2;
                    System.out.println("My guess is " + guess + " am I to (h)igh, (l)ow, or (c)orrect?");
                    System.out.print("> ");
                    response = keyboard.next();
                }
                
                else if (response.equals("l"))
                {
                    lo = guess;
                    guess = (lo + hi)/2;
                    System.out.println("My guess is " + guess + " am I to (h)igh, (l)ow, or (c)orrect?");
                    System.out.print("> ");
                    response = keyboard.next();
                }
            }
            
            System.out.println("Yay! I got it!");
        }
    }
    
    Assignment 67