< previous page page_622 next page >

Page 622
Print CharList and FreqList (parameters discussed later)
FOR index going from 0 through length-1
  Print charist[index], " occurred ", freqList[index], " time(s)"

Because the Increment FreqList module is only one simple statement, it is coded directly in the main module. Let's look at the interfaces of the other functions.
FunctionInOutComments
GetCharListcharList
length
length will be last value of counter.
ZeroFreqListlengthfreqList
ScanListcharList
length
inputChar
found
index
If found is TRUE, index
gives place found.
PrintfreqList
charList
length

Remember that any variables in the Out column must be reference parameters. Those listed only in the In column, except for arrays, should be value parameters. Because C++ always passes arrays by reference, an array listed only in the In column should be declared as const in the formal parameter list.
Module Structure Chart:
0622-01.gif

 
< previous page page_622 next page >