Did i do something wrong?


#1

I ran my program and in the right side of the black screen I'm not getting any error or numbered. Can someone explained what I did 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) {
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;
}

}

}


#2

What indication is there that it's wrong?
If there's very little to go by, then try from the other end. Can you argue for why it's right?
If you expect something to behave differently, then what would that be?
Is it described what should happen?
Is there something stopping you from adding something?


#3

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