Solution for Exercise 10.3

This is a solution for Exercise 10.3. See the source code for this file, and check the output in the console.