This project is a simulation of an Automated Teller Machine (ATM) system, implementing both console-based and graphical user interface (GUI) versions. It demonstrates object-oriented programming principles in Java, including inheritance, polymorphism, and encapsulation.
- User Authentication: Secure login using account number and PIN
- Balance Inquiry: View available and total account balance
- Cash Withdrawal: Withdraw cash with predefined amounts or custom amounts
- Fund Transfer: Transfer money between accounts
- Cheque Transaction: Save cheque transactions
- GUI Interface: Modern Swing-based graphical interface
- Console Interface: Text-based interface for command-line usage
The project consists of the following main classes:
ATM.java- Main ATM logic and transaction coordinationATMCaseStudy.java- Console version entry pointATMViewGUI.java- GUI version with Swing interfaceBankDatabase.java- Manages account information and authenticationAccount.java- Represents individual bank accountsTransaction.java- Abstract base class for all transactionsBalanceInquiry.java- Handles balance inquiry transactionsWithdrawal.java- Handles cash withdrawal transactionsTransfer.java- Handles fund transfer transactionsChequeTransaction.java- Handles cheque transactionsScreen.java- Manages display outputKeypad.java- Handles user inputCashDispenser.java- Simulates cash dispensingSaving.java- Related to savings accountsCheque.java- Represents cheque objects
- Java Development Kit (JDK) 8 or higher
- Java Runtime Environment (JRE) for running the application
Compile all Java files:
javac *.javaExecute the console-based ATM:
java ATMCaseStudyExecute the graphical ATM interface:
java ATMViewGUIThe system comes pre-loaded with 10 sample accounts. Here are a few examples:
| Account Number | PIN | Available Balance | Total Balance |
|---|---|---|---|
| 11111 | 11111 | $1,000.35 | $1,000.35 |
| 22222 | 22222 | $25,234.50 | $25,234.50 |
| 33333 | 33333 | $150,000.90 | $150,000.90 |
| 12345 | 54321 | $1,000.00 | $1,000.00 |
Note: For demonstration purposes, each account uses its account number as the PIN.
- Run the application
- Enter your account number when prompted
- Enter your PIN
- Choose from the main menu options:
- View balance
- Withdraw cash
- Transfer funds
- Save cheque
- Exit
- Run the GUI application
- Use the on-screen keypad to enter account number and PIN
- Navigate through the interface using buttons and keypad
- Perform transactions using the graphical menus
The system follows a modular design with:
- Model:
Account,BankDatabase- Data management - View:
Screen,ATMViewGUI- User interface - Controller:
ATM,Transactionsubclasses - Business logic - Input/Output:
Keypad,CashDispenser- Hardware simulation