Do Programming Exercise 9.1, page 338. (Note, there is a typo. At one point rectangle is mentioned, but triangle is intended.)