final hw with part 8

Completed the program for the last part of the assignment