posted 4 years ago
Hello,
I need to process my array list and calculate the total that is take from each account balance.
I can't have another data structure as per homework.
POJO's
First though was to loop over the list and
This does not work as the previous total is added to the next customer.
A potential solution would be to add an accountKey to the Customer and Account, so I can have a constant in both lists, to check if they match and calculate the total.
Maybe that would stop the addition of balance to the next customer.
I don't think that is a go, tho.
Thank you for reading.