Skip to content

Assignment 1: SCT212-0450/2024#60

Open
Bashan-56 wants to merge 1 commit into
mulangonando:mainfrom
Bashan-56:main
Open

Assignment 1: SCT212-0450/2024#60
Bashan-56 wants to merge 1 commit into
mulangonando:mainfrom
Bashan-56:main

Conversation

@Bashan-56

Copy link
Copy Markdown

John Karusa
SCT212-0450/2024

I have implemented the following:

  • Base & Subclass Transactions: Converted BaseTransaction into a concrete class and implemented distinct apply() and printTransactionDetails() behaviors for deposits and withdrawals.
  • Reversible Transactions: Added a reverse() method to WithdrawalTransaction to safely restore account balances to their pre-transaction state.
  • Exception Handling & Method Overloading: Created a custom InsufficientFundsException thrown during failed withdrawals. Implemented an overloaded apply() method to handle partial withdrawals (sweeping remaining funds to $0) using a try-catch-finally block.
  • Client Testing: Added a test suite in Main.java verifying all transaction types, reversals, exceptions, and polymorphic type-casting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant