Skip to content

Commit

Permalink
Update SavingsAccount.java
Browse files Browse the repository at this point in the history
  • Loading branch information
JitseGoutbeek authored Jun 28, 2024
1 parent 995b37d commit 3ff7774
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
package eu.sig.training.ch04;

// tag::CheckingAccount[]
public class CheckingAccount {
// tag::SavingsAccount[]
public class SavingsAccount {
private static final float INTEREST_PERCENTAGE = 0.05f;
private Money balance = new Money();

public Transfer makeTransfer(String counterAccount, Money amount)
throws BusinessException {
// 1. Check if it is the own checkaccount:
if (counterAccount =/= SavingsAccount) {
throw new BusinessException("Invalid Account!");
}
// 1. Assuming result is 9-digit bank account number, validate 11-test:
int sum = 0;
for (int i = 0; i < counterAccount.length(); i++) {
Expand Down

0 comments on commit 3ff7774

Please sign in to comment.