package lab4out; public class SavingAccount extends BankAccount { static int num_accts = 0; //Default Constructor public SavingAccount() { this(0,0); } //Constructor public SavingAccount( long account_num, double balance) { super(account_num, balance); num_accts++; this.penalty = 0; } // Subtracts amount from the balance and incurs a one-time $10.00 penalty on the account if balance < $1000 public void withdraw(double amount) { balance -= amount; if(balance < 1000) { penalty += 10; } if(balance < 0) { balance = 0; } } // Gets the total number of saving accounts created public static int getNoOfSavingAccounts( ) { return num_accts; } public static void main(String[] args) { SavingAccount savingaccount = new SavingAccount(); } }