Skip to content

Instantly share code, notes, and snippets.

Created October 17, 2012 02:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/3903421 to your computer and use it in GitHub Desktop.
Save anonymous/3903421 to your computer and use it in GitHub Desktop.
Savings account
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