Advertisement
Guest User

SavingsAccount.java

a guest
Jan 22nd, 2018
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. public class SavingsAccount extends BankAccount{
  2.  
  3. private double interestRate;
  4.  
  5. public SavingsAccount(double balance, double interestRate){
  6. super(balance);
  7. this.interestRate = interestRate;
  8. }
  9.  
  10. public void addInterest( ){
  11. double interest = getBalance( ) * interestRate / 100;
  12. deposit(interest);
  13. }
  14.  
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement