0

このコードは動作するはずです。しかし、Ruby で開くたびに、Ruby はコード内の何かを読み取ることができないため、ほとんどすぐに閉じます。したがって、明らかにコードにエラーがありますが、すべてを確認したところ、見つけられなかったようです。このコードを機能させるには、助けが必要です。よろしくお願いします!

puts 'Enter the number of the current month using the 12 months per year scale. Ex. January would be 1, February would be 2, March would be 3, etc...'
month=gets.chomp
case month
when '1'..'3'
fee='$45'
when'4'..'5'
fee='$55'
when'7'..'8'
fee='$65'
else
fee='$0.00'
end
puts'The fee to apply for the competition is ' + fee + '.00 when you apply on the date of today, ' + Time.now.to_s +'.'
puts 'If your fee came up as $0.00, then that is because the competition has ended. But do not worry, there is always next year!'
sleep 20
4

1 に答える 1