Looks like a
homework. What have you tried so far?
You cannot ask such questions here. You need to put some efforts in it first, try something on your own and then if you find any difficulty, post it as a question. But don't post your entire homework like this.
It's your homework, it's your responsibility to complete it. We are not here to do the homework for you. Please read
Code Project Quick Answers FAQ[
^] before posting question here. Don't ruin the forum this way.
Try it yourself, you may find it is not as difficult as you think!
KR