OK, so you're not going to have been given this cold. Look through your course notes and I'm sure you'll find code examples that can be adapted to cover this. If there really is nothing then you should complain to the tutor for doing a duff job and giving you assignments for which he hasn't already given you the tools you need to solve it.