im making a personal app for my job. i want to list indigent's for each thing i make so i know what im gonna need for the day in weight.
so lets say like i have 3 different things i can make
food 1 = sugar: 2, eggs: 4, cheese: 3
food 2 = sugar: 5, eggs: 4, brownSugar: 3
food 3 = flour: 2, eggs: 4, cheese: 3
so let's say today have to make 2 batches of food 1, 3 batches of food 2 and 1 batch of food 3.
it would output
Sugar: 19
Eggs: 24
Cheese: 9
brownSugar: 9
Flour: 2
If anyone can point me in the right direction on going about this that would be great.. i was thinking set every food up as an array and try to add them each ingredients value by name.