This is a parsons problem where you are given all the code but not in the right order. Can you follow the algorithm to fix the code?
Part of a module of work on code-it.co.uk from baggiepr