Don't mean to be a dick, but I don't like people asking me for all the code I have written for a particular assignment, when they have not shown any effort thus far. Whenever you have to do a programming assignment, start it way ahead of time and work on it a little every day.
I posted a reply in the above thread that tells you how I did it. I don't know if this will help you or not. I did the assignment in order to keep track of a bunch of things like turnaround time and context switches. My implementation also is formatted so that I could write a gannt chart output function if I so desired.