Won't give me the pass


#1


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!"
else
    puts "Error!"
end


#2

Hi this line

case language

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


#3

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