Sign InCreate Account

Upgrade to Pro

Upgrade Now

Coding Workspace

EditorProjectsPractice QuestionsTimed Mock ExamsFlowcharts

PseudoEditor AI

Pseudocode TutorCode GeneratorCode FixerCode Converter
Back to Problems
PreviousNext

Sign in to run tests against edge cases and save your code automatically.

Problem Description

Hard

ATM Withdrawal Simulation

PROFile Handling & Simulation
Simulation
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

Success Rate:

0% (0 passed / 0 attempted)

Code

Draft auto-saved

Test Results

Click "Test Code" to evaluate your code against the tests.

Product

For SchoolsOverviewFeaturesFAQ
PseudoEditor

© 2026 PseudoEditor. All rights reserved.