Search Results

Search found 1 results on 1 pages for 'user2900469'.

Page 1/1 | 1 

  • user enter data to different arrays

    - by user2900469
    This is fragment of my code (arrays as you can see): double[] Price; String[] names; int[] Quantity; Price = new double[5]; names = new String[5]; Quantity = new int[5]; Price[1] = 3.10; Price[2] = 7.80; Price[3] = 0.20; names[1] = "Ballpen"; names[2] = "Notebook"; names[3] = "Envelope"; Quantity[1] = 20; Quantity[2] = 5; Quantity[3] = 140; I enter data to arrays by myself in this case. Now i want to change my code so that my program asks user for names, price and quantity (using the Scanner class). After user enter data, program keep this in three different arrays. I dont know how to transfer data from user to arrays. I would be grateful for some example code or any help.

    Read the article

1