Welcome to coderanch. Before you post questions here, please ShowSomeEffort. We would like to know what you have tried and what is wrong with it. We can give solutions to errors in your program but cannot give away the source code. If this is your homework, please DoYourOwnHomework.
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand."
--- Martin Fowler
Good heavens! What have you done! Here, try to fix it with this tiny ad:
a bit of art, as a gift, that will fit in a stocking