Add examples for chapter 8: Encapsulating Algorithms