Algorithm on how to get money from bank
Answers
Answered by
0
Answer:
All the change-making problem in the web talk only about ideal situation where we have unlimited ammount of coins/banknotes of every kind.
I want to deal with situation when ATM has limited ammount of: 10,20,50,100,200 bank notes and it has to find way to make change.
I've done sth like that but I cannot deal with for example demand of 110 dollars. Whole algorithm is in method withdrawCash() you can copy the code it compiles and works.
Output or 110$:
10 * 1 = 10
20 * 4 = 80
Notes of 10 left are 0
Notes of 20 left are 0
Notes of 50 left are 2
Notes of 100 left are 2
Notes of 200 left are 10
Pls mark me as the brainliest
If you follow me I will follow you
Similar questions