A friend of mine is trying to write a simulation of an ATM and can't seem to get it right.
He want's it like so:
If a user wants $100 and there are no $50 notes left, the machine gives them 5 $20 notes. Or if there are only 2 $50 note left in the machine and you want $150, it should dispence 2 x $50's, 2 $20's and 1 $10.
Is there a way to account for this scenario?
I dabbled in Java a few years ago but I tried to do this and have no idea.
Does anyone know how to achieve this?
Thanks in advance!