Exercise 2 of the first year software workshop module at the University of Birmingham.