ATM Withdrawal Simulation
PROFile Handling & SimulationSimulation
State Tracking
Simulate a simple cash machine. The account balance starts at 500 and the correct PIN is 1234.
**Step 1 - PIN entry:** The user has up to 3 attempts. For each wrong PIN, output `Wrong PIN`. A correct PIN moves on to Step 2. If all 3 attempts are wrong, output `Card blocked` and stop (do not input anything else).
**Step 2 - Withdrawals:** Repeatedly input a withdrawal amount (a non-negative integer) until 0 is entered. For each amount:
- If it is greater than the current balance, output `Insufficient funds`.
- Otherwise, if it is not a multiple of 10, output `Invalid amount`.
- Otherwise, subtract it from the balance and output the new balance.
When 0 is entered, output `Goodbye`.
For example, the inputs 1234, 100, 0 produce `400` then `Goodbye` (one per line).
Example Input
1234
100
0
Example Output
400
Goodbye
0% (0 passed / 0 attempted)