Commiting exercises 5 through 7 of list #4 for Algorithms and Programming 2.