My code fails the 4 case | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

My code fails the 4 case

Kaleidoscopes You sell souvenir kaleidoscopes at a gift shop, and if a customer buys more than one, they get a 10% discount on all of them! Given the total number of kaleidoscopes that a customer buys, let them know what their total will be. Tax is 7%. All of your kaleidoscopes cost the same amount, 5.00. Task: Take the number of kaleidoscopes that a customer buys and output their total cost including tax and any discounts. Input Format: An integer value that represents the number of kaleidoscopes that a customer orders. Output Format: A number that represents the total purchase price to two decimal places. Sample Input: 4 Sample Output: 19.26 https://code.sololearn.com/c01ggA3z1SzB/?ref=app

2nd Sep 2022, 9:24 PM
Costy Game
Costy Game - avatar
2 Answers
+ 1
No need use ceil funtion, too tedious multiplier, 0.9 1.07 can do far better.
2nd Sep 2022, 10:47 PM
abpatrick catkilltsoi
abpatrick catkilltsoi - avatar
+ 1
For such as payment calculations will be used round.
3rd Sep 2022, 7:34 AM
JaScript
JaScript - avatar