How zainhassanbangash/atm-simulator works
This is a small, single-file C++ ATM simulator. The user selects an option in the console; main dispatches to balance check, deposit, or withdrawal, then continues its menu loop until exit. Deposit and withdrawal read amounts and display results through the console. The balance is held in main and passed to the operation functions. The excerpt shows no persistent storage. Notably, the initial balance is uninitialized, and the balance-check option passes zero directly. All shown relationships are evidenced by the sole source file.
Main entry points: ATM_SIMULATOR.cpp Menu loop
Components 6
Other components
- ATM user
- Console
- Menu loop
ATM_SIMULATOR.cpp - Balance check
ATM_SIMULATOR.cpp - Deposit
ATM_SIMULATOR.cpp - Withdrawal
ATM_SIMULATOR.cpp
Connections 13
- ATM user → Console: chooses option
- Console → Menu loop: provides choice
ATM_SIMULATOR.cpp - Menu loop → Console: shows menu
ATM_SIMULATOR.cpp - Menu loop → Balance check: calls
ATM_SIMULATOR.cpp - Menu loop → Deposit: calls
ATM_SIMULATOR.cpp - Menu loop → Withdrawal: calls
ATM_SIMULATOR.cpp - Deposit → Console: reads amount
ATM_SIMULATOR.cpp - Deposit → Console: displays result
ATM_SIMULATOR.cpp - Withdrawal → Console: reads amount
ATM_SIMULATOR.cpp - Withdrawal → Console: displays result
ATM_SIMULATOR.cpp - Balance check → Menu loop: returns balance
ATM_SIMULATOR.cpp - Deposit → Menu loop: returns updated balance
ATM_SIMULATOR.cpp - Withdrawal → Menu loop: returns balance
ATM_SIMULATOR.cpp