I have output from data in ArrayList, I have below two ArrayList, where the price of first ArrayList in second ArrayList. I want to use the price for particular items to calculate the bill with some formula. I want to store the value eg. Apple=200.
Formula: Bill = Apple + (10 * Cake)
I have used HashMap.I have never used HashMap before. Or is there any other way to store values?
ArrayList<String> name = {Apple, Cake, ice-cream, Milk, Burger, Eggs}
ArrayList<String> values = {200, 350, 75, 80, 200, 100}
HashMap<List<String>, ArrayList<String>> nameWithvalues = new HashMap<>();
nameWithvalues.put(name, values);
Output
nameWithvalues :{[Apple, Cake, ice-cream, Milk, Burger, Eggs]=[200, 350, 75, 80, 200, 100]}