Just post what you have coded so far (complete program please), and tell us what the problem is (crashes, compiler errors etc).
And in general, it would help to describe a bit more precisely what
exactly you are trying to achieve, as at least to me, the problem/task description doesn't make much sense..
Ralf
PS: As mentioned in other threads, we don't do your homework for you, we are however willing to help you with some more specific problems, if properly described and as JJ mentioned, you show us what you already did...