Exercise 20 java ( Loan Calculator) | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Exercise 20 java ( Loan Calculator)

Someone has completed Java exercise 20, which is about a loan calculator, because if I use only whole numbers it gives me an error in the results. Thank you.

2nd Feb 2021, 1:19 AM
Pablo Sanchez
Pablo Sanchez - avatar
6 Answers
+ 1
Share your code (save to playground and share link) with a description of your issue(s) and/or error(s) so we can help you figure out what is wrong.
2nd Feb 2021, 2:08 AM
ChaoticDawg
ChaoticDawg - avatar
2nd Feb 2021, 2:11 AM
Pablo Sanchez
Pablo Sanchez - avatar
+ 1
Ya it's a rounding issue. You can resolve it by using a couple of variants of variables, 1 int and 1 double, and doing a check between the 2, taking the greater, or you can use the ceil() method in the math library.
2nd Feb 2021, 2:43 AM
ChaoticDawg
ChaoticDawg - avatar
+ 1
I just tried it and it works perfectly, I hadn't realized it, thank you very much !!!!
2nd Feb 2021, 2:51 AM
Pablo Sanchez
Pablo Sanchez - avatar
0
my result is 53145 and the exercise tells me that if you put 100000, the result should be 53144.
2nd Feb 2021, 2:16 AM
Pablo Sanchez
Pablo Sanchez - avatar
2nd Feb 2021, 8:57 AM
Benjamin Jürgens
Benjamin Jürgens - avatar