Question 271679
I'm not sure of the exact algorithm, but I would expect that the program would try to dispense the largest denominations possible (that are less than the amount of change required) and then work it's way down.


For example, if the machine is going to dispense 37 cents, it would first dispense a quarter (25 cents) since this is the largest denomination that is less than 37 cents. So 37-25 = 12 cents remain. Next up would be a dime (10 cents) since this is the largest coin under 12 cents. So 12-10 = 2 cents remain. Finally, the only choices left are 2 pennies. So four coins would be dispensed.