From: "Jesús Gabriel y Galán" Date: 2011-08-31T21:42:22+09:00 Subject: Re: Deaf Grandma Program doesn't work right On Wed, Aug 31, 2011 at 2:30 PM, Samuel Mensah wrote: > Grandma has hearing issues 'cos she's getting old. All she does is > answer my questions with a phrase "NO NOT SINCE 1938'. If I don't > yell(.upcase), she's gonna tell me to speak up. If I yell without a > question mark, she'll tell me "THAT'S NOT A QUESTION!". I write a > program for this scenario and anytime I yell with or without a question > mark, she tells me "THAT'S NOT A QUESTION!" > > What am I doing wrong or at least what am I missing? Try adding this and see if it gives you a hint: > question = '' > puts 'Ask grandma something...' > while question != 'BYE!' >    question = gets.chomp puts question puts question.upcase puts(question.upcase + '?') >   if question != question.upcase >     puts 'HUH?! SPEAK UP, SONNY!' >   elsif question == question.upcase+'?' >     puts 'NO, NOT SINCE 1938!' >   elsif question == question.upcase >     puts 'THAT\'S NOT A QUESTION!' >   elsif question == 'BYE!' >     puts 'BYE!' >   end > end Hint: the condition that question has to be equal to question.upcase + '?' is wrong. Check here http://ruby-doc.org/core-1.8.7/classes/String.html and see if you can find a method that tells you if the string ends with (hint, hint) a question mark. Jesus.