Hi! This is the 'Deaf Grandma' exercise from Chris Pine's Learn to
Program Second Edition book in which there is an instruction to make a
program that what is said to grandma is not heard unless it is in
capital letters.
In the extended version of this exercise when you should BYE three times
in a row she finally lets you leave.

Im having trouble understanding the error messages Ruby is giving me
namely:

deaf.rb:13: syntax error, unexpected kELSE, expecting kEND
  else input == input.upcase
      ^
deaf.rb:17: syntax error, unexpected kELSE, expecting $end
else input == 'BYE'
    ^


Here is my code:


/Deaf Grandma/


while input != 'BYE'
  puts 'Say hello to your grandmother'
  input = gets.chomp

if input == input.downcase
    puts 'HUH?! SPEAK UP, SONNY!'
  end

  else input == input.upcase
    puts ('NO, NOT SINCE' + (rand(21)+1930).to_s + '!')
  end

else input == 'BYE'
  break
end


Thank you
Coralie

-- 
Posted via http://www.ruby-forum.com/.