4. Prompting : Redux! Please help me


#1


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

movies={
"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!"

else
puts "Error!"
end

https://www.codecademy.com/courses/ruby-beginner-en-0i8v1/0/4?curriculum_id=5059f8619189a5000201fbcb#


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


Replace this line with your code.


#2

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.