Enhance the addInterest method of the SavingsAccount class to compute the interest on the minimum balance since the last call to addInterest. Hint: You need to modify the withdraw method as well, and you need to add an instance variable to remember the minimum balance.

Complete the following files:

SavingsAccount.java

SavingsAccountTester2.java

Use the following file:

SavingsAccountTester.java

/**
   This program tests the SavingsAccount class.
*/
public class SavingsAccountTester
{
   public static void main(String[] args)
   {
      SavingsAccount momsSavings = new SavingsAccount(5);
      BankAccount account = momsSavings; // Just checking that you use inheritance

      momsSavings.deposit(10000);
      momsSavings.addInterest();
      momsSavings.withdraw(5000);
      momsSavings.withdraw(3000);
      momsSavings.deposit(10000);
      momsSavings.addInterest(); // interest computed on $2000
      System.out.println("Balance: " + momsSavings.getBalance());
      System.out.println("Expected: 12100");
   }
}