Here's the solution to the Leap Years exercise in the same chapter: (everything looks OK to me) ------------------------------------------------------------ puts 'Please enter the starting year' input = gets.chomp puts 'Please enter the ending year' input2 = gets.chomp puts '' puts 'The following are leap years:' input = input.to_i - 1 while input < input2.to_i input = input + 1 if input%4 == 0 || input%400 == 0 && input%100 != 0 puts input.to_s end end --------------------------------------------------------- I might continue posting the solutions for the rest of the book if I decide to keep on reading. This way I won't develop any bad habits (because hopefully the solutions will be scrutinized by at least one other person) and it'll help anyone else reading the book who gets stuck. I doubt the author of the book will ever get around to publishing the "official" solutions.