Please enable JavaScript.
Coggle requires JavaScript to display documents.
UML DIAGRAM- Bank Account System - Coggle Diagram
UML DIAGRAM- Bank Account System
Interface: Taxable
+calculateTax(): double
Abstract Class: BankAccount
accountNumber: String
balance: double
Constructor:
+BankAccount(accountNumber: String, balance: double)
Methods:
+deposit(amount: double): void
+withdraw(amount: double): void
+getBalance(): double
+getAccountNumber(): String
+setAccountNumber(accountNumber: String): void
+setBalance(balance: double): void
+calculateInterest(): double (abstract)
+toString(): String
Class: SavingsAccount (extends BankAccount, implements Taxable)
interestRate: double
Constructor:
+SavingsAccount(accountNumber: String, balance: double, interestRate: double)
Methods:
+calculateInterest(): double
+applyInterest(): void
+calculateTax(): double
+toString(): String
Class: ChequingAccount (extends BankAccount, implements Taxable)
transactionFee: double
Constructor:
+ChequingAccount(accountNumber: String, balance: double, transactionFee: double)
Methods:
+withdraw(amount: double): void (overridden to include fee)
+calculateInterest(): double
+calculateTax(): double
+toString(): String
Class: BankSystem
Main Method
+main(args: String[]): void
Creates an ArrayList of BankAccount
Adds SavingsAccount and ChequingAccount
Demonstrates deposit, withdrawal, tax calculation, and interest application
Uses instanceof to demonstrate polymorphism