title: Simple Input Restriction Issues
body: <p>I have a program, first I need to enter the command - help, and why choose from 2 commands - exp or sum and so on. At first, help should always be entered, but I can not enter help, but I can enter exp or sum immediately, how do I make a notification so that if I enter exp or sum, the console wrote to me: enter the help command first</p>
  
  <p>My code: </p>
  
  <pre><code>import utils.Calculator;
  
  import java.util.Scanner;
  
  public class Never {
  
      public static final String STOP = "-stop";
  
      public static void main(String[] args) {
  
          Scanner scan = new Scanner(System.in);
          System.out.println("Enter command: for the initial operation of the program, type "help");
          String word = scan.nextLine(); 
  
          while (!word.equals(STOP)) {  
              switch (word) {
  
                  case "help": {
                      System.out.println("exp - outputs the root of a number");
                      System.out.println("sum - displays the sum of two numbers");
                  }
                  break;
                  case "exp": {
                      long result = Calculator.exp(scan.nextInt()); 
                      System.out.println(result);
                  }
                  break;
                  case "sum": {
                      System.out.println("Enter first number");
                      int first = scan.nextInt();
                      System.out.println("Enter second number");
                      int second = scan.nextInt();
  
  
                      long result = Calculator.sum(first, second);
  
  
                      System.out.println(result);
  
                  }
                  break;
                  default: {
                      System.out.println("Now exit programm");
                  }
  
              }
  
              word = scan.nextLine(); 
  
          }
  
      }
  
  }
  </code></pre>