Prompting: Redux!


"Oops, try again. It looks like you didn't add the movies hash!"

movies = {
    transformers: 5}

puts "What rating would you give this movie?"
choice = gets.chomp

case choice
when 'add'
    puts "Please enter the title of a movie:"
    title = gets.chomp
    puts "What rating (1-10) would you like to give this movie?"
    rating = gets.chomp
    puts "Your movie #{title} has been added with the rating of #{rating}."
when 'update'
    puts "Updated!" 
when 'display'
    puts "Movies!"
when 'delete'
    puts "Deleted!"
    puts "Error!"


For the earlier lessons we need to use the old hash syntax, not the new.

:transformers => 5


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