first 3 exercises in chapter 2 of programming pearls