title: How to add arrays where I'll input the items and the data will show, not static array I want it dynamic
body: <p>As you can see, I have arrays where I've already called the string, my professor instructed me to add the string by inputing the value and showing the results through scanner. </p>
  
  <p>My professor wants that I'll input the Item ID, item description and the price, and compute it. I don't know how I should do the scanner for 3 arrays, would you guys please help how to do it thanks.</p>
  
  <p>Please bear with me if I'm bad at asking questions this is my first time doing it on stackoverflow. Thanks!</p>
  
  <p>P.S If you guys are getting confused with the codes I can provide the full codes, please comment as my original code is working with the original output.</p>
  
  <p>Btw I know how to use scanner but I don't know how to use them in arrays and store it into 3 arrays.</p>
  
  <pre><code>               String[] id = new String[]{"item1", "item2", "item3", "item4", "item5"};
                 String[] item = new String[]{"Apple ", "Mango", "Orange", "Grapes", "Melon"};
                 int[] price = new int[]{10, 12, 15, 20, 27};
                 String itemEntered = "";
                 boolean count_item = false;
                 String itemQuery = "";
                 JOptionPane.showMessageDialog((Component)null, "", "Shopping Cart", 1, icon);
                 System.out.println("Item Id\t\tItem Description\t\tPrice");
  
                 for(int ix = 0; ix &lt; item.length; ++ix)
                 {
                     System.out.println(id[ix] + "\t\t\t" + item[ix] + "\t\t\t\t" + price[ix]);
                 }
  
                 ArrayList itemID = new ArrayList();
                 ArrayList itemName = new ArrayList();
                 ArrayList quantity = new ArrayList();
                 ArrayList total = new ArrayList();
  </code></pre>
  
  <p>Original output:</p>
  
  <pre><code>
  Item Id         Item Description        Price
  item1           Apple            10
  item2           Mango            12
  item3           Orange           15
  item4           Grapes           20
  item5           Melon            27
  </code></pre>
  
  <p>Example expected output:</p>
  
  <pre><code>Item Id     Item Description        Price
  qwre            Pants            100
  asdf            Goodies          120
  asdfg           Accessories      150
  iqwe            Testing          200
  eswry           Melon            270
  </code></pre>
  
  <p>As seen from above I should be the one to input the data through the scanner, not declared through the code.</p>