This is a Java practice project that simulates a basic banking system using core Object-Oriented Programming (OOP) principles. It was designed to be completed in 120 minutes, focusing on class design, inheritance, encapsulation, polymorphism, and abstraction.
Estimated Time: 120 minutes
Skill Level: Beginner to Intermediate Java
Build a console-based banking system that allows:
- Creating customers
- Creating checking/savings accounts
- Depositing and withdrawing (with balance stored in cents)
- Transferring money between accounts
- Displaying account info and transaction summaries
- Use
intfor money (cents instead of rand) to avoid floating point errors. - Use OOP concepts throughout the project.
- All functionality must be accessible via a CLI menu in the
Main.java.
protected String accountNumberprotected int balance(in cents)abstract void displayInfo()- Methods:
deposit(int amountInCents)withdraw(int amountInCents)getBalance()getAccountNumber()
- Inherit from
Account - Override
displayInfo() - (Optional) Add withdrawal restrictions in
SavingsAccount
- Fields:
String nameString customerIdArrayList<Account> accounts
- Methods:
addAccount(Account account)getAccounts()getName(),getCustomerId()
Handles the business logic:
createCustomer(name)createAccount(customerId, type)deposit(customerId, accountNumber, amountInCents)withdraw(customerId, accountNumber, amountInCents)transfer(customerIdFrom, accFrom, customerIdTo, accTo, amountInCents)printCustomerAccounts(customerId)
Use an ArrayList<Customer> for storing data in memory.
Console-based interface:
===== Banking Menu =====
1. Create Customer
2. Create Account
3. Deposit
4. Withdraw
5. Transfer
6. View Account Info
7. Exit