Learn to program, exercises from chapter 7.5