$roger = new Employee::Casual( rate => 14.00 ); $sally = new Employee::FullTime( salary => 50_000 ); $mark = new Employee::FullTime( wage => 12.00 ); $roger->add_hours( 8 ); # worked 8 hours $sally->add_hours( 8 ); # worked 8 hours $mark->add_hours( 8 ); # worked 8 hours # Now pay them $roger->write_check(); # 14 * 8 = $112.00 $sally->write_check(); # $0.00 - nothing due to a full timer until fortnight is accounted for $mark->write_check(); # $0.00 - same here # add another 11 days # ... same as above, 11 times ... # then on day 13, it's a long day $roger->add_hours( 10 ); # worked 10 hours $sally->add_hours( 10 ); # worked 10 hours $mark->add_hours( 10 ); # worked 10 hours # So then they take day 14 off $roger->sick_leave( 8 ); # 8 hours $sally->sick_leave( 8 ); # 8 hours $mark->sick_leave( 8 ); # 8 hours # and get a work log: $roger->write_check(); # 11 days * 8 hours + 1 day * 10 hours = 98 hours @ $14.00 = $1372 # (no sick pay for casuals and we've already paid him for day 1) $sally->write_check(); # 14 days @ ($50000 / 365 days) = $1917 # (no overtime for sallary earners) $mark->write_check(); # 12 days * 8 hours + 1 day * 10 hours = 106 hours @ $12.00 = $1272 # get entitlements $roger->leave_entitlements(); # {sick_leave => 0, annual_leave => 0} - none for the casual $sally->leave_entitlements(); # {sick_leave => 56, annual_leave => 8.6} $mark->leave_entitlements(); # {sick_leave => 56, annual_leave => 8.6}