4. Prompting: Redux! - Need help!


#1



Keep getting an error message of: Oops, try again. It looks like you didn't add to the movies hash!
Can anyone help please???


movies = {
    Marvel: 4,
    Transformers: 3,
    Minions: 4
}
puts "what is your favourite?"
choice = gets.chomp
case choice 
when "add"
puts "what is the title?"
title = gets.chomp
puts "what is the rating?"
rating = gets.chomp
puts "#{title} has been added with a rating of #{rating}."
when "update"
puts "Updated!"
when "display"
puts "Movies!"
when "delete"
puts "Deleted"
else 
    puts "Error!"
end


#2

Did you study the example in Lesson 1? Have you read the lesson instructions carefully? The above line does not indicate that.


#3

Thanks - I thought I had corrected this line but turns out I hadn't.

I still keep getting an error message - whenever I type in a movie title, it says it hasn't been added to the movies hash


#4

So you are entering 'add' and then a movie title and rating? Be sure to write mutliple words in quotes.

"The Deep"

#5

It still doesn't work no matter - I don't understand what im doing wrong?


#6

Nevermind! Fixed it!


#8

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