-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUpSave.java
More file actions
37 lines (30 loc) · 792 Bytes
/
UpSave.java
File metadata and controls
37 lines (30 loc) · 792 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
public class UpSave implements BankAccountDecorator{
private final BankAccountDecorator account;
public UpSave(BankAccountDecorator account){
this.account = account;
}
@Override
public String showAccountType() {
return "UpSave";
}
@Override
public double getInterestRate() {
return 0.04; // 4.0%
}
@Override
public double getBalance() {
return account.getBalance();
}
@Override
public String showBenefits() {
return account.showBenefits() + ", With Insurance";
}
@Override
public double computeBalanceWithInterest() {
return getBalance() + (getBalance() * getInterestRate());
}
@Override
public String showInfo() {
return account.showInfo();
}
}