Exercises chapter 7 solved successfully