Ruby Code Sample
Get user input and run it through a boolean structure.
puts "Enter the day to see who is working."
day = gets.chomp
if day == "sunday" || day == "saturday"
puts "Joe and Kim are working that day."
elsif day == "monday" || day == "wednesday" || day == "friday"
puts "Sally and Kim are working that day."
else
puts "Sally and Todd are working that day."
end
Copyright © 1999-2011 Mary F. Jenn. All rights reserved.