E-ATMSystem is a console-based ATM simulation system developed in C++ using Object-Oriented Programming (OOP) principles.
The project simulates the core functionalities of a real Automated Teller Machine (ATM), including secure authentication, deposits, withdrawals, balance inquiries, session receipts, and persistent data storage using text files.
The application was refactored from a procedural implementation into a modular OOP architecture to improve maintainability, readability, and scalability.
- Features
- Login Information
- Database Structure
- How It Works
- Project Structure
- System Architecture
- System Diagrams
- Learning Goals
- Changes from Previous Version
- Author
- Secure login using Account Number and PIN Code
- Maximum of 3 login attempts
- Automatic session logout
- Return to Login Screen after Logout
- Quick Withdraw
- Normal Withdraw
- Deposit
- Check Balance
- Logout
- Records all successful transactions during the current session
- Generates a receipt when logging out
- Receipt is saved as Receipt.txt
- Previous receipt is automatically replaced
- Clients are stored inside
Clients.txt - Account balances are updated immediately
- Data is preserved between executions
- Login Screen
- ATM Main Menu
- Quick Withdraw Screen
- Normal Withdraw Screen
- Deposit Screen
- Check Balance Screen
Example account:
| Account Number | PIN Code |
|---|---|
| AD100 | 1234 |
Client accounts can be modified directly inside Clients.txt.
Stores all client information.
| Field |
|---|
| Account Number |
| PIN Code |
| Client Name |
| Phone |
| Account Balance |
Each record uses the custom separator:
#//#
Example:
AD100#//#1234#//#Youness Chergui Amin#//#0600000000#//#3500
- Client enters Account Number and PIN Code.
- Credentials are validated.
- ATM Main Menu is displayed.
- Client performs one or more banking operations.
- Every successful transaction is recorded in the current session.
- Client logs out.
- The system asks whether to generate a receipt.
- Receipt is saved to Receipt.txt.
flowchart TD
Start((Start)) --> Login["Login Screen"]
Login --> Input["Enter Account Number & PIN"]
Input --> Auth{"Valid Login?"}
Auth -- "No" --> Attempts{"Failed Attempts = 3?"}
Attempts -- "No" --> Login
Attempts -- "Yes" --> Exit["Exit Application"]
Auth -- "Yes" --> CurrentClient["Load CurrentClient"]
CurrentClient --> Main["ATM Main Menu"]
Main --> QW["Quick Withdraw"]
Main --> NW["Normal Withdraw"]
Main --> DP["Deposit"]
Main --> CB["Check Balance"]
Main --> LO["Logout"]
QW --> Save1["Update Clients.txt"]
NW --> Save2["Update Clients.txt"]
DP --> Save3["Update Clients.txt"]
Save1 --> Session["Add Transaction to Session"]
Save2 --> Session
Save3 --> Session
CB --> Main
Session --> Main
LO --> ReceiptChoice{"Save Session Receipt?"}
ReceiptChoice -- "Yes" --> Receipt["Generate Receipt.txt"]
ReceiptChoice -- "No" --> Clear["Clear Session"]
Receipt --> Clear
Clear --> Reset["Clear CurrentClient"]
Reset --> Login
classDiagram
class clsPerson {
+Name()
+Phone()
}
class clsATMClient {
+AccountNumber()
+PinCode()
+AccountBalance()
+Find()
+Deposit()
+Withdraw()
+Save()
+IsEmpty()
}
class clsScreen {
+_DrawScreenHeader()
+_DrawScreenHeaderMain()
}
class clsLoginScreen {
+ShowLoginScreen()
}
class clsATMMainScreen {
+ShowATMMainMenu()
}
class clsQuickWithdrawScreen {
+ShowQuickWithdrawScreen()
}
class clsNormalWithdrawScreen {
+ShowNormalWithdrawScreen()
}
class clsDepositScreen {
+ShowDepositScreen()
}
class clsCheckBalanceScreen {
+ShowCheckBalanceScreen()
}
class clsReceipt {
+AddTransaction()
+SaveReceipt()
}
clsPerson <|-- clsATMClient
clsScreen <|-- clsLoginScreen
clsScreen <|-- clsATMMainScreen
clsScreen <|-- clsQuickWithdrawScreen
clsScreen <|-- clsNormalWithdrawScreen
clsScreen <|-- clsDepositScreen
clsScreen <|-- clsCheckBalanceScreen
flowchart TD
A((Start)) --> B["Login Screen"]
B --> C["Enter Account Number"]
C --> D["Enter PIN Code"]
D --> E{"Valid Client?"}
E -- "Yes" --> F["Open ATM Main Menu"]
E -- "No" --> G["Increase Failed Attempts"]
G --> H{"Attempts = 3?"}
H -- "No" --> B
H -- "Yes" --> I["Exit Application"]
flowchart TD
Main["ATM Main Menu"] --> QW["Quick Withdraw"]
Main --> NW["Normal Withdraw"]
Main --> DP["Deposit"]
Main --> CB["Check Balance"]
Main --> LO["Logout"]
QW --> W1{"Enough Balance?"}
NW --> W2{"Enough Balance?"}
W1 -- "Yes" --> Update1["Withdraw Amount"]
W1 -- "No" --> Main
W2 -- "Yes" --> Update2["Withdraw Amount"]
W2 -- "No" --> Main
DP --> Update3["Deposit Amount"]
Update1 --> Save1["Save to Clients.txt"]
Update2 --> Save2["Save to Clients.txt"]
Update3 --> Save3["Save to Clients.txt"]
Save1 --> Session["Add to Session Transactions"]
Save2 --> Session
Save3 --> Session
Session --> Main
CB --> Main
LO --> Receipt["Ask for Session Receipt"]
flowchart LR
clsATMClient["clsATMClient"] --> ClientsTxt[("Clients.txt")]
clsReceipt["clsReceipt"] --> ReceiptTxt[("Receipt.txt")]
ClientsTxt --> ClientData["Account Number<br/>PIN Code<br/>Name<br/>Phone<br/>Balance"]
ReceiptTxt --> ReceiptData["Client Info<br/>Session Transactions<br/>Final Balance"]
This project was created to practice:
- Object-Oriented Programming (OOP)
- Classes & Objects
- Encapsulation
- Inheritance
- Modular Design
- File Handling
- Data Persistence
- ATM Simulation
- Authentication Systems
- Session Management
- Receipt Generation
| Feature | v1.0 | v2.0 |
|---|---|---|
| Programming Style | Procedural Programming | Object-Oriented Programming (OOP) |
| Authentication | Basic | Improved |
| Login Attempts | Unlimited | Maximum 3 Attempts |
| Quick Withdraw | Available | Refactored |
| Normal Withdraw | Available | Refactored |
| Deposit | Available | Refactored |
| Check Balance | Available | Refactored |
| Session Receipt | Not Available | Added |
| Receipt.txt | Not Available | Added |
| Screen Architecture | Not Available | Added |
| Code Organization | Single File | Multi-file OOP |
| Documentation | Basic | Professional |
Youness Chergui Amin
ATM Simulation System – C++ / Object-Oriented Programming