Hi!
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 is only 1 $50 note left in the machine and you want $100, it should dispence 1 x $50, 2 $20's and a $10.
I dabbled in Java a few years ago but I tried to do this and have no idea.
Maybe a variable to hole the amount of 50's, 20's and 10's in the machine? But after that I'm not sure.
Does anyone know how to achieve this? In Java or PHP even?
Thanks in advance!