This is the coad coach problem. I was getting 2/5 test cases were wrong. I dont know what was the problem with it. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

This is the coad coach problem. I was getting 2/5 test cases were wrong. I dont know what was the problem with it.

https://code.sololearn.com/c7MUDo2ikg0N/?ref=app https://www.sololearn.com/coach/22?ref=app

3rd May 2020, 5:11 AM
Anonymous
Anonymous - avatar
2 Answers
+ 4
Hello bro, you are almost correct :)) Rewrite the code like so : float res = 40 + (5*i); double s = res + res * 0.1; // or (10/100) or 10% System.out.println((int)Math.ceil(s)); Use Math.ceil() instead of Math.round()
3rd May 2020, 5:34 AM
Arb Rahim Badsa
Arb Rahim Badsa - avatar
+ 4
Thank you so much
3rd May 2020, 5:34 AM
Anonymous
Anonymous - avatar