The decay of late assignments

It is expected that assigned homework is turned in by the announced due date. Homework that is turned in late has a half-life of 10 days.

Let due be the time when a homework assignment is due, let actual be the time when a homework assignment is turned in, and finally let raw be the "raw" grade given to the homework before computation of any penalty. Then record, the recorded grade for the assignment is calculated using the following mixture of real mathematical and C programming notation:

if actual <= due,
raw
if actual > due,
(int) (raw * pow(.5, (actual-due)/(10 days)))

The following form ain't working yet

Original grade:
Due date
Day: Month: Year:
Date turned in
Day: Month: Year: