Programs and Exercises from chapter 2