Why is my code wrong? It displayed "Added!"


At the 3.Case Statement
I have input the code and it executed correctly by displaying ‘Added!’ when the choice is ‘add’. But it keeps saying my code does not do it. Can’t figure out what is wrong.

print “Input your choice”
case choice
when “add”
puts “Added!”
when …




  1. Please give the FULL code you are using
  2. Do not use the so-called bang operator ! with your chomp
  3. Have you tried a refresh Browser

++++ reset of session *****************
As you are manipulating with objects
under certain circumstances you can shoot your Browser in an
inconsistent state.

Therefor it is of an advantage to know that you have 2 reset facilities:

One is the use of the F5-key which does a refresh Browser


Two, select&copy your code
Then use the Reset Code button of the course-window,
then paste your code back in.

General Notes:
Always refresh the browser after making corrections:
CTRL f5 ( if on Windows or Linux)
CMD r ( if on a MAC).
CTRL 0 to reset browser zoom


Thanks for the reply.
This is at the course “A Night at the Movies”
Here is the full code. I have removed the bang, and it is reported the same.
I have reset the code, and it still reported the same.

The curious thing is that when I input “add”, the run result already shows “Added!”, but the course still refuse to admit the code.

Here is the code.

movies={speed:4, terminator:5}
print "Input choice: "
case choice
when ‘add’
puts ‘Added!’
when ‘update’
puts ‘Updated!’
when ‘display’
puts ‘Movies!’
when ‘delete’
puts ‘Deleted!’
puts ‘Error!’

The result window shows:

Input choice: add


Replace your

print  "Input choice:"

with a

puts "Input choice: "


Thanks. It does the trick.