It looks like you didn't add to the movies hash!


#1

Oops, try again. It looks like you didn't add to the movies hash! is what I'm getting for this - movies = {
Star_Wars: 5,
Matrix: 5
}
puts "What would you like to do (Add, Update, Display, Delete)"

choice = gets.chomp

case choice
when "add"
puts "Enter Movie Title"
title = gets.chomp
puts "Enter a rating!"
rating = gets.chomp
movies[title] = rating
puts "Movie has been added!"
when "update"
puts "Updated!"
when "display"
puts "Movies!"
when "delete"
puts "Deleted!"
else
puts "Error!"
end


Prompting: Redux!
#2

HI when you Save & Submit Code you should type in the console add then press Enter and type the name of the movie you wan to add then press Enter and the rating of the movies and press Enter


#3

use this:
movie["title"]=rating


#4

My code wasn't wrong... Codeacademy forces you to choose the 'add' case to test it was done correctly. It should accept anything an return the consequent of else (Error!).


#5

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