Questions about breaks:
Note answers can have one, none or many correct.|
1. |
MOVE HOLD-JOB-CODE-WS TO JOB-CODE-ML.
MOVE MINOR-CT-JOB-CODE-ACC TO MINOR-CT-JOB-CODE-ACC-ML.
MOVE MINOR-SALARY-ACC TO MINOR-SALARY-ACC-ML.
WRITE PRINTZ FROM MINOR-TOTAL-LINE
AFTER ADVANCING 2 LINES.
MOVE JOB-CODE TO HOLD-JOB-CODE-WS.
MOVE 0 TO MINOR-CT-JOB-CODE-ACC.
MOVE 0 TO MINOR-SALARY-ACC. |
|
2. |
MOVE JOB-CODE TO JOB-CODE-ML.
MOVE MINOR-CT-JOB-CODE-ACC TO MINOR-CT-JOB-CODE-ACC-ML.
MOVE MINOR-SALARY-ACC TO MINOR-SALARY-ACC-ML.
WRITE PRINTZ FROM MINOR-TOTAL-LINE
AFTER ADVANCING 2 LINES.
MOVE JOB-CODE TO HOLD-JOB-CODE-WS.
MOVE 0 TO MINOR-CT-JOB-CODE-ACC.
MOVE 0 TO MINOR-SALARY-ACC. |
|
3. |
MOVE JOB-CODE TO JOB-CODE-ML.
MOVE MINOR-CT-JOB-CODE-ACC TO MINOR-CT-JOB-CODE-ACC-ML.
MOVE MINOR-SALARY-ACC TO MINOR-SALARY-ACC-ML.
WRITE PRINTZ FROM MINOR-TOTAL-LINE
AFTER ADVANCING 2 LINES.
MOVE 0 TO MINOR-CT-JOB-CODE-ACC.
MOVE 0 TO MINOR-SALARY-ACC. |
Problem #2: Assuming the payroll problem described above, which is the correct code for B-100-PROCESS.
|
1. |
READ INPUT-FILE
AT END
MOVE "NO " TO MORE-RECS.
MOVE JOB-CODE TO HOLD-JOB-CODE-WS.
PERFORM B-200-LOOP
UNTIL MORE-RECS = "NO ".
PERFORM B-320-FINAL-ROUT. |
|
2. |
READ INPUT-FILE
AT END
MOVE "NO " TO MORE-RECS.
PERFORM B-200-LOOP
UNTIL MORE-RECS = "NO ".
PERFORM B-310-MINOR-ROUT.
PERFORM B-320-FINAL-ROUT. |
|
3. |
READ INPUT-FILE
AT END
MOVE "YES" TO EOF-IND.
MOVE JOB-CODE TO HOLD-JOB-CODE-WS.
PERFORM B-200-LOOP
UNTIL EOF-IND = "YES".
PERFORM B-310-MINOR-ROUT.
PERFORM B-320-FINAL-ROUT. |
|
4. |
READ INPUT-FILE
AT END
MOVE "NO " TO MORE-RECS.
MOVE JOB-CODE TO HOLD-JOB-CODE-WS.
PERFORM B-200-LOOP
UNTIL MORE-RECS = "NO ".
PERFORM B-310-MINOR-ROUT.
PERFORM B-320-FINAL-ROUT. |
Problem #3: Assume that you now want to check for three levels of breaks. COMPANY is the major break, PLANT is the intermediate break and JOB-CODE is the minor break. Which is the correct code to check for a break?
|
1. |
IF JOB-CODE NOT = HOLD-JOB-CODE-WS
PERFORM B-310-MINOR-ROUT
PERFORM B-320-INTER-ROUT
PERFORM B-330-MAJOR-ROUT
ELSE
IF PLANT NOT = HOLD-PLANT-WS
PERFORM B-310-MINOR-ROUT
PERFORM B-320-INTER-ROUT
ELSE
IF COMPANY NOT = HOLD-COMPANY-WS
PERFORM B-310-MINOR-ROUT.
PERFORM B-300-DETAIL.
READ INPUT-FILE
AT END
MOVE "NO " TO MORE-RECS. |
|
2. |
IF COMPANY NOT = HOLD-COMPANY-WS
PERFORM B-330-MAJOR-ROUT
PERFORM B-320-INTER-ROUT
PERFORM B-310-MINOR-ROUT
ELSE
IF PLANT NOT = HOLD-PLANT-WS
PERFORM B-320-INTER-ROUT
PERFORM B-310-MINOR-ROUT
ELSE
IF JOB-CODE NOT = HOLD-JOB-CODE-WS
PERFORM B-310-MINOR-ROUT.
PERFORM B-300-DETAIL.
READ INPUT-FILE
AT END
MOVE "NO " TO MORE-RECS. |
|
3 |
IF COMPANY NOT = HOLD-COMPANY-WS
PERFORM B-310-MINOR-ROUT
PERFORM B-320-INTER-ROUT
PERFORM B-330-MAJOR-ROUT
ELSE
IF PLANT NOT = HOLD-PLANT-WS
PERFORM B-310-MINOR-ROUT
PERFORM B-320-INTER-ROUT
ELSE
IF JOB-CODE NOT = HOLD-JOB-CODE-WS
PERFORM B-310-MINOR-ROUT
END-IF
END-IF
END-IF
PERFORM B-300-DETAIL.
READ INPUT-FILE
AT END
MOVE "NO " TO MORE-RECS. |
|
4. |
IF COMPANY NOT = HOLD-COMPANY-WS
PERFORM B-310-MINOR-ROUT
PERFORM B-320-INTER-ROUT
PERFORM B-330-MAJOR-ROUT
ELSE
IF PLANT NOT = HOLD-PLANT-WS
PERFORM B-310-MINOR-ROUT
PERFORM B-320-INTER-ROUT
ELSE
IF JOB-CODE NOT = HOLD-JOB-CODE-WS
PERFORM B-310-MINOR-ROUT
PERFORM B-300-DETAIL.
READ INPUT-FILE
AT END
MOVE "NO " TO MORE-RECS. |
Problem #4: Which of the following is a true statement?
|
1. |
In the detail routine of a program with major, intermediate and minor breaks, you add to the minor accumulators, the intermediate accumulators, the major accumulators and the final accumulators (if final totals are needed). |
|
2. |
In a program with major, intermediate and minor breaks, you could:
|
|
3. |
In a program with major, intermediate and minor breaks, you could add to all of the totals in the minor routine. |
Problem #5: Which of the following is a true statement? Make sure the order of statements is correct!
|
1. |
In break routines you need to:
|
|
2. |
In break routines you need to:
|
|
3. |
In break routines you need to:
|
Problem #6: Which of the following is a true statement?
|
1. |
You can process the last minor total group, the last intermediate total group, the last major total group and the final information in the B-100-PROCESS after you have reached end of file. |
|
2. |
You can process the last minor total group, the last intermediate total group, the last major total group and the final information in the C-100-WRAPUP before you close files. |
|
3. |
You can process the last minor total group, the last intermediate total group, the last major total group and the final information in the major routine. |
Problem #7: Which of the following is true.
|
1. |
When checking for breaks you check for the minor break first. |
|
2. |
When checking for breaks you check for the major break first. |
|
3. |
When checking for breaks you can decide on the order. |