Exercise from Chris Pine's book, "Learn How To Program"