assignment6 (chapter 7. functions)