title: Need to iterate through two arrays of items for comparison without parallelism
body: <p>So for my java class I have to write a program that accepts toppings and adds 75 cents to total price for every topping. I haven't bothered for null testing yet because of this error. Essentially I will have:</p>
  
  <pre><code>list1 = Valid Toppings
  list2 = User Toppings
  </code></pre>
  
  <p>User toppings can be entered in any order so it doesn't make any sense to match them as a parallel array. You can see the logic I have used in the code snippet below, but it is not legal. My terminal vomits everywhere when I try to compile. How would I go about implementing the logic below, or perhaps a better way of implementing my logic completely?</p>
  
  <pre><code>  for(x = 0; toppings.length &lt; 3; x++)
      {
        if(toppings[x].equals(for(xx = 0; validToppings[0].length &lt; 3; xx++) {validToppings[xx]})
          {setSize(size); price += .75;}
          else
          {System.out.println("Error in Pizza class: Attempt to set invalid pizza topping" + x + "(" + toppings[x] + ")")};
      }
  </code></pre>