Advertisement
ruhul0

SavingsAccount

Mar 6th, 2017
282
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.59 KB | None | 0 0
  1.  
  2. public class SavingsAccount extends BankAccount {
  3.     double interest=.05,maxWithLimit,interestbalance;
  4.     double minimumBalance = 2000;
  5.  
  6.     public SavingsAccount(String memberName, double accountBalance) {
  7.         super(memberName, accountBalance);
  8.         super.minimumBalance=minimumBalance;
  9.     }
  10.     double getBalanceWithInterest()
  11.     {
  12.         interestbalance = (accountBalance+ (accountBalance*interest));
  13.         return interestbalance;
  14.     }
  15.     void withdraw(double balance)
  16.     {
  17.         if(balance>maxWithLimit)
  18.         {
  19.             System.out.println("Maximum withdraw limit exceeded");
  20.         }
  21.         else
  22.             super.withdraw(balance);
  23.     }
  24.    
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement