A start_new_page module is added to handle the paging. This module is called from the detail_processing module whenever the line_count has previously exceeded the lines_per_page. To insure that the line limit will never be exceeded, the test is made immediately before each name is printed in the report. Notice that the first page is forced by initializing line_count to 99. Because lines_per_page
includes the title and spacing lines, line_count is reset to 2 at the start of each new page, not zero. For now, the summary line continues to print just below the final detail line, regardless of whether the page is full. A blank spacing line is part of starting a new page. This is handled by a blank line variable set to the null string ("”) in the initial-processing module.
What will be an ideal response?
```
produce_report
CALL initial_processing
DO WHILE name < > "End of Data" CALL detail_processing
LOOP
CALL final_processing
initial_processing
LET count = 0
LET lines_per_page = 50
LET page_break = Chr(12)
LET blank line =
LET line_count = 99
INPUT name, sex_code, status_code
detail_processing
IF sex_code = "F" AND status_code = "F" THEN
IF line_count > lines_per_page THEN CALL start_new_page OUTPUT name
LET count = count + 1
END IF
INPUT name, sex_code, status_code
final_processing
OUTPUT "total number of students reported is ", count
start_new_page
OUTPUT page_break
OUTPUT "Full-time Female Students" OUTPUT blank lice
LET line_count = 2
```
You might also like to view...
Answer the following statements true (T) or false (F)
1. The update expression of a for loop can contain more than one statement, for example: for(i = 5; i <= 10; i++, total+= sales) 2. Multiple relational expressions cannot be placed into the test condition of a for loop. 3. You may nest while and do-while loops but you may not nest for loops. 4. You may not use the break statement in a nested loop.
The while statement uses the syntax while
Answer the following statement true (T) or false (F)