An exercise from "C++ How to program" dy Deitels