A console-based ATM simulation built with Python that demonstrates custom exception handling, modular programming, and real-world banking logic.
ATM-Operation-System/ ├── ATMException.py # Custom Exception Classes ├── ATMMenu.py # ATM Menu Display ├── ATMOperation.py # Core Banking Operations └── ATMMainProgram.py # Main Driver Program
- 💰 Deposit — Add funds to your account with input validation
- 🏧 Withdraw — Withdraw funds with minimum balance enforcement
- 📊 Balance Inquiry — Check current available balance
- 🚪 Exit — Safely exit the ATM session
- 🔒 Minimum Balance — Rs.500 must be maintained at all times
⚠️ Custom Exceptions — Meaningful error messages for every case- 🔁 Continuous Loop — Runs until user chooses to exit
Defines three custom exception classes:
| Exception | Triggered When |
|---|---|
DepositError |
Deposit amount is zero or negative |
WithdrawError |
Withdraw amount is zero or negative |
InsufficientAmountError |
Withdrawal exceeds balance minus Rs.500 |
Displays the ATM menu with 4 options:
- 1 → Deposit
- 2 → Withdraw
- 3 → Balance Inquiry
- 4 → Exit
Contains three core functions:
deposit()
- Takes deposit amount as input
- Raises
DepositErrorif amount ≤ 0 - Adds amount to global balance
withdraw()
- Takes withdrawal amount as input
- Raises
WithdrawErrorif amount ≤ 0 - Raises
InsufficientAmountErrorif (withdraw + 500) > balance - Deducts amount from global balance
balance_inquiry()
- Displays current available balance
- Main driver using
while Trueloop - Uses
match-case(Python 3.10+) for menu selection - Handles all exceptions gracefully with user-friendly messages
Step 1 — Clone the repository git clone https://github.com/Biswojit02/ATM-Operation-System.git
Step 2 — Navigate to the folder cd ATM-Operation-System
Step 3 — Run the main program python ATMMainProgram.py
⚠️ Requires Python 3.10+ (for match-case support)
| Scenario | Exception Handled |
|---|---|
| Deposit amount = 0 or negative | DepositError |
| Withdraw amount = 0 or negative | WithdrawError |
| Withdraw exceeds balance - 500 | InsufficientAmountError |
| Entering letters for amount | ValueError |
| Entering letters for menu choice | ValueError |
| Invalid menu choice number | case _ default |
- Language — Python 3.10+
- Concepts Used — Custom Exceptions, Modular Programming, Global Variables, Match-Case, Exception Handling, Loops
- ✅ Custom Exception Classes (
Exceptionsubclassing) - ✅ Modular code split across multiple files
- ✅
match-casestatement (Python 3.10+) - ✅
globalvariable usage - ✅ Nested
try-exceptblocks - ✅ Real-world banking constraint (minimum balance)
- ✅ Input validation for all user entries
This project is open source and available under the MIT License.