Lesson 4 to 9 completely non understandable


#1

I am finding totally helpless.This needs to be made more clear explanation in detail.
Rajesh coder 68873


#2

Post the instructions and what confuses you. Your question is completely non understandable.


#3

Hi
Pl post the right code for lesson 4 if you can.According to the instructions I have written the code .Where is the error pl write to me so that I can modify my code.
Rajesh coder 68873


#4

Post the instructions and your attemped code. Asking for answers is against the community guidlines.


#5

Pl consider my case differently as I am 71 yrs old man and is non professional having hardly any knowledge of Computer coding.I am doing these courses only for passing time & also as a hobby.I would never be using these for jobs etc.Since I could complete 95 % of the course and I would like to complete balance 5 % also.
Pl check the code below and indicate where is the error.
movies= { Memento: 3,
Primer: 4,
Ishtar: 1
}

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 "added"
title = gets.chomp
if movies[title.to_sym].nil?
puts "What's the rating? ( 4.)"
rating = gets.chomp
movies[title.to_sym]= rating.to_i
puts "#{title} has been added with a rating of #{rating}."
else
puts "That movie already exists! Its rating is #{movies[title.to_sym]}."
end
when 'update'
puts "updated"
title = gets.chomp
if movies[title.to_sym].nil?
puts "Movie not found!"
else
puts "What's the new rating? (3.)"
rating = gets.chomp
movies[title.to_sym] = rating.to_i
puts "#{title} has been updated with new rating of #{rating}."
end
when 'display'
puts 'displayed'
movies.each do |movie, rating|
puts "#{movie}: #{rating}"
end
when 'delete'
puts "deleted"
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
else
puts "Sorry, I didn't understand you."
end
Rajesh coder 68873