Hi, I have tried every way I could think to correct this problem. This is the last of 13 errors I had to find debugging this assignment.
interest = annualInterest 12;
after compiling it, the error message said:
possible loss of precision
found: double
required: int
the declaring variables are
int price, downPayment, tradeIn, months, loanAmt, interest;
double annualInterest, payment;
under conversions there is this:
annualInterest =Double.parseDouble(inputAnnualInterest);
under calculations the line of code is
interest = annualInterest 12;
I tried putting "/" in front of 12, got an error. Tried putting parantheses around
(annualInterest 12) got an error. How to get int when there is a double. I determined from declared variable annualInterest was the double. So here is what I tried next:
interest = (double = (annualInterest / 12));
got an error back
unexpected type
required: variable
found : class
interest = (double = (annualInterest / 12));
^(under the d in double)
1 error
My understanding is everything in the ( ) has to equate to an int and not double...since interest is an int. Must be close because the error message no longer says found: double required: int. It just says found:class required variable.
Maybe someone can clarify my understanding.
Thanks