MY CODE >> Movie Ratings
# Tommy Martin
# 8/13/2015

# Movie Ratings:
# This application was developed while following a tutorial at codecademy.com
# The application uses the fundamental principles of Add, Update, Display, and Delete.

movies = {
    Step_Brothers: 5,
    MI6: 4,
    Fantastic_4: 3
}

puts "Please enter a choice (add, update, diplay, delete)"
choice = gets.chomp

case choice
when "add"
  puts "Enter Title"
  title = gets.chomp
  puts "Enter Rating"
  rating = gets.chomp
  if movies[title.to_sym] then
      puts "This movie already exists"
  else
      movies[title.to_sym] = rating.to_i
      puts "#{title} added!"
  end
when "update"
  puts "Enter Title"
  title = gets.chomp
  unless movies[title.to_sym]
      puts "There is no movie by that name here..."
  else
    puts "Enter Rating"
    rating = gets.chomp
    movies[title.to_sym] = rating.to_i
  end
when "display"
  movies.each { |movie,rating| puts "#{movie}: #{rating}" }
when "delete"
  puts "Enter Title"
  title = gets.chomp
  unless movies[title.to_sym]
      puts "There is no movie by that name here..."
  else
    movies.delete(title.to_sym)
  end
else
  puts "Error!"
end