Prompting: Redux!-Oops, try again. It looks like you didn't add to the movies hash!


#1

Hi guys,
i'm stuck on this exercise because of the movies hash. Don't know what's wrong. Could you please help me?

movies = {
    pride_and_prejudice:1,
    mr_nobody:2,
    eat_pray_love: 4,
    kurvahosigutentag: 3,
}
puts "What is your favorite movie?"
choice= gets.chomp

case choice
when "add"
print "What movie do you want to add?"
    title = gets.chomp 
    print "What's rating do you give to that Movie?"
    rating = gets.chomp
    movies[title] = rating
    puts "A movie with the title #{title} was add with the rating of #{rating}"
when "update"
puts "Updated!"
when "display"
puts "Movies!"
when "delete"
puts "deleted"
else 
puts "Error!"
end

#2

What I did was too make this:

choice = case

#3

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