The Simple ATM Interface is a beginner-friendly C++ project that simulates basic ATM operations in a console-based environment. This program is designed to demonstrate fundamental programming concepts such as loops, conditional statements, input validation, and formatted output.
A console-based ATM Interface built in C++.
It simulates basic banking operations such as checking balance, depositing funds, and withdrawing money.
Includes PIN authentication for secure access with a limit of three wrong attempts.
- π PIN Login with limited attempts
- π° Check Balance with currency formatting
- β Deposit Money with validation for positive amounts
- β Withdraw Money with overdraft protection
- π Looped menu until the user exits
- Run the program in your console.
- Enter the 4-digit PIN to access the ATM. (Default:
1234) - Select from the menu:
1β Check Balance2β Deposit Money3β Withdraw Money4β Exit
- Program ends after:
- Selecting Exit
- OR 3 incorrect PIN attempts
| Function | Description |
|---|---|
main() |
Handles PIN verification, menu navigation, and banking operations |
| Variable | Purpose |
|---|---|
double balance |
Stores current account balance |
const int PIN |
Stores the correct ATM PIN |
int attempts |
Tracks incorrect PIN entries |
int choice |
Stores menu selection |
double amount |
Stores entered deposit/withdrawal amount |
- Change PIN β Modify
const int PINin the code. - Set Initial Balance β Adjust
double balancein the code. - Enhance Security β Mask PIN entry or encrypt stored PIN.
- Add Features β Transaction history, multiple accounts, or file storage.
Linux/macOS
g++ atm.cpp -o atm
./atmWindows
g++ atm.cpp -o atm.exe
atm.exe