Display 8


#1

movies = {
"arrow" => 4.5
}

puts " What do u wanna do ? "
choice = gets.chomp.downcase!

case choice
when "add"
puts "Which movie u like to add ? "
title = gets.chomp.downcase!
puts "From a scale from 0 to 5 rate this movie"
rating = gets.chomp
if movies[title.to_sym] == nil
movies[title.to_sym] = rating.to_i
else
puts " u added that movie b4"
end
when "update"
puts "Which movie u wanna update ? "
title = gets.chomp.downcase!
if movies[title.to_sym] == nil
puts "Thas not on the list, maybe u wanna add it ?"
else
puts "Whats the new raiting"
rating = gets.chomp
movies[title.to_sym] = rating.to_i
end
when "display"
movies.each do |movie, rating|
puts "#{movie}: #{rating}"
end
when "delete"
puts "Deleted"
else
puts "Error!"
end


#2

this is my code and it keeps giving this error "Oops, try again. It looks like your 'puts' doesn't include Memento: 3."

movies = {
Memento: 3,
Primer: 4,
Ishtar: 1
}

puts "please add and rate your favorite movie"
puts "if your movie is already in, plase type update"
puts "if you want to delete a movie you added, click remove"

choice= gets.chomp.downcase
case choice
when 'add'
puts "What movie do you want to add?"
title = gets.chomp
if movies[title.to_sym].nil?
puts "please rate you movie"
rating = gets.chomp
movies [title.to_sym] = rating.to_i
puts "#{title} was added with a rating of #{rating}"
else
puts "your movie already existsand it's ratings is #{movies[title.to_sym]}"
end
when 'update'
puts "What is the movie you want to update"
title = gets.chomp
if movies[title.to_sym].nil?
puts "that movie has not been added yet"
else
puts "please update the rating"
rating = gets.chomp
movies [title.to_sym] = rating.to_i
puts "the rating has benn updated"
end

when 'display'
    movies.each do |movie, rating|
    puts "#{movies}"
end  

when 'delete'
    puts "Deleted!"
else 
    puts "Error!"

end


#3

your puts"#{movies}"
has to be this EXACTLY "#{movies}: #{ratings}"
nothing else. codecademy want's it like that, so you have to do it like that.
note that there is not a space after the quote.