import java.util.Scanner;
public class BankAccount
{
public static void main(String[] args)
{
Scanner keyboard = new Scanner(System.in);
do
{
System.out.println("Enter your bank account dollars in whole dollars and cents.");
double initialBalance = keyboard.nextDouble();
System.out.println("Enter interest on your bank account as a whole number.");
System.out.println("For example, a 4.5% interest rate would be entered as \"4.5\":");
double interestRate = keyboard.nextDouble();
double yearBalance = initialBalance;
double monthBalance = initialBalance;
double dayBalance = initialBalance;
int year;
int month;
int day;
char answer;
for (year = 1; year <= 10; year++)
{
yearBalance = (yearBalance * (interestRate / 100.0));
}
for (month = 1; month <= 120; month++)
{
monthBalance = (monthBalance * (interestRate / 1200.0));
}
for (day = 1; day <= 3650; day++)
{
dayBalance = (dayBalance * (interestRate / 36500.0));
}
System.out.println("An initial investment of " + initialBalance + " will become one of the following over ten years.");
System.out.println("If interest is accrued yearly at " + interestRate + "%, you will have a total of " + yearBalance + ".");
System.out.println("If interest is accrued monthly at " + interestRate + "%, you will have a total of " + monthBalance + ".");
System.out.println("If interest is accrued daily at " + interestRate + "%, you will have a total of " + dayBalance + ".");
System.out.println("Would you like to calculate again using a different balance and/or interest rate? Answer \"Y\" or \"N\":");
answer = keyboard.nextLine().toUpperCase().charAt(0);
} while (answer == 'Y');
}
}[/B]
--- Update ---
the error shows the carrot under the word answer, on the last "while" line