7/12, Code won't pass


#1

I think I did everything correctly here but this code won't pass. I've compared it against the first complete exercise and many people that posted in the forums. Furthermore, the only thing I changed was the "update" section of the code. I'm not sure what mistake I'm making but I imagine it's something very small. Thanks.


movies = {
'Back to the Future' => '4'
}

puts "Do you like this movie?"
choice = gets.chomp

case choice
when "add"
puts "Which movie?"
title = gets.chomp
if movies[title.to_sym].nil?
puts "How good is it?"
rating = gets.chomp
else
puts "Movie is already listed."
end

when "update"
puts "Which movie?"
title = gets.chomp
if movies[title.to_sym]nil?
puts "This movie is not listed."
else
puts "How do you feel about it now?"
rating = gets.chomp
movies[title.to_sym] = rating.to_i
puts "#{title} now rates as #{rating}."
end

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

movies = {}
movies[title.to_sym] = rating.to_i
puts rating + movies[title]


#2
if movies[title.to_sym]nil?

You're missing a period.


#3

My code is similar except I used

if movies[title.to_sym] == nil

instead of

if movies[title.to_sym]nil?

I hope this is helpful.