class SavingsAccount extends BankAccount
{
	private double interestRate;     //instance field
public SavingsAccount(String a, double b,double i)   //constructor
    {
	super(a,b);  //executes BankAccount constructor
			//must be the first statement in the constructor
            interestRate = i;
    }
public double getInterestRate( )  //accessor
    {
           return interestRate;
     }
public double calculateInterest( )
     {
             return interestRate * getBalance( );
      }
public void deductInterest( )
      {
            super.withdraw(calculateInterest( ));  //Executes withdraw ( ) in 
//   BankAccount
       }
public void withdraw (double w)    //Overrides withdraw ( ) in BankAccount
       {
             if (w <= getBalance( ))
		{
		       super.withdraw(w);
	             }
             else
                      System.out.println("Error - Balance too low");
        }
public String toString ( )
        {
               return super.toString( ) + "\nInterest Rate  -> " +
                           interestRate;
        }
}
