4. prompting: Redux!


#1



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


oops, try again. It looks like you didnt add star wars to the hash!


 movies = {
    "deadpool" => 5,
}
puts "what you want? (add,update,display)"
choice = gets.chomp
case choice
when "add"
puts "what movie?"
title = gets.chomp
puts "what you rate this?"
rating = gets.chomp
movie[title] = rating
puts "added #{title}" 
when "update"
puts "updated"
when "display"
puts "movies!"
when "delete"
puts "deleted"
else
    puts "Error!"
end


#2

@reanamate
1. Try to add second film to your movies hush.
2. Correct your line code:
puts "added #{title}"
by adding rating as well:
puts "#{title} / #{rating}"


#3

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