First understand the structure of ALL the large programs in the
textbook; all the programs that we used in the lecture; and all the
programs we wrote for the labs. Look again at the visitor pattern.
All exercises are from the Lewis and Loftus book. Unfortunately
exceptions are covered poorly in the book so there aren't really any
good problems that use them. However, when you write the following
problems, clean up their design by using exceptions properly:
Can you encapsulate simple objects in classes?
- 4.14, 4.15, 4.16, 4.17 (pp. 168-169)
- 4.18 (p. 169): the method debit should throw an exception if
you attempt to debit more money than exists in the account.
How about collections of objects or recursively defined objects ?
- 6.30 (p. 247): remove the restriction to 30 customers.
- 8.14, 8.15, 8.16, 8.17 (pp. 327-328)
- 12.18, 12.20, 12.21 (p. 461)
- 16.14 (p. 555)
Putting things together?
- 11.22, 11.23, 11.24, 11.25, 11.26, 11.27, 11.29 (pp. 440-441)
Visited
times since December 15, 1997 (or the last crash).
sabry@cs.uoregon.edu