Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class SavingsAccount extends BankAccount{
- private double interestRate;
- public SavingsAccount(double balance, double interestRate){
- super(balance);
- this.interestRate = interestRate;
- }
- public void addInterest( ){
- double interest = getBalance( ) * interestRate / 100;
- deposit(interest);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement