Let's jump right in, shall we? Here is my code:
import java.util.Scanner;
public class a7main
{
public static void main(String[] args)
{
double startBalance;
double annual_Interest_Rate;
int months;
double deposit_Amount;
double withdraw_Amount;
Scanner input = new Scanner(System.in);
System.out.print("Please enter your starting balance: $");
startBalance = input.nextDouble();
System.out.print("Please enter your annual interest rate: ");
annual_Interest_Rate = input.nextDouble();
System.out.print("Please enter the number of months: ");
months = input.nextInt();
SavingsAccount sa = new
SavingsAccount(startBalance, annual_Interest_Rate);
sa.setAnnualInterestRate(annual_Interest_Rate);
for (int i = 0; i < months; i++)
{
System.out.print("Please enter the amount you would like to deposit for the month " + (i+1) + ":$");
deposit_Amount = input.nextDouble();
sa.setDeposit(deposit_Amount);
System.out.print("Please enter the amount you would like to withdraw for the month " + (i+1) + ":$");
withdraw_Amount = input.nextDouble();
sa.setWithdraw(withdraw_Amount);
sa.calculateMonthlyInterest();
}
sa.displayData();
}
}
And here is the error message I get when I try to run it:
Exception in thread "main" java.lang.RuntimeException: Uncompilable source code - cannot find symbol symbol: class SavingsAccount
location: class a7main
I'm a complete beginner who hasn't encountered this error before. Any suggestions for how to address this error so that I can run this code?
Thank you.