title: Game: Found a number in 5 attempts
body: <p>Here the goal of the game: The <strong>number to search</strong> is <code>5</code> and there are <code>5</code> <strong>attempts</strong>. </p>
  
  <p>The user enters a number...</p>
  
  <p>if the number is not 5, the user can enter an other number. He has 5 attempts.  </p>
  
  <p>My problem: When I found the number to search in my first attempt, I again have to enter several attempts. </p>
  
  <pre><code>import java.util.*;
  
  
  
  class Main {
    public static void main(String[] args) {
  
      Scanner enter = new Scanner (System.in);
  
      int choice_user = 0; 
      int number_to_search = 5; 
      int choice_user_number = 0;
      int number_attempt = 1;
      int i = 4;
  
      do{
  
        System.out.println("********Menu*******");
        System.out.println("1) - Start the game :");
        System.out.println("2) - Exit the game :");
  
        System.out.print("Enter your choice : ");
        choice_user = enter.nextInt();
  
        switch(choice_user){
  
          case 1: 
            System.out.println("Option 1 : ");
  
            while(i &lt; 5){
              System.out.print("Enter your number : ");
              choice_user_number = enter.nextInt();
  
              if(choice_user_number &gt; number_to_search){
                System.out.println("Smaller ! Attempt : " + number_attempt);
              }
              else if(choice_user_number &lt; number_to_search){
                System.out.println("Bigger ! Attempt : " + number_attempt);
              }
  
              else{
                System.out.println("Bravo ! Attempt : " + number_attempt);
              }
  
              number_attempt++;
              i--;
  
  
            }
            break; 
  
          default:
            System.out.print("Exit... ");
  
        }
  
      } while(choice_user != 2);
    }
  }
  </code></pre>
  
  <p>I don't understand my problem. Thank you for your help. 
  I also shared my code here: <a href="https://repl.it/repls/WindingImpossibleKernelmode" rel="nofollow noreferrer">https://repl.it/repls/WindingImpossibleKernelmode</a></p>