Unable to resolve Java error
// SavingsAccount.java
// Represents a bank account
import java.util.Scanner;
public class SavingsAccount
{
private double savingsBalance; // funds available for withdrawal
private static double annualInterestRate = 0.04; //interest rate
private double calculateMonthlyInterest;
private double modifyInterestRate;
// Account constructor initializes attributes
public SavingsAccount( double balance ) //
{
savingsBalance = balance;
} // end SavingsAccount constructor
public void calculateMonthlyInterest ()
{
calculateMonthlyInterest = monthlyInterest;
savingsBalance += ((savingsBalance * annualInterestRate) / 12);
}
public void modifyInterestRate (double balance)
{
annualInterestRate = balance;
}
// returns savings balance
public double getSavingsBalance()
{
return savingsBalance;
} // end getSavingsBalance
} // end class Account
//Program4: SavingsAccountTest.java
// Create and manipulate an Account object.
import java.util.Scanner;
public class SavingsAccountTest
{
// main method begins execution of Java application
public static void main( String args[] )
{
//Test class SavingsAccount. Instantiate two savingsAccount objects, saver1 and saver2,
//with balances of $2000.00 and $3000.00, respectively. Set annualInterestRate to 4%,
//then calculate the monthly interest and print the new balances for both savers.
//Then set the annualInterestRate to 5%, calculate the next month's interest and print the new balances for both savers.
SavingsAccount saver1 = new Account(2000.00); // create Savings Account object
SavingsAccount saver2 = new Account(3000.00); // create Savings Account object
//
saver1.calculateMonthlyInterest(.04);
saver2.calculateMonthlyInterest();
System.out.printf( "Saver 1 Savings Balance: $%.2f\n",
saver1.getSavingsBalance() );
saver2.calculateMonthlyInterest();
System.out.printf( "Saver 2 Savings Balance: $%.2f\n",
saver2.getSavingsBalance() );
saver1.calculateMonthlyInterest(.05);
saver2.calculateMonthlyInterest();
System.out.printf( "Saver 1 Savings Balance: $%.2f\n",
saver2.calculateMonthlyInterest();
System.out.printf( "Saver 2 Savings Balance: $%.2f\n",
saver2.calculateMonthlyInterest();
} // end main
} // end class AccountTest

