+ 2
Can anyone solve the error.
#include <iostream> using namespace std; int main() { int material = 40; int colors; cin>>colors; int cost1 = (colors*5)+ material; int total_cost = cost1/10 + cost1; cout<<total_cost; return 0; } Paint costs
5 Réponses
+ 1
Tax for that you are caluating is missing % calculation.
And the total, you need to round up
Like use ceil function...
Means 4.4455 to 5.0
Try it and give a reply......
+ 2
It is solving 3 cases 1,2,5 but not the 3,4 the hidden cases.
+ 2
Tax is included in the total_cost as cost1/10 or cost*10/100 is the same
+ 2
How can I use the ceil function to round off to the nearest integer
+ 1
#include <cmath> allows you to use the ceil function