An ATM receives an amount of money to be withdrawn from the user. It then gives to the
user bank notes whose value is the withdrawn amount. The ATM has only 100, 500, and 1000 baht bank
notes. Therefore, some amounts of money are not possible to be withdrawn. The ATM needs to validate the
amount entered by the user whether it can be given out by the combination of such bank notes or not. If
the ATM cannot release the amount of money for the user (e.g., 1520, 1040, etc.), it asks the user if he/she
wants to re-enter the amount, or quit. If the user chooses to re-enter the amount, the machine continues to
let he/she does that. If the user chooses to quit, the ATM just halts.
In addition, before the user can enter the amount to withdraw, he/she needs to enter the pin consisting
of 4 digits. The ATM checks if the pin is valid or not.
Write a program to simulate the ATM described above. There is a list of 10 valid pins in the program to
be used in checking against the pin the user is going to enter. Provide inputs and outputs as appropriate. If
the pin entered is wrong, ask the user again for the pin.