Skip to content

Commit

Permalink
functies verwijderd die niet nodig zijn
Browse files Browse the repository at this point in the history
  • Loading branch information
daniquemont committed Jun 28, 2024
1 parent c12a797 commit b5db126
Showing 1 changed file with 1 addition and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,10 @@

// tag::CheckingAccount[]
public class CheckingAccount {
private static final float INTEREST_PERCENTAGE = 0.01f;
private Money balance = new Money();
private int transferLimit = 100;

public Transfer makeTransfer(String counterAccount, Money amount)
throws BusinessException {
// 1. Check withdrawal limit:
if (amount.greaterThan(this.transferLimit)) {
throw new BusinessException("Limit exceeded!");
}
// 2. Assuming result is 9-digit bank account number, validate 11-test:
throws BusinessException {
int sum = 0;
for (int i = 0; i < counterAccount.length(); i++) {
char character = counterAccount.charAt(i);
Expand All @@ -28,14 +21,5 @@ public Transfer makeTransfer(String counterAccount, Money amount)
throw new BusinessException("Invalid account number!");
}
}

public void addInterest() {
Money interest = balance.multiply(INTEREST_PERCENTAGE);
if (interest.greaterThan(0)) {
balance.add(interest);
} else {
balance.substract(interest);
}
}
}
// end::CheckingAccount[]

0 comments on commit b5db126

Please sign in to comment.