0
[Solved] Ballpark order. Swift
What is wrong with my code? It solved both open tests, but no one of hidden... Edit: Uldfang as the pro code coaches need to be set private so no-one can copy those so I've maded it private and removed the link.
5 Réponses
+ 10
Uldfang
For total cost of food and drink the print statement should be like this in the last time. Rest all the criteria is matching. Might be you missed something in question statement so just try with this I hope it will solve your query.
print(price+(price * 0.07))
+ 9
Uldfang
It's basically not difference but that test cases are failing because of rounding values if you need to use (price*1.07) just round the result of price till 2 decimal places. After that code will be run fine..
When I've tried that problem months ago some issue with rounding comes up so doing like more opened way it solved else you can add an rounding method till 2 places after decimal that will too work to solve the problem..
0
okay, will try to chage post)
0
TY, it solved a problem, but whats the difference between (price * 1.07) and (price + (price * 0.07)
0
TY a lot