while loop error
I can't seem to find the soultion to the following error message:
G:\UOP\POS 406\Java Assignements\Week 3, Assignment 2\MortgageCalcV1.java:53: variable option might not have been initialized
while ((option == 'Y') || (option == 'y'))
^
1 error
Tool completed with exit code 1
The following is my code starting with the while line to the end of while statement:
//While statement to prompt user to continue to use calculator or to quit.
while ((option =='Y') || (option =='y'))
{//begin loop
System.out.print("Enter the amount to be financed: $");
StrPrincpal = dataIn.readLine ();//Places data into the string StrPrincpal
princpal = Double.parseDouble (StrPrincpal);
System.out.println();
System.out.print("Enter the rate: ");
StrIntRate = dataIn.readLine ();//Places data into the string StrPrincpal
IntRate = Double.parseDouble (StrIntRate);
System.out.println();
System.out.print("Enter the term of the loan: ");
StrTerm = dataIn.readLine ();//Places data into the string StrPrincpal
term = Integer.parseInt (StrTerm);
System.out.println();
//Calculation
rate = (IntRate / 100.0) / 12.0;// converts % to decimal format
Calpymt = rate + 1;// calculate interest
term = 30*12;// calculate number of years to number of months
pymt = princpal * (Math.pow(Calpymt, term) * rate)/ (Math.pow (Calpymt, term) -1);// formula to calculate monthly payment
System.out.println("\nMonthly payment will be: " + moneyFormat.format(pymt) +"\n");// outputs monthly payment to screen
System.out.println("Date of report:" + currentDate);
System.out.println("\n");// create a blank line after output
//User response required y or n to refresh the calculator to perform another calculation
System.out.println("Do you wish to calculate another mortgage?\n");
System.out.print("Please Enter Y or N:\t");
System.out.println("\n");
option = (char)System.in.read();
//StrResponse = dataIn.readLine();
//option = Character.parseChar(StrResponse);
//} //close while loop
}//close loop[code]
[/code]
I have defind variable as char option;
Thanks for any assistance you can give me on this issue.

