// A subclass of the Account class. // This example illustrates adding instance variables and // overriding a method in the parent class. // Nancy McCracken 3/14/97 public class AccountCmp extends Account { // instance variables static float minbalance = 6000.F; static float penalty = 20.F; // constructor method is same as parent public AccountCmp (String n, float b) { super (n, b); } // override one method public void monthactivity() { if (balance < minbalance) balance -= penalty; balance = balance * (float)(Math.pow (1 + (interestrate/12)/30, 30)); } }