watercyfle
If this is for school you really should do it yourself.
If it is not for school you should use the classifieds section if you want to hire a programmer.
edit: i had my laugh now let me try to help.
where exactly are you having problems? what is it that you understand and what don't you understand? do you know what you need to do? do you get the idea? No one is going to do your assignment for you, no matter how many times you say please. But if you have any questions then this is the right place.
I really need help please...
Let's get this straight.
You're not looking for help. You asked for someone to give you code for it. That's asking for someone to do it for you.
The answer is "no". You're a student. You're supposed to be learning. So go learn. There are enough bad programmers in the world already, don't be another.
can someone give me a source code for it
Your teacher wants you to create your own source code! You don't learn anything good by getting someone else to do your school work for you. It's been suggested (through other channels) that this thread be closed, but I think you're getting good answers.