Prompting: Redux!


#1



https://www.codecademy.com/courses/ruby-beginner-en-0i8v1/0/4?curriculum_id=5059f8619189a5000201fbcb#


"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!"
else
    puts "Error!"
end


#2

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

:transformers => 5

#3

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