/** * @author KR * SavingsAccount.java * Project Assignment #8 */ public class SavingsAccount extends Account { /******************* Fields *********************/ //Declare variable for user-supplied interest rate for account private double interestRate; /******************* Constructor Methods *********************/ //Subclass constructor. Call superclass constructor as first statement. public SavingsAccount( double amount, double rate ) { //Call superclass constructor first. super (amount); //Initialize variables not included in superclass. interestRate = rate; } /******************* Accessor Methods *********************/ //No additional accessor methods needed. Use methods inherited from //superclass. /******************* Mutator Methods *********************/ //Compute and add interest earned to account balance. public void addInterest () { double interest = getBalance () * interestRate / 1200; deposit ( interest ); } /******************* Facilitator ("Helper" Methods *********************/ //No additional facilitator methods needed. Use methods inherited from //superclass Account. /******************* toString Methods *********************/ //Use the toString method inherited from superclass Account. }