added source code for 3 assignments in chapter 2