#4, Prompting: Redux!


#1



Hey guys,idk what im doing wrong, the error says , "Oops, try again. It looks like you didn't add Ishtar to the movies hash!", any help will be much appreciated, thx !

movies = {whoami: 8.5,
deadpool: 9,
gold: 8,
hacksaw_ridge: 9.5,
passangers: 9.5}

puts "Movies that you like: "
choice = gets.chomp

case choice

when "add"
puts "Insert movie title"
title = gets.chomp
puts "Insert rating"
rating = gets.chomp
movies[title]=rating
rating + movies[title]
puts "your movie and rating has been added"
when "update"
"Updated!"
when "delete"
"Deleted!"
else
"Error!"
end


Replace this line with your code.


#2

At this point the hash needs to 1,8 syntax.

'Hacksaw Ridge' => 4.5


#3

still getting the same error...


#4

Symbols don't come up until a later lesson. Your hash needs to follow the old syntax, as illustrated in the example, above.


#5

after 20 min of wat the heck im doin wrong, i finally found the answer, when asked "movies that you like" on the prompt, i would put random letters,and thats where i was wrong, you have to put "add" in order to run your program.... thx for your help tho, much appreciated


#6

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