+ 2
Can somebody help me to solve this code about paint cost?
I dont know, why my code in case 3 and 4 is wrong. I have no idea. What missing code. https://code.sololearn.com/cYCs0kxC9IRr/?ref=app
8 Réponses
+ 2
Output Format
A number that represents the cost of your purchase rounded up to the nearest whole number.
Edit:
Also discount and pay should be float.
+ 3
Thanks everyone :)
+ 2
Fernando Pozzetti
Also discount and pay should be float.
+ 2
You're welcome.
+ 1
Show us your code so we can help you.
Remember to use Ceiling to apply tax if you are using division.
+ 1
Change this line to:
discount = ceil(count * 0.1);
And add
#include <cmath>
Below the other include
+ 1
Right. Remember that when we are using integers, the decimal numbers will be ignored, so we are losing precision in divisions.
0
H