Help with learn java- simple car loan exercise please


Hi all

Thanks in advance for the guidance. I am struggling with this exercise. Third subsection of Section 2 of Learn Java-Conditionals and control flow.

I am not entirely sure which bit I have done incorrectly. I have checked through the video and it would appear that my code is the same yet it’s not producing the same outcome. Would be grateful if you could point out the obvious?

My code is here:

I would be so grateful for the help. Thanks so much!!!


You have few typos, starting with the lesser or equal sign at line 9:

if (loanLength <= 0 || interestRate <= 0) {

Look at the sign, it is <= instead of =<.

Also you missing a closing curly bracket at the end of the file and system.out.println should be System.out.println, notice the uppercase at the first letter.


Thanks kingdarboja! got it now! that was so helpful! i was stuck for a loooonnnggg time!


Lesson leaned here, any operator that includes = will always have it on the right side, closest to the object.