import java.util.Random;

/** A high-low guessing game. */
public class HighLow {
 
  /**The number to guess. */
  private int number;
    
  /** 
   * Create a new high-low game with a number
   * to guess between 0 and upperbound. 
   */ 
  public HighLow(int upperbound) {
    
    // a random number generator
    Random r = new Random();

    // set the number to guess to a random integer
    // between 0 and upperbound
    this.number = r.nextInt(upperbound);
  }
  
  /**
   * Guess the number.
   */
  public void makeGuess(int guess) {    
    
    if (guess == this.number) {
      System.out.println("You got it!");
    } else if (guess < this.number) {
      System.out.println("Too low!");
    } else {
      System.out.println("Too high!");
    }
  } 
}