Code executes with desired output but then shows there is a mistake


#1



https://www.codecademy.com/courses/ruby-beginner-en-1o8Mb/0/5?curriculum_id=5059f8619189a5000201fbcb#


Oops, try again.
It looks like your program doesn't puts 'Bonjour!' when greeting == 'French'.
I have written the case statement corrently and I cant see any error.


puts "Enter desired greeting language: "
greeting = gets.chomp

case greeting
    when "English" then puts "Hello"
    when "French" then puts "Bonjour"
    when "German" then puts "Guten Tag"
    when "Finnish" then puts "Haloo"
    else puts "I don't know that language"
end


#2

HI this line

when "French" then puts "Bonjour"

it's missing the ! after "Bonjour" then look again all the instruction

Hint

All the hello in other language should have the ! at the end


#3

Silly me. Thanks. It worked.


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.