+ 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
2 ответов
+ 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()
+ 2
Thank you so much Simba, it has worked