6. Error! Error!

Hey I’ve searched thru all of the questions but I haven’t found a reason why my code isn’t working. If you can help me out I appreciate it. The program is running but when I test it with movies that are already saved, it ends up passing the else portion and asks for the rating.

movies= {“No Country for Old Men” => “5”,
“Dreams”=> “5”}

puts "What do you like?"
choice= gets.chomp

case choice

when "add"

puts “What’s the name of the movie?”
title= gets.chomp.to_sym

if movies[title.to_sym].nil?
puts “What would you rate it”
rating= gets.chomp.to_i

puts "The movie #{title} has been given a rating  of #{rating}"

puts “That movie/rating already exists mayne”


when “update”
puts “Updated!”

when “Display”
puts “Movies!”

when “delete”
puts “Deleted!”

puts “Error!”


Please post a link to the exercise you are on. Thanks.

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