Advertisement
Advertisement
| 07.24.2008 at 07:14AM PDT, ID: 23592138 |
|
[x]
Attachment Details
|
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: |
uses math;
function Late(hoursPerMonth : Integer; HoursStudied: String; IncludeWeekEnd: Boolean): String;
var hs, d, avg: Double;
begin
hs := StrToFloatDef(HourStudied, 0);
d := DayOf(Now);
avg := hoursPerMonth / IfThen(IncludeWeekend, 30, 22);
if d * avg > hs then
Result := 'you are late by ' + FloatToStr(d * avg - hs) + ' hours'
else if d * avg < hs then
Result := 'you are ahead by ' + FloatToStr(d * avg - hs) + ' hours'
else
Result := 'you are exactly on track';
end;
|