Programs and Exercies from chapter 2