7. update


#1



Help! I seriously can not figure out what I am supposed to do, any advice will be good at this point.


movies = {
"American Gangster" => 9
}
puts "What's your favorite movie?"
choice = gets.chomp

choice = case
when "add"
puts "Add a movie: "
title = gets.chomp
puts "What rating would you give this movie (0-4)?"
rating = gets.chomp
movies[title.to_sym] = rating.to_i
movies[title]=rating
puts "#{title} " + "has been added with a rating of " + "#{rating}"
when "update"
puts "Updated!"
when "update"
puts "Updated!"
when "display"

puts "Movies!"
when "delete"
puts "Deleted!"
else
puts "Error!"
end
if movies[title.to_sym].nil? == true
movies[title] = (rating)
else
puts "that movie already exists..."
end

The error it keeps giving me is:
"Oops, try again. Make sure to test your program by choosing 'update'."


#2

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