< previous page page_364 next page >

Page 364
Function PrintHeading does not receive any values from main, nor does it return any. Thus, its parameter list is empty.
Function GetData receives the data file from main and returns it, modified, after having read some values. The function returns the values of the department ID and its sales for the month to main. Thus, GetData has three formal parameters: the data file (with data flow Inout), department ID (data flow Out), and department sales (data flow Out).
Function PrintData must receive the department ID, store number, and department sales from the main function to print the bar graph for an input record. Therefore, the function has those three items as its formal parameters, all with data flow In.
Assumptions: Each file is in order by department ID. The same departments are in each store.
Main                                                                                                                          Level 0
Open data files (and verify success)
Print heading
Get data for a Store 1 department
Get data for a Store 2 department
WHILE NOT EOF on file store 1 AND NOT EOF on file store2
 Print data for the Store 1 department
 Print data for the Store 2 department
 Get data for a Store 1 department
 Get data for a Store 2 department

Print Heading (No parameters)                                                                                Level 1
Print chart title
Print heading
Print bar graph scale

 
< previous page page_364 next page >