Don't know what I am doing wrong?


#1



Prompting: Redux!

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


movies = {
    'Heat' => 1,
    'Rebecca' => 3,
    'The Godfather' => 5,
    'School of Rock' => 9
}
puts "What choice are you going to make"
choice = gets.chomp.downcase
case choice
when "add"
    puts "What movie do you want to add?"
title = gets.chomp
when "update"
    puts "What is your rating 0-4?"
    rating = gets.chomp
 movies[title.to_sym] = rating.to_i
    puts "the movie #{title} and #{rating} have been added"
when "display"
    puts "Movies!"
when "delete"
    puts "Deleted!"
else
    puts "Error!"
end

Replace this line with your code.


#2

HI, in when "add" and when "update"

when "add"
    puts "What movie do you want to add?"
title = gets.chomp
when "update"
    puts "What is your rating 0-4?"
    rating = gets.chomp
 movies[title.to_sym] = rating.to_i
    puts "the movie #{title} and #{rating} have been added"

this part

    puts "What is your rating 0-4?"
    rating = gets.chomp
 movies[title.to_sym] = rating.to_i
    puts "the movie #{title} and #{rating} have been added"

should be inside the when "add" then you don't need to .to_sym and .to_i in this Lesson


#3

Thanks for the prompt reply. I see now.