Won't give me the pass


A night at the movie - Case statement

It looks like your case statement doesn't puts 'Error!' when it gets unexpected input.

movies = {'Home Alone 2' => 10}
puts "Some user input"
choice= gets.chomp

case language 
when "add"
    puts "Added!"
when "update"
    puts "Updated!"
when "display" 
    puts "Movies!" 
when "delete"
    puts "Deleted!"
    puts "Error!"


Hi this line

case language

you didin't define language but choice so you should change it.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.