Solving the exercises from the book Programming: Principles and Practice using C++