0% found this document useful (0 votes)
112 views5 pages

Case Study - Banking System

Uploaded by

Anesu.Munhuweyi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
112 views5 pages

Case Study - Banking System

Uploaded by

Anesu.Munhuweyi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Case Study: Development of a Banking System.

Requirement Specifications for a Banking System


Our bank is seeking to develop a comprehensive banking system that allows us to efficiently manage customer
accounts and transactions. The system should cater to various types of accounts, including Savings Accounts,
Current Accounts, and Loan Accounts, each with distinct features and behaviors. The system must allow customers
to perform basic banking operations such as depositing money, withdrawing funds, transferring money between
their accounts, and repaying loans. It should also provide functionalities for calculating and applying interest,
particularly for savings and loan accounts, and include an audit trail of all transactions for regulatory and security
purposes.
Each customer should be able to hold multiple accounts. For every customer, the system must capture essential
details such as their Customer ID, name, and address. For each account, the system must generate a unique account
number and maintain a balance. In the case of loan accounts, the system should track both the loan balance and any
associated interest.
For Savings Accounts, interest must be calculated on a regular basis (monthly), and this interest should be added
automatically to the account balance. The system should store and apply the interest rate associated with these
accounts. Current Accounts should support an overdraft facility, which allows customers to withdraw more than
their available balance within a predefined limit. In contrast, Loan Accounts should allow for tracking of the loan
principal, and interest must be applied to the remaining loan balance at regular intervals. Customers must be able
to make partial or full loan repayments, and the system should reflect these changes in the outstanding loan balance.
The system must enforce rules on account operations. Customers should only be able to withdraw money if they
have sufficient funds in their account or within their overdraft limit for current accounts. Transfers between accounts
must be allowed only if both accounts belong to the same customer. The system should prevent overdrawn transfers
and flag any suspicious activity. For loan repayments, customers should be prevented from repaying more than the
outstanding loan balance. Additionally, the system must provide real-time feedback to the customers about the
success or failure of each operation (e.g., failed withdrawals due to insufficient funds).
An essential part of the system is the transaction logging mechanism. Every transaction—whether a deposit,
withdrawal, transfer, or loan repayment—must be recorded in a detailed transaction log. This log should capture
the transaction ID, the type of transaction, the account number, the amount involved, and the date and time the
transaction occurred. This will ensure transparency and provide a complete audit trail for future reference and
regulatory compliance.
The system must also be robust enough to handle error cases. For instance, it should prevent the opening of accounts
with invalid data, and block withdrawals or transfers that exceed the allowed balance or overdraft limit. Security
and accuracy are paramount, so all actions should be logged, and sensitive operations must be protected against
unauthorized access.
Lastly, the system must support monthly interest calculations for savings and loan accounts, and it must
automatically apply the calculated interest to the appropriate account balances. It should be efficient and scalable
to handle a growing customer base without significant degradation in performance.
Overall, the system should be designed with user-friendliness in mind, providing a clear, intuitive interface for
customers to manage their accounts and for the bank to monitor and oversee all account activities.
Implementation of a Banking System
In this system, a bank manages various types of accounts for its customers. The accounts include Savings Accounts,
Current Accounts, and Loan Accounts. Customers can perform transactions such as depositing money, withdrawing
money, and transferring funds between accounts. The system also handles interest calculations, loan repayments,
and maintains a transaction log for auditing purposes.
You are expected to implement the following classes:
1. Main.java
2. Bank.java
3. Customer.java
4. Account.java
5. SavingsAccount.java
6. CurrentAccount.java
7. LoanAccount.java
8. Transaction.java

You are expected to use the following interfaces:


1. IAccount.java
2. IBank.java

Main.java
The Main class should be a menu-driven program with the following options:
• Create a new customer
• Open an account
• Deposit money into an account
• Withdraw money from an account
• Transfer money between accounts
• Check account balance
• View transaction history
• Calculate interest
• Repay loan

Account Creation
A customer can open multiple accounts, each with a unique account number. When opening an account, they specify
the account type (Savings, Current, or Loan), the initial deposit with each account having an expected minimum
deposit, and the account holder’s details.
Transactions
• Deposit: A customer can deposit money into their account.
• Withdraw: A customer can withdraw money from their account if they have sufficient funds.
• Transfer: A customer can transfer money from one account to another. Both accounts must belong to the
same customer.
• Loan Repayment: For loan accounts, a customer can repay their outstanding loan balance.

Interest Calculation
For Savings Accounts, interest is calculated monthly and added to the balance. For Loan Accounts, interest accrues
based on the remaining balance. Current Accounts do not accrue interest but can have overdraft facilities.
Transaction Log
Each transaction (deposit, withdrawal, transfer) is recorded in a transaction log with the following details:
• Transaction ID
• Account Number
• Transaction Type (Deposit, Withdrawal, Transfer)
• Amount
• Date and Time

Class Details
Bank.java
The Bank class should have the following fields:
• String bankName: Name of the bank.
• ArrayList<Customer> customers: A list of the bank’s customers.
• ArrayList<Account> accounts: A list of all accounts in the bank.

Methods:
• void addCustomer(Customer c): Adds a new customer to the bank.
• void openAccount(Customer c, Account a): Opens an account for a customer.
• Account findAccountByNumber(String accountNumber): Finds an account by its number.
• void transferFunds(String fromAccountNumber, String toAccountNumber, double amount): Transfers
money between two accounts.
• void calculateMonthlyInterest(): Calculates and applies interest for all savings and loan accounts.

Customer.java
The Customer class should have the following fields:
• String customerID: A unique ID for each customer.
• String name: The customer’s name.
• String address: The customer’s address.
• ArrayList<Account> accounts: A list of accounts held by the customer.

Methods:
• Customer(String customerID, String name, String address): Constructor.
• void openAccount(Account a): Adds an account to the customer’s account list.
• Account getAccount(String accountNumber): Finds and returns an account by its number.

Account.java
The Account class should be abstract and should have the following fields:
• String accountNumber: A unique number for each account.
• double balance: The current balance in the account.
• Customer accountHolder: The owner of the account.

Methods:
• Account(String accountNumber, Customer accountHolder, double initialDeposit): Constructor.
• void deposit(double amount): Deposits money into the account.
• void withdraw(double amount): Withdraws money from the account if sufficient balance is available.
• abstract void applyInterest(): Applies interest to the account.
• abstract void logTransaction(String type, double amount): Logs a transaction (deposit, withdrawal,
transfer).

SavingsAccount.java
The SavingsAccount class should extend Account and should have an additional field:
• double interestRate: The interest rate for the account.
Methods:
• void applyInterest(): Calculates and applies interest to the balance.
• void logTransaction(String type, double amount): Logs savings account transactions.

CurrentAccount.java
The CurrentAccount class should extend Account and should have an additional field:
• double overdraftLimit: The overdraft limit for the account.
Methods:
• void withdraw(double amount): Allows overdraft withdrawals if within the limit.
• void logTransaction(String type, double amount): Logs current account transactions.

LoanAccount.java
The LoanAccount class should extend Account and should have the following fields:
• double loanAmount: The total loan amount.
• double interestRate: The interest rate on the loan.

Methods:
• void applyInterest(): Calculates and adds interest to the outstanding loan balance.
• void repayLoan(double amount): Repays part of the loan balance.
• void logTransaction(String type, double amount): Logs loan repayment transactions.

Transaction.java
The Transaction class should have the following fields:
• String transactionID: A unique ID for each transaction.
• String accountNumber: The account associated with the transaction.
• String transactionType: The type of transaction (Deposit, Withdrawal, Transfer).
• double amount: The transaction amount.
• Date date: The date and time of the transaction.

Methods:
• Transaction(String transactionID, String accountNumber, String transactionType, double amount, Date
date): Constructor.
Interface Details
IBank.java
• void addCustomer(Customer c): Adds a new customer.
• void openAccount(Customer c, Account a): Opens a new account.
• Account findAccountByNumber(String accountNumber): Finds an account by its number.
• void calculateMonthlyInterest(): Applies interest for all savings and loan accounts.

IAccount.java
• void deposit(double amount): Deposits money into the account.
• void withdraw(double amount): Withdraws money from the account.
• void applyInterest(): Applies interest to the account.

Additional Complexity:
• Exception Handling: Ensure that the system handles invalid operations such as withdrawing more than the
available balance, exceeding overdraft limits, not satisfying minimum deposits on account creation, and
loan overpayments.
• Inheritance and Polymorphism: Accounts of different types should share common behaviors but implement
specific behaviors (such as interest calculation) differently.
• Audit and Security: Add a transaction log and write a file that stores all actions performed on each account
for auditing purposes.

You might also like