} else if (downPayment > carLoan) {I cannot resolve this row in A Simple Car Loan... of PRO Java

} else if (downPayment > carLoan) {
I cannot unstuck

with this row of carLoan,java. Even if it is exactly the same as Galina`s at WALKTHROUGH.


What error messages did you get? Can you provide a formatted copy of the code you wrote and a link to the exercise page?

if (loanLenght >= 0 || interestRate >= 0); {

System.out.println(“Error: you must take out a valid car loan.”);

*Error: élse''without íf*

} else if (downPayment > carLoan) {

System.out.println(“The car can be paid in full”);

} else {

 int remainingBalance = carLoan - downPayment;

You have an extra semicolon i believe on your first line:
if (loanLenght >= 0 || interestRate >= 0); {
should be
if (loanLenght >= 0 || interestRate >= 0) {

if (loanLenght >= 0 || interestRate >= 0); { // <-- this semicolon ; should not be there

 System.out.println("Error: you must take out a valid car loan.");
  } else if (downPayment > carLoan) {

   System.out.println("The car can be paid in full"); 


  } else {

Note, whenever you have a strange error like that, the actual error is usually a few lines before it.

Thanks! It was an extra semicolon.
But now there are three errors. I do not see the solution, unfortunately.


This is a super common process in programming that everyone has to deal with, even veterans. Fixing one issue may uncover deeper issues that could not show themselves before.

So just take it methodically. Error by error try to see if you can logically deduce why it happened, and if you still are stuck you can post about it (with the specifics: error citation, code example of where the error occurred, link to exercise, etc.).

Thank you. I`ll try tomorrow.