A simple console-based banking application built in Java. It allows users to manage bank accounts through an interactive text menu β create accounts, deposit and withdraw money, and delete accounts.
- List all existing accounts with their balances
- Add a new bank account (with duplicate detection)
- Deposit money into an account
- Withdraw money from an account (with balance validation)
- Delete an account
- Input validation and error handling throughout
JavaBankApplication/
βββ BankProgram.java # Main program β menu loop and user interaction
βββ Account.java # Account model β stores account number and balance
Account.javamust implementgetAccountNumber(),getBalance(),deposit(double), andwithdraw(double).
- Java JDK 8 or higher
javac JavaBankApplication/*.javajava JavaBankApplication.BankProgramWhen the program starts, you'll see a menu like this:
-------------------------------------------------------------------------------------
0 = Quit | 1 = List accounts | 2 = Add an account | 3 = Deposit money | 4 = Withdraw money | 5 = Delete an account
-------------------------------------------------------------------------------------
Enter your choice:
| Option | Action |
|---|---|
0 |
Quit the program |
1 |
List all accounts and balances |
2 |
Add a new account |
3 |
Deposit money to an account |
4 |
Withdraw money from an account |
5 |
Delete an account |
Enter your choice: 2
*** Add an account ***
Enter account number: 1001
Account created successfully!
Enter your choice: 3
*** Deposit money to an account ***
Enter account number: 1001
Enter the amount to be deposited: 500
Deposit completed successfully!
Enter your choice: 1
*** Account list ***
Number: 1001 | Balance: 500.00 euros
- Account numbers are stored as strings to support various formats.
- Withdrawals are rejected if the account balance is insufficient.
- Negative deposit and withdrawal amounts are not allowed.
- Duplicate account numbers are not permitted.