We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
here is the thing. i passed all the test cases except 3rd, the calculation shows
20.75 - mealCost
10 - tipPercent
3 - taxPercent
in my calculation
12*10 = 120
12*3 = 36
(120+ 36)/100 = 1.56
1.56 + 20.75 = 22.31
so even you round up 22.31; the result is 22. but your test case expect it to be 23. how come? can you kindly explain this scenario ??
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Day 2: Operators
You are viewing a single comment's thread. Return to all comments →
here is the thing. i passed all the test cases except 3rd, the calculation shows 20.75 - mealCost 10 - tipPercent 3 - taxPercent
in my calculation 12*10 = 120 12*3 = 36 (120+ 36)/100 = 1.56 1.56 + 20.75 = 22.31 so even you round up 22.31; the result is 22. but your test case expect it to be 23. how come? can you kindly explain this scenario ??