java loan calculator | SoloLearn: Learn to code for FREE!

+1

java loan calculator

cannot find symbol at line 0 ??? I have used amount / 10 cause that's what 10% of amount reduces to. payment = amount / 10; // 10/100 * amount => 1/10 * amount => amount/10 https://code.sololearn.com/cFzy5d41ePle/?ref=app

1/28/2021 10:10:47 PM

Itz.ME

5 Answers

New Answer

+2

Hi! Try with add int in the loop... for(int x=1; x<=6; x++){... /Regards Per B

+1

😥😒

+1

Did you do as Per suggested, u forgot the int in your code, int x=1

+1

After fixing the missing "int" you will notice that your result is always a bit above the expected value. This is due to rounding errors. You can take a look at this code to understand it better https://code.sololearn.com/ca5A14A10A15/?ref=app

-2

Itz.ME You can solve your problem just like this for(x = 1; x <= 6; x++) { amount = amount * (100 - 90) / 100; }