This sounds too much like school work to me and I need to let you know that if it is such, that posting here for the answers is against site policy.
On the other hand, you can try to write it and then if you get stuck, post your code here (enclosed in the required code tags) and we will help you get it working.
Regards,
Jeff
|