title: Error when trying to parse a string as an int
body: <p>In this Java program the user is supposed to guess a number from 1 to 100, and then if you press <code>S</code> it shows you a summary of the tries. The problem is that I am taking the input string and converting it to a number so I can compare it to the range, but then I also need to be able to use that string as a menu input. 
  UPDATE How can i make the program go back to the menu option after the user guesses correctly. So after the user wins, i would like for the problem to display the summary report which can be otherwise accessed by using S</p>
  
  <p>Here is my code</p>
  
  <pre><code>public class GuessingGame {
    public static void main(String[] args) {
  
  
      // Display list of commands
                  System.out.println("*************************");
                  System.out.println("The Guessing Game-inator");
                  System.out.println("*************************");  
                  System.out.println("Your opponent has guessed a number!");
                  System.out.println("Enter a NUMBER at the prompt to guess.");
                  System.out.println("Enter [S] at the prompt to display the summary report.");
                  System.out.println("Enter [Q] at the prompt to Quit.");
                  System.out.print("&gt; ");
  
  
      // Read and execute commands
      while (true) {
  
        // Prompt user to enter a command
        SimpleIO.prompt("Enter command (NUMBER, S, or Q): ");
        String command = SimpleIO.readLine().trim();
  
        // Determine whether command is "E", "S", "Q", or
        // illegal; execute command if legal.
        int tries = 0;
        int round = 0;
        int randomInt = 0;
        int number = Integer.parseInt(command);
        if (number &gt;= 0 &amp;&amp; number &lt;= 100) {
          if(randomInt == number){
  
                  System.out.println("Congratulations! You have guessed correctly." +
                                  " Summary below");
                  round++;
          }
          else if(randomInt &lt; number)
          {
                  System.out.println("your guess is TOO HIGH. Guess again or enter Q to Quit");
                  tries++;
          }      
          else if(randomInt &gt; number){
                  System.out.println("your guess is TOO LOW. Guess again or enter Q to Quit");
                  tries++;
          }
  
        } else if (command.equalsIgnoreCase("s")) {
           // System.out.println("Round        Guesses");
           // System.out.println("-------------------------");
          //  System.out.println(round + "" + tries);
  
  
  
        } else if (command.equalsIgnoreCase("q")) {
          // Command is "q". Terminate program.
          return;
  
        } else {
          // Command is illegal. Display error message.
          System.out.println("Command was not recognized; " +
                             "please enter only E, S, or q.");
        }
  
        System.out.println();
      }
    }
  }
  </code></pre>