A NIGHT AT THE MOVIES Prompting: Redux!


My editor is hanging up, I think.

My code is:
movies = {
StarWars: 4.8,
Divergent: 4.7

puts "What would you like to do? "
puts "-- Type ‘add’ to add a movie."
puts "-- Type ‘update’ to update a movie."
puts "-- Type ‘display’ to display all movies."
puts “-- Type ‘delete’ to delete a movie.”

choice = gets.chomp.downcase

case choice
when "add"
puts "What movie do you want to add?"
title = gets.chomp

puts "What’s the rating? (Type a number 0 to 4.)"
rating = gets.chomp

movies[title] = rating

when "update"
puts "Updated!"
when "display"
puts "Movies!"
when "delete"
puts "Deleted!"
puts "Error!"

When I press Run, it just keeps spinning and then displays - Error.
Can someone tell me what wrong am I doing?


When you click Run, you should see a prompt in the console. Enter a film name. The next prompt will be for a rating (0 to 4), so enter a number. Be sure to enter at least something. Pressing enter alone will result in an error.


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