C
Charlie Ca
Hi,
I am building a program that calculates the data points of a circle
based on 1 data point that the user enters. The user could enter the
radius circumference or area and get back the other properties of the
circle. I'm getting a 'Circles.rb:5: warning: Float 3.14 out of range'
in this context;
value1 = gets.chomp.to_f
puts 'The circle is of radius ' + [(value1/3.14)/2].to_s + 'units'
I've had this problem before. Another problem is a 'odd number list for
hash' error in this code. It happened 4 times in the code;
...ea ' + {{[(value1/3.14)/2]**2}* 3.14}.to_s + ' square units'
^
...{{[(value1/3.14)/2]**2}* 3.14}.to_s + ' square units'
^
...{[math.sqrt(value3/3.14)] * 2}.to_s + ' units, and circumfer...
^
...{[math.sqrt(value3/3.14)] * 2} * 3.14).to_s + ' units.'
^
what should I do?
I am building a program that calculates the data points of a circle
based on 1 data point that the user enters. The user could enter the
radius circumference or area and get back the other properties of the
circle. I'm getting a 'Circles.rb:5: warning: Float 3.14 out of range'
in this context;
value1 = gets.chomp.to_f
puts 'The circle is of radius ' + [(value1/3.14)/2].to_s + 'units'
I've had this problem before. Another problem is a 'odd number list for
hash' error in this code. It happened 4 times in the code;
...ea ' + {{[(value1/3.14)/2]**2}* 3.14}.to_s + ' square units'
^
...{{[(value1/3.14)/2]**2}* 3.14}.to_s + ' square units'
^
...{[math.sqrt(value3/3.14)] * 2}.to_s + ' units, and circumfer...
^
...{[math.sqrt(value3/3.14)] * 2} * 3.14).to_s + ' units.'
^
what should I do?