4 Prompting: Redux


#1



4 Prompting: Redux

Oops, try again. Did you create a variable called title?

movies = {
    "layercake" => 5
}

puts "enter choice"

choice = gets.chomp

case choice
when "add"
puts "What movie would you like to add?"
title = gets.chomp   
puts "What's the rating of the movie?"
rating = gets.chomp

movies = {}

movies[title] = rating

puts "#{title} has been added with a rating of #{rating}!"
    end

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

WHAT AM I DOING WRONG? Gone from not adding title to the movies hash to now it wont even register the title.


#2

Hi @moonmano,

Are you still stuck on this exercise?


#3

There is no need to create new movies here

delete that line and it should work


#4

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