Error message car loan projet


#1




keep getting this error message not sure whats wrong with it

CarLoan.java:17: error: '(' expected
else if {
^
CarLoan.java:17: error: illegal start of expression
else if {
^
CarLoan.java:17: error: ')' expected
else if {
^
CarLoan.java:26: error: class, interface, or enum expected
}
^
4 errors


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.printIn("Error! You must take out a valid car loan");
    
    }
    
    else if(downPayment >= carLoan){
    System.out.printIn("The car can be paid in full");
  }
 else if  {
      int remainingBalance = carLoan - downPayment;
    int months = loanLength * 12;
    int monthlyBalance = remainingBalance / months;
    int interest = (monthlyBalance * interstRate) / 100;
    int monthlyPayment = monthlyBalnace + interestRate;
    System.out.printIn(monthlyPayment);
    }
  }
}


#2

Error:

CarLoan.java:17: error: '(' expected
else if {
^

Don't use else if if you don't have any condition use else instead.After else if it expects () like

else if ( condition)

now here

System.out.printIn("Error! You must take out a valid car loan");

It should be System.out.println not System.out.printIn( l not I).Do same for the rest.

now here

int interest = (monthlyBalance * interstRate) / 100;
int monthlyPayment = monthlyBalnace + interestRate;

you misspelled interestRate and monthlyBalance


#3

( l not I) is that not an uppercase I


#4

im not sure whats different about that I in printIn .it shows up different in this post than on the source code


#5

No,it's l (lowercase of L).neither 1(one) nor I(uppercase of i).

can you be more clear about your question?

it shows up different for different font .


#6

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