EECS 211
How to read Chapter 6

Though Chapter 6 claims to be about functions, it's just as much about:

The last topic should be familiar. It's a central theme in CS 111. The others are more specifically about C++.

The Case Studies

The GradeBook case study in this chapter (Figure 6.4) isn't particularly interesting. It does not extend the GradeBook from the previous chapters, Instead it changes it from calculating an average of many grades to calculating the largest of three grades. Yawn. The only point of this is to demonstrate a function with three parameters. Double yawn.

Many of the other figures are simply demonstrations of C++ constructs, such as storage classes, reference parameters, and so on. The problem with such code is that they only show how to use some construct, not why or when.

On the other hand, the Craps simulator, Figure 6.11, illustrates a number of good coding points:

Notice the naming conventions with the enumerated type: