Not sure if you still need this, but if so, then this should give you a 
boost in the right direction.

NIGHT_SHIFT = "00:00".."05:00"
EARLY_SHIFT = "05:01".."07:00"
DAY_SHIFT = "07:01".."16:00"
LATE_SHIFT = "16:01".."18:00"
EVENING_SHIFT = "18:01".."23:59"

def get_pay_rate(time, earnings)
  @payrate = earnings * 1.85 if NIGHT_SHIFT.include?(time)
  @payrate = earnings * 1.35 if EARLY_SHIFT.include?(time)
  @payrate = earnings * 1.00 if DAY_SHIFT.include?(time)
  @payrate = earnings * 1.35 if LATE_SHIFT.include?(time)
  @payrate = earnings * 1.60 if EVENING_SHIFT.include?(time)
  return @payrate
end

# Start program
puts "Payrate calculator"
puts "Enter a starting time (i.e. 13:00 or 01:59)"
start_time = Time.parse(gets.chomp)

puts "Enter ending time in the same format."
end_time = Time.parse(gets.chomp)

puts "How much do you make?"
earnings = gets.chomp

daily_pay = Array.new

(start_time.hour..end_time.hour).each do |time|
  daily_pay << get_pay_rate((time.to_s.rjust(2, "0") << ":00"), 
earnings)
end


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