Skip to content

Implement apply_interest in bank.py#130

Open
hummusonrails wants to merge 1 commit into
ADG-VITV:mainfrom
hummusonrails:fix-apply-interest
Open

Implement apply_interest in bank.py#130
hummusonrails wants to merge 1 commit into
ADG-VITV:mainfrom
hummusonrails:fix-apply-interest

Conversation

@hummusonrails

Copy link
Copy Markdown

Summary

  • Implements Account.apply_interest() with numeric non-negative rate validation
  • Updates account balance by applying the given rate
  • Records the applied interest amount in the transaction history
  • Adds focused regression tests for normal, zero, and invalid-rate cases

Verification

  • python3 -m py_compile bank.py test_apply_interest.py
  • python3 -c "from bank import Account; a=Account('1','Ada',100.0); assert a.apply_interest(0.05); assert a.balance==105.0; assert a.transactions[-1]==('Interest Applied',5.0); assert not a.apply_interest(-0.01)"

/claim #35

@hummusonrails hummusonrails marked this pull request as ready for review April 28, 2026 06:07
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