<PLEASE USE THE FOLLOWING TEMPLATE TO HELP YOU CREATE A GREAT POST!>
<Below this line, add a link to the EXACT exercise that you are stuck at.>
https://www.codecademy.com/courses/learn-java/projects/loan-payment-calculator
<In what way does your code behave incorrectly? Include ALL error messages.>
CarLoan.java:15: error: variable declaration not allowed here
int remainingBalance = carLoan - downPayment;
^
1 error
public class CarLoan {
public static void main(String[] args) {
int carLoan = 10000;
int loanLength = 3;
int interestRate = 5;
int downPayment = 2000;
if (loanlength <= 0 || interestRate<= 0) {
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
int remainingBalance = carLoan - downPayment;
int months = loanLength * 12;
int monthlyBalance = remainingBalance / months;
int interest = (monthlyBalance * interestRate) / 100;
int monthlyPayment = monthlyBalance + interest; {
system.out.println(monthlyPayment);}
}
}