programming exercises from cs106b chapter 05