C++ Crash Course: Solution to Exercise 5-4.