9/10 a night at the Movie


#1

Hello

here my code

movies = {
"Memeto" => 5,
"tron" =>6,
"hulk" =>2,
}

puts "movie"
choice = gets.chomp

case choice
when "add"
puts "Enter a movie"
title.to_sym = gets.chomp
puts " rating movie"
rating.to_i = gets.chomp
if movies[title.to_sym].nil?
puts "error movie"
end
when "update"
puts " title a movie"
title = gets.chomp
if movies[title.to_sym].nil?
puts"error movie"
else
puts "new rating"
rating = gets.chomp
end
when "display"
movies.each do |movie, rating|
puts "#{movie}: #{rating}"
end
when "delete"
puts "What movie do you want to delete?"
title = gets.chomp
if movies[title.to_sym].nil?
puts "Movie not found!"
else
movies.delete(title.to_sym)
puts "#{title} has been removed."
end
end

when i submit
Oops, try again. Make sure to test your program by choosing 'delete'.

i don't understand because i using .delete.


#2

They're asking to TEST your program with the command delete. They're not talking about the method delete here.


#3

Ok thank for the help.


#4

what one is this in ruby


#5

I don't understand your question.


#6

whitch lesson is this


#7

This is not a lesson, it's a thread you created yourself, in the section 12. A Night at the Movies.


#8

lesson 12....................................


#9

Nevermind, I confused with another thread. This thread is about the exercise 9/10 in the lesson 12. A Night at the Movies.


#10

which section........................


#11

it still wont work I get nil error