/** * class checking extends account * * John Sloan * January 24,2009 */ public class checking extends account { private boolean overdrawn; /** * construct method * type==0; so type is not needed in the parameters (instructions p.4) */ public checking(String name, int number, double balance) { super(name, number, 0 ,balance); overdrawn = false; } /** * method deposit */ public void deposit(double deposit) { super.deposit(deposit); if(balance>=0){ overdrawn = false; } else{ overdrawn = true; } } /** * method withdrawl */ public void withdrawl(double withdrawl) { double possibleNewBalance = (balance - withdrawl); if( possibleNewBalance < balance * -.10){ overdrawn = true; System.out.println("Error: Insufficient funds to withdraw from this account"); } else { super.withdrawl(withdrawl); } } /** * Calls Print Method in account base */ public void print() { super.print(); System.out.println(); } }