+ 13
Please help me to correct code in ruby
age = gets case #{age} when 1, 2, 3, 4, 5, 6 puts "impossible too young for coding" when 7, 8, 9 puts "Good, started coding at right age" when 10, 11, 12, 13, 14 puts "Keep it up" when 15, 16, 17, 18 puts "time for making career in programming" when 19, 20, 21, 22, 23, 24, 25, 26, puts "Hope you finds your career in programming" else puts "XYZ" end I don't know when I input any age like 13, 21 the program returns "impossible too young for coding" how to solve that please help me.
2 Answers
+ 15
age = gets.to_i
case age
The rest is correct.
+ 14
thanks