Programs and Exercises from chapter 3