Chapter 6 final and Assignment program 3