Ruby Ruby Basics Numbers Math Operations

Ronald Greer
Ronald Greer
44,790 Points

Ive been stuck on this ruby code challenge for a long time

I've never been able to figure out how to pass this code challenge, I've rewatched countless videos and i can't find anything on google. if anyone can please help, that'd be great.

program.rb

1 Answer

Steven Parker
Steven Parker
195,812 Points

The instructions say, "Multiply 25 times 3 and assign the result to a variable named product. Then divide 7 by 4 and assign the result to a variable named quotient."

So this is basically just two simple assignments with a calculation — the only trick to it is that to get a full-precision result, one of the values in the division needs to be specified as a float.

product = 25 * 3
quotient = 7.0 / 4    # note the explicit float