Here is my code so far, following the instructions
public class CarLoan {
public static void main(String[] args) {
int carLoan = 10000;
int loanLength = 3;
int interestRate = 5;
int downPayment = 2000;
int remainingBalance = carLoan - downPayment;
int months = loanLength * 12;
int monthlyBalance = remainingBalance / months;
int interest = monthlyBalance * interestRate / 100;
int monthlyPayment = monthlyBalance + interest;
if (loanLength <= 0 || interestRate <= 0)
{
System.out.println("You must have a 1 year loan minimum.");
if (downPayment >= carLoan){
System.out.println("Your car can be paid for in full.");
else {
System.out.println(monthlyPayment);
}
}
}
}
}
I’m getting an error message saying I need an if statement for the else statement at the bottom. What’s wrong?
Also, please excuse me(my first post) if I formatted the code in badly.