Stuck on 8/10


#1

movies = {
    batman: 5,
    superman: 3,
    ironman: 4
}
puts "enter your choice"
choice=gets.chomp
case choice
when "add"
puts "enter the movie title"
title=gets.chomp
if movies[title.to_sym].nil?
puts "enter the rating"
rating=gets.chomp
movies[title.to_sym]=rating.to_i
puts "#{title} has been added with a rating of #{rating}!"
else 
    puts"already exists"
end
when "update"
puts "enter the title to update"
title=gets.chomp
if movies[title.to_sym].nil?
puts "error"
else
    puts "enter the new rating"
    rating=gets.chomp
    movies[title.to_sym]=rating.to_i
    puts "#{title} has been update with a rating of #{rating}"
end
when "display"
movies.each [movie,rating] 
puts "#{movie}: #{rating}"
end
when "delete"
puts "Deleted!"
else
    puts "Error!"
end

#2

From what we can see, it looks like mostly indentation errors...

when 'string'
    puts 'output'
    title = gets.chomp
    if ...
        #
    else
        #
    end
when '...'

#3

i guess indentation is automatically handled by the ruby compiler here and for other section of code like the add and update seems to work okay!.


#4

What error are you getting?