title: Getting multiple Strings into an Array
body: <p>I'm having difficulties with my homework. I have the basic logic down but I'm messing up. The objective is to make a receipt from a shopping list that's inputted by the user. For example, the user enters:</p>
  
  <pre><code>Apples
  
  OraNgeS // also it's not case sensitive
  
  Oranges
  
  Bananas
  
  !checkout //this is to indicate the list is over
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>Apples x1
  
  Oranges x2
  
  Bananas x1
  </code></pre>
  
  <p>I'm stuck. My code so far:</p>
  
  <pre><code>public static void main(String[] args) {
      Scanner  keyboard    = new Scanner(System.in);
  
      System.out.printf("Enter the items you wish to buy:"); 
      String[] input = new String [keyboard.nextLine()];
      keyboard.nextLine(); //consuming the &lt;enter&gt; from input above
  
      for (int i = 0; i &lt; input.length; i++) {
          input[i] = keyboard.nextLine();
      }
  
      System.out.printf("\nYour input:\n");
      for (String s : input) {
          System.out.println(s);
      }
  }
  </code></pre>
  
  <p>I know I'll have to add the if statement eventually so if they type in "!checkout" it'll end the list. but I can't get past this yet.</p>
  
  <p>Any tips or advice?</p>