title: For loop problems
body: <p>I'm trying to create a loop where the user enters some values for pizza toppings. They can have pepperoni, pineapple etc. When they type "done" I want it to break out of the loop. I have this all working. Its just my for loop which is the problem. I have 4 pizza topping, so naturally I put it to loop around 4 times. But if the user types in a wrong value, that uses up one of my 4 loops. Now I could set the counter to 200 so they are very unlikely to get it wrong that many times. But i'm hoping there is a cleaner version. So it will keep prompting the user until "done" is typed in. I tried using a while loop, with the do-while nested within it. Something like </p>
  
  <pre><code>   while( size != "done")
  </code></pre>
  
  <p>But that didn't work either. Hes my code : </p>
  
  <pre><code> public List&lt;String&gt; Input(){
      List&lt;String&gt; toppings = new ArrayList&lt;String&gt;();
      Scanner sc = new Scanner(System.in);
      String size;
  
      System.out.println("What pizza toppings; Pepperoni, Fungi, Pineapple or Bacon, type 'done' when your finished: ");
  
  FORLOOP:    for(int i = 0; i &lt; 4 ; i++){
  
      do {
          size = sc.next();
          if ( size.equalsIgnoreCase( "Pepperoni") || size.equalsIgnoreCase( "Fungi" )  || size.equalsIgnoreCase( "pineapple" ) || size.equalsIgnoreCase( "bacon" )) {
              toppings.add(size);
          } else if( size.equalsIgnoreCase( "done" ) ){
  
              break FORLOOP;
          }   
          else{
              System.out.print("Choose either 'Pepperoni', 'Fungi', 'bacon' or 'pineapple' Toppings, type 'done' when finshed: ");
  
          }
      } while ( false );
  
      }
      return toppings;
  }
  </code></pre>