7.update


#1

What is wrong with my code please?

when I submit it it shows back : "Oops, try again. Make sure to test your program by choosing 'update'."

movies = {
Inception: 3,
}

puts "what movie is the best?"
choice = gets.chomp

case choice
when "add"
puts "What movie do you want to add?"
title = gets.chomp.to_sym
if movies[title.to_sym].nil?
puts "what is the rating of that movie?"
rating = gets.chomp
movies [title.to_sym] = rating.to_i
else

puts ("The movie already exists!")
end
when "update"
puts "what movie"
title = gets.chomp
if movies[title.to_sym].nil?
puts "Movie not found"
else
puts "what is the new rating? (Type from 1 to 10.)"
rating = gets.chomp
movies[title.to_sym] = rating.to_i
puts "#{title} has been updated with new rating of #{rating}."

end
when "display"
puts "Movies!"
when "delete"
puts "Deleted!"
else
puts "Error!"
end


#2

I sort it,,,
I need it to type "update" after I submit my code,,,,lol