Not all member functions need be made public to serve as part of the interface of the class.
- Access functions
- public
- Read/display data
- Predicate functions
- Check conditions
- Utility functions (helper functions)
- private
- Support operation of public member functions
- Not intended for direct client use
The program of Figs. 1-4 demonstarates the notion of a utility function (also called helper function).
Figure 2:
SalesPerson class member-function definitions (part 1 of 2)
|
Figure 3:
SalesPerson class member-function definitions (part 2 of 2)
|
Figure 4:
Utility function demonstration
|
2004-07-01