Add solutions to programming problems in chapter 2