examples for chapter 12 in GOOS