<PLEASE USE THE FOLLOWING TEMPLATE TO HELP YOU CREATE A GREAT POST!>
<Below this line, add a link to the EXACT exercise that you are stuck at.>
https://www.codecademy.com/courses/learn-ruby/lessons/a-night-at-the-movies/exercises/update?action=lesson_resume
<In what way does your code behave incorrectly? Include ALL error messages.>
My code seems to work perfectly, but I keep getting an error message that says “SCT error” and I cannot move on to the next lesson. Please help!
movies = {
Pans_Labyrinth: 5
}
puts “What would you like to do to the list?”
user_input = gets.chomp
case user_input
when “add”
puts “Movie title:”
new_title = gets.chomp.to_sym
puts "Rating: "
rating = gets.to_i
if movies[new_title.to_sym].nil?
movies[new_title] = rating
else
puts “That movie already exists!”
end
when “update”
puts “Movie title:”
title = gets.chomp.to_sym
if movies[title].nil?
puts “That movie is not on the list.”
else
puts “New rating:”
new_rating = gets.to_i
movies[title] = new_rating
puts “#{title} has been updated with new rating of #{new_rating}.”
end
when “display”
puts “Movies!”
when “delete”
puts “Deleted!”
else
puts “Error!”
end
<do not remove the three backticks above>