4. Prompting : Redux! Please help me


I don't know what's wrong with it.
Could you tell me what's the answer and what's wrong with it?

"theelo" => 10,
"sddfv" => 5,
"hello" => 3,

puts "What is your favorite movie?"
choice = gets.chomp

case choice
when "add"
print "Give the rating of the movie?"
title = gets.chomp
movies[title] = rating
print "how would you rate it?"
rating = gets.chomp
puts " movie with the title #{title} was add with the rating of #{rating}"

when "update"
puts "Updated!"

when "display"
puts "Movies!"

when "delete"
puts "Deleted!"

puts "Error!"


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

Replace this line with your code.


Start by asking for an action, add, update, display, delete. Then in the add case, ask for a movie name, then the rating.

puts "What action to take?"
choice = gets.chomp

case choice
when "add"
  puts "What movie to add?"
  title = gets.chomp
  puts "Give the rating of the movie?"
  rating = gets.chomp

and so on. You get the gist, I'm sure.