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.
This code is wrong! If you have a cost of 15, and a tip and tax of 10% each, it would output 19 instead of 18 since it rounds prematurely! You need to round only the final result!
If it passed all test cases, then there need to be more test cases.
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 →
This code is wrong! If you have a cost of 15, and a tip and tax of 10% each, it would output 19 instead of 18 since it rounds prematurely! You need to round only the final result!
If it passed all test cases, then there need to be more test cases.