My solutions to the programming excercise in C++ Primer