New course! Every coder should learn Generative AI!
Try a free lesson0
Challenge "Paint Costs"
Hi, I've tried this little challenge but i cant seem to understand why only 3 of the 5 cases are correct. and the challenge doesn't tell me why it fails Here's my code #include <iostream> using namespace std; int paint(int x) { cout << x; } int main() { int x, total, tax; cin >> x; total = x*5+40; tax = total + (total / 10); paint(tax); //paint each = 5 //materials = 40 //tax = 10% }
4 Answers
+ 3
The problem in your code is that the output must be rounded to the nearest number, here is how to do it:
https://sololearn.com/compiler-playground/cQjl7Ftt7RF9/?ref=app
+ 2
Hello! It wouldn't be very helpful if you added the link to the code, not the code in the question.
This is your code:
https://sololearn.com/compiler-playground/cr7X2GZcEa54/?ref=app
+ 1
Thanks for the help
+ 1
Reda Abdoun Ribeiro I shouldn't thank you, it's ours work 😉