I need help putting this question in a loop:
puts "Rate the requirements and quality on a scale from 1-10 points."
x = gets.chomp.to_f
raq = 3318.6 * 1.5066**x
puts "This will cost " + raq.to_s + "kr."
Something like this should work:
x = nil
until (1..10).include? x
puts "Rate the requirements and quality on a scale from 1-10 points."
x = gets.to_f
end
raq = 3318.6*1.5066**x
puts "This will cost #{raq}kr."
(Personally, I'd try to use something a little more descriptive than x
:) )