Created
October 17, 2012 02:39
-
-
Save anonymous/3903421 to your computer and use it in GitHub Desktop.
Savings account
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SavingsAccount extends BankAccount { | |
private boolean status; | |
public void checkAccountStatus() | |
{ | |
if(getBalance() <= 25) | |
{ | |
status = false; | |
} | |
else | |
{ | |
status=true; | |
} | |
} | |
public void Withdraw(double w) | |
{ | |
if(status){ | |
super.Withdrawal(w); | |
} | |
else{ | |
System.out.println("Insufficient funds, cannot withdraw."); | |
} | |
} | |
public void Deposit(double d) | |
{ | |
super.Deposit(d); | |
if(getBalance()>25)status =true; | |
else { | |
status = false; | |
System.out.println("Account inactive."); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment