+ 2

Q. What's wrong with my code? I'm doing Paint- costs task with ruby.

paintcost = 40 nopaintrequired = gets.to_i costpaint = nopaintrequired * 5 total = paintcost + costpaint tax = total * 10/100 costtotal = tax + total puts costtotal

2nd Mar 2021, 11:47 AM
Shobhit :)
Shobhit :) - avatar
2 odpowiedzi
+ 2
Also, we need to change the variables paintcost and costpaint to float. tax is float since it's divided by 100. paintcost = 40.00 costpaint = nopaintrequired*5.00 puts costtotal.round()
3rd Mar 2021, 10:48 AM
Simba
Simba - avatar
+ 2
Thank you so much Simba, it has worked
3rd Mar 2021, 11:30 AM
Shobhit :)
Shobhit :) - avatar