Finish Problem4_6 of chapter 4