Cant find the mistake


#1

what is wrong?

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 ramainingBalance = (carLoan - downPayment);
int months = (loanLenght * 12);
int monthlyBalance = (remainingBalance / months);
int interest = (monthlyBalance * interestRate / 100);
int monthlyPayment = (monthlyBalance + interest);
System.out.println(monthlyPayment);

}


}

}


#2

Usually the place to start is to consider what it is doing differently from what you want


#3

What error does it show?

(eg. stynax, identifier, unexpected token)


#4

Actually I've just managed to get it sorted, thank you for coming back to me. :slight_smile:


#5

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.