what have you tried now? do you have errors or bugs in your code? Unfortunately, we cannot (and don't want to) give the answer or provide a code for your exams. Just give a little effort, then ask...