Introduction to Diagrammatic Stepwise Refinement DIAGRAMMATIC STEPWISE REFINEMENT

  • Slides: 49
Download presentation
Introduction to Diagrammatic Stepwise Refinement

Introduction to Diagrammatic Stepwise Refinement

DIAGRAMMATIC STEPWISE REFINEMENT (DSR). an approach to program design based on u The Program

DIAGRAMMATIC STEPWISE REFINEMENT (DSR). an approach to program design based on u The Program Structure Diagrams used in the Jackson Method (JSP) u Wirth's Stepwise Refinement approach to program design.

Steps in the DSR approach 1. Define the problem completely. 2. Work out what

Steps in the DSR approach 1. Define the problem completely. 2. Work out what needs to be done to solve the problem. 3. Using Stepwise Refinement, design a Program Structure Diagram (PSD) to represent your solution to the problem. 4. Write out the Executable Operations needed to produce the output from the input. 5. Assign the Executable Operations to the appropriate places in the PSD. 6. Insert the Iteration and Selection conditions. 7. Test your solution using test data. 8. Translate the populated PSD into code.

Stepwise Refinement Is an approach to program design which involves breaking a task into

Stepwise Refinement Is an approach to program design which involves breaking a task into sub-tasks. Each sub-task is in turn broken into further sub-tasks. This process continues until the sub-tasks are so simple that their implementation is straight forward.

Program Structure Diagrams (PSDs) are used to represent the hierarchy of tasks and sub-tasks

Program Structure Diagrams (PSDs) are used to represent the hierarchy of tasks and sub-tasks created by Stepwise Refinement. They are drawn using the three classic constructs of Structured Programming. u Sequence u Selection u Iteration

Sequence PSD PRINT REPORT HEADINGS PRINT REPORT BODY PRINT REPORT FOOTING

Sequence PSD PRINT REPORT HEADINGS PRINT REPORT BODY PRINT REPORT FOOTING

Selection PSD COUNT STUDENT o ADD TO MALES ADD TO FEMALES

Selection PSD COUNT STUDENT o ADD TO MALES ADD TO FEMALES

Selection with Null part COUNT STUDENT o ADD TO LM 51 COUNT ADD TO

Selection with Null part COUNT STUDENT o ADD TO LM 51 COUNT ADD TO LM 60 COUNT

Iteration PSD PROCESS ACCOUNTS * PROCESS ACCOUNT

Iteration PSD PROCESS ACCOUNTS * PROCESS ACCOUNT

Iteration PSD - Explicit Repeat Loop PROCESS ACCOUNTS PROCESS FIRST ACCOUNT PROCESS REMAINING ACCOUNTS

Iteration PSD - Explicit Repeat Loop PROCESS ACCOUNTS PROCESS FIRST ACCOUNT PROCESS REMAINING ACCOUNTS * PROCESS ACCOUNT

Iteration PSD PRINT COUNTRY BODY * INITIALIZE COUNTY TOTALS PROCESS COUNTY RECORD PRINT COUNTY

Iteration PSD PRINT COUNTRY BODY * INITIALIZE COUNTY TOTALS PROCESS COUNTY RECORD PRINT COUNTY TOTALS Print-Country-Body is an iteration of three components. This is equivalent to ; an iteration of one component which is in turn a sequence of three.

Iteration PSD PRINT COUNTRY BODY * PRINT COUNTY REPORT INITIALIZE COUNTY TOTALS PROCESS COUNTY

Iteration PSD PRINT COUNTRY BODY * PRINT COUNTY REPORT INITIALIZE COUNTY TOTALS PROCESS COUNTY RECORD PRINT COUNTY TOTALS

Payroll Proof Totals Program Specification Write a program to produce proof totals for a

Payroll Proof Totals Program Specification Write a program to produce proof totals for a weekly payroll. The payroll file consists of records with the following format: COL 1 COLS 2 -6 COLS 7 -11 Record-Type PIC 9. 1 = Regular 2 = Overtime 3 = Bonus Employee-Number PIC 9(5). Earnings PIC 9(3)V 99. (in pounds and pence) The print layout should be as follows: PAYROLL PROOF TOTALS Regular Earnings : 25 $2, 111. 23 Overtime Earnings : 2 $21. 50 Bonus Earnings : 6 $123. 45

Applying DSR to the Payroll Proof Totals Program 1. Define the problem completely 2.

Applying DSR to the Payroll Proof Totals Program 1. Define the problem completely 2. Work out what needs to be done to solve the problem. 3. Using Stepwise Refinement design a Program Structure Diagram (PSD) to represent your solution to the problem.

Print Proof Totals Report

Print Proof Totals Report

Print Proof Totals Report Process Payroll Records Print Proof Totals

Print Proof Totals Report Process Payroll Records Print Proof Totals

Print Proof Totals Report Process Payroll Records * Process A Payroll Record Print Proof

Print Proof Totals Report Process Payroll Records * Process A Payroll Record Print Proof Totals

Print Proof Totals Report Process Payroll Records Print Proof Totals * Process A Payroll

Print Proof Totals Report Process Payroll Records Print Proof Totals * Process A Payroll Record o Add To Regular Add To Overtime Add To Bonus

Print Proof Totals Report Process Payroll Records Print Proof Totals * Process A Payroll

Print Proof Totals Report Process Payroll Records Print Proof Totals * Process A Payroll Record Print Report Headings o Add To Regular Add To Overtime Add To Bonus Print Regular Totals Print Overtime Totals Print Bonus Totals

4. Write out the Executable Operations needed to produce the output from the input.

4. Write out the Executable Operations needed to produce the output from the input. 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. OPEN OUTPUT Print-File. CLOSE Print-File. WRITE Print-Line FROM Heading-Line AFTER ADVANCING PAGE. WRITE Print-Line FROM Regular-Line AFTER ADVANCING 1 LINE. WRITE Print-Line FROM Overtime-Line AFTER ADVANCING 1 LINE. WRITE Print-Line FROM Bonus-Line AFTER ADVANCING 1 LINE. MOVE Regular-Total TO Print-Reg-Total. MOVE Overtime-Total TO Print-Overtime-Total. MOVE Bonus-Total TO Print-Bonus-Total. MOVE Regular-Count TO Print-Reg-Count. MOVE Overtime-Count TO Print-Over-Count. MOVE Bonus-Count TO Print-Bonus-Count. ADD Earnings TO Regular-Total. ADD Earnings TO Overtime-Total. ADD Earnings TO Bonus-Total. ADD 1 TO Regular-Count. ADD 1 TO Overtime-Count. ADD 1 TO Bonus-Count. READ Payroll-File AT END SET End-of-File TO TRUE END-READ. OPEN INPUT Payroll-File. CLOSE Payroll-File.

5. Assign the Executable Operations to the appropriate places in the PSD. Algorithm For

5. Assign the Executable Operations to the appropriate places in the PSD. Algorithm For all Executable Operations. l Get an Executable Operation. l Ask "To what component/components must I attach this operation to get the program to work? ". l If there already operations attached to a target component then a further question must be asked ; "Where, in relation to the existing operations, does this operation go? ".

Print Proof Totals Report Process Payroll Records Print Proof Totals * Process A Payroll

Print Proof Totals Report Process Payroll Records Print Proof Totals * Process A Payroll Record Print Report Headings Print Regular Totals Print Overtime Totals o Add To Regular Add To Overtime Add To Bonus 1. OPEN OUTPUT Print-File. 2. CLOSE Print-File. Print Bonus Totals

Print Proof Totals Report 1 Process Payroll Records Print Proof Totals 2 Print Regular

Print Proof Totals Report 1 Process Payroll Records Print Proof Totals 2 Print Regular Totals Print Overtime Totals * Process A Payroll Record Print Report Headings Print Bonus Totals o Add To Regular Add To Overtime Add To Bonus 1. OPEN OUTPUT Print-File. 2. CLOSE Print-File. 3. WRITE Print-Line FROM Heading-Line. . . 4. WRITE Print-Line FROM Regular-Line. . . 5. WRITE Print-Line FROM Overtime-Line. . . 6. WRITE Print-Line FROM Bonus-Line. . .

Print Proof Totals Report 1 Process Payroll Records Print Proof Totals 2 * Process

Print Proof Totals Report 1 Process Payroll Records Print Proof Totals 2 * Process A Payroll Record Print Report Headings Print Regular Totals Print Overtime Totals Print Bonus Totals 3 4 5 6 o Add To Regular Add To Overtime Add To Bonus 3. 4. 5. 6. 7. 8. 9. WRITE Print-Line FROM Heading-Line. . . WRITE Print-Line FROM Regular-Line. . . WRITE Print-Line FROM Overtime-Line. . . WRITE Print-Line FROM Bonus-Line. . . MOVE Regular-Total TO Print-Reg-Total. MOVE Overtime-Total TO Print-Overtime-Total. MOVE Bonus-Total TO Print-Bonus-Total.

Print Proof Totals Report 1 Process Payroll Records Print Proof Totals 2 * Process

Print Proof Totals Report 1 Process Payroll Records Print Proof Totals 2 * Process A Payroll Record Print Report Headings Print Regular Totals Print Overtime Totals Print Bonus Totals 3 7, 4 8, 5 9, 6 o Add To Regular Add To Overtime Add To Bonus 7. 8. 9. 10. 11. 12. MOVE Regular-Total TO Print-Reg-Total. MOVE Overtime-Total TO Print-Overtime-Total. MOVE Bonus-Total TO Print-Bonus-Total. MOVE Regular-Count TO Print-Reg-Count. MOVE Overtime-Count TO Print-Over-Count. MOVE Bonus-Count TO Print-Bonus-Count.

Print Proof Totals Report 1 Process Payroll Records Print Proof Totals 2 * Process

Print Proof Totals Report 1 Process Payroll Records Print Proof Totals 2 * Process A Payroll Record Print Report Headings Print Regular Totals Print Overtime Totals Print Bonus Totals 3 7, 10, 4 10 11, 8, 5 11 12, 9, 6 12 o Add To Regular Add To Overtime Add To Bonus 10. 11. 12. 13. 14. 15. 16. 17. 18. MOVE Regular-Count TO Print-Reg-Count. MOVE Overtime-Count TO Print-Over-Count. MOVE Bonus-Count TO Print-Bonus-Count. ADD Earnings TO Regular-Total. ADD Earnings TO Overtime-Total. ADD Earnings TO Bonus-Total. ADD 1 TO Regular-Count. ADD 1 TO Overtime-Count. ADD 1 TO Bonus-Count.

Print Proof Totals Report 1 Process Payroll Records Print Proof Totals 2 * Process

Print Proof Totals Report 1 Process Payroll Records Print Proof Totals 2 * Process A Payroll Record Print Report Headings Print Regular Totals Print Overtime Totals Print Bonus Totals 3 7, 10, 4 11, 8, 5 12, 9, 6 o Add To Regular 13, 16 Add To Overtime Add To Bonus 14, 17 15, 18 13. 14. 15. 16. 17. 18. 19. ADD Earnings TO Regular-Total. ADD Earnings TO Overtime-Total. ADD Earnings TO Bonus-Total. ADD 1 TO Regular-Count. ADD 1 TO Overtime-Count. ADD 1 TO Bonus-Count. READ Payroll-File AT END SET End-of-File TO TRUE END-READ.

Print Proof Totals Report 1, 19 Process Payroll Records Print Proof Totals 2 *

Print Proof Totals Report 1, 19 Process Payroll Records Print Proof Totals 2 * Process A Payroll Record Print Report Headings Print Regular Totals Print Overtime Totals Print Bonus Totals 3 7, 10, 4 11, 8, 5 12, 9, 6 o Add To Regular 13, 16 Add To Overtime Add To Bonus 14, 17 15, 18 19. READ Payroll-File AT END SET End-of-File TO TRUE END-READ.

Print Proof Totals Report 1, 19 Process Payroll Records Print Proof Totals 2 *

Print Proof Totals Report 1, 19 Process Payroll Records Print Proof Totals 2 * Process A Payroll Record 19 Print Report Headings Print Regular Totals Print Overtime Totals Print Bonus Totals 3 7, 10, 4 11, 8, 5 12, 9, 6 o Add To Regular 13, 16 Add To Overtime Add To Bonus 14, 17 15, 18 19. READ Payroll-File AT END SET End-of-File TO TRUE END-READ. 20. OPEN INPUT Payroll-File. 21. CLOSE Payroll-File.

Print Proof Totals Report 1, 20, 19 20 Process Payroll Records Print Proof Totals

Print Proof Totals Report 1, 20, 19 20 Process Payroll Records Print Proof Totals 2, 21 * Process A Payroll Record 19 Print Report Headings Print Regular Totals Print Overtime Totals Print Bonus Totals 3 7, 10, 4 11, 8, 5 12, 9, 6 o Add To Regular 13, 16 Add To Overtime Add To Bonus 14, 17 15, 18 20. OPEN INPUT Payroll-File. 21. CLOSE Payroll-File.

6. Insert the Iteration and Selection conditions. u Go to each iteration component and

6. Insert the Iteration and Selection conditions. u Go to each iteration component and ask; "What iteration statement must I use here to get the program to work correctly? ". Write the Iteration statement, give it a number and insert its number into the diagram. u Go to each selection component and ask; " What selection statement must I use here to get the program to work correctly? ". Write the Selection statement, give it a number and insert its number into the diagram.

Print Proof Totals Report 1, 20, 19 Process Payroll Records * Print Proof Totals

Print Proof Totals Report 1, 20, 19 Process Payroll Records * Print Proof Totals 2, 21 1 Process A Payroll Record 19 Print Report Headings Print Regular Totals Print Overtime Totals Print Bonus Totals 3 7, 10, 4 11, 8, 5 12, 9, 6 o Add To Regular 13, 16 Add To Overtime Add To Bonus 14, 17 15, 18 1. PERFORM Process-Payroll-Records UNTIL End-of-File.

Using IF. . . ELSE Print Proof Totals Report 1, 20, 19 Process Payroll

Using IF. . . ELSE Print Proof Totals Report 1, 20, 19 Process Payroll Records * Print Proof Totals 2, 21 1 Process A Payroll Record 19 Print Report Headings Print Regular Totals Print Overtime Totals Print Bonus Totals 3 7, 10, 4 11, 8, 5 12, 9, 6 o 2 Add To Regular 13, 16 Add To Overtime Add To Bonus 14, 17 15, 18 1. PERFORM Process-Payroll-Records UNTIL End-of-File. 2. IF Regular-Rec PERFORM Add-to-Regular ELSE IF Overtime-Rec PERFORM Add-to-Overtime ELSE PERFORM Add-to-Bonus END-IF.

Using the Evaluate Print Proof Totals Report 1, 20, 19 Process Payroll Records *

Using the Evaluate Print Proof Totals Report 1, 20, 19 Process Payroll Records * Print Proof Totals 2, 21 1 Process A Payroll Record 19 Print Report Headings Print Regular Totals Print Overtime Totals Print Bonus Totals 3 7, 10, 4 11, 8, 5 12, 9, 6 o 2 Add To Regular 13, 16 Add To Overtime Add To Bonus 14, 17 15, 18 1. PERFORM Process-Payroll-Records UNTIL End-of-File. 2. EVALUATE TRUE WHEN Regular-Rec PERFORM Add-to-Regular WHEN Overtime-Rec PERFORM Add-to-Overtime WHEN Bonus-Rec PERFORM Add-to-Bonus END-EVALUATE.

7. Test the program using test data. Type Emp-No Earnings 1 1234 050. 25

7. Test the program using test data. Type Emp-No Earnings 1 1234 050. 25 2 1234 025. 50 1 2345 120. 25 3 1234 010. 50 Print Proof Totals Report 1, 20, 19 Process Payroll Records * 2, 21 Print Proof Totals 1 Process A Payroll Record 19 Print Report Headings Print Regular Totals Print Overtime Totals Print Bonus Totals 3 7, 10, 4 11, 8, 5 12, 9, 6 o 2 Add To Regular 13, 16 Add To Overtime 14, 17 Add To Bonus 15, 18 Employee-Rec Type Emp-No Earnings 1 1234 050. 25 000. 00 000 000

7. Test the program using test data. Type Emp-No Earnings 1 1234 050. 25

7. Test the program using test data. Type Emp-No Earnings 1 1234 050. 25 2 1234 025. 50 1 2345 120. 25 3 1234 010. 50 Print Proof Totals Report 1, 20, 19 Process Payroll Records * 2, 21 Print Proof Totals 1 Process A Payroll Record 19 Print Report Headings Print Regular Totals Print Overtime Totals Print Bonus Totals 3 7, 10, 4 11, 8, 5 12, 9, 6 o 2 Add To Regular 13, 16 Add To Overtime 14, 17 Add To Bonus 15, 18 Employee-Rec Type Emp-No Earnings 1 1234 050. 25 001 000. 00 000

7. Test the program using test data. Type Emp-No Earnings 1 1234 050. 25

7. Test the program using test data. Type Emp-No Earnings 1 1234 050. 25 2 1234 025. 50 1 2345 120. 25 3 1234 010. 50 Print Proof Totals Report 1, 20, 19 Process Payroll Records * 2, 21 Print Proof Totals 1 Process A Payroll Record 19 Print Report Headings Print Regular Totals Print Overtime Totals Print Bonus Totals 3 7, 10, 4 11, 8, 5 12, 9, 6 o 2 Add To Regular 13, 16 Add To Overtime 14, 17 Add To Bonus 15, 18 050. 25 001 Employee-Rec Type Emp-No Earnings 000. 00 000 2 000. 00 000 1234 025. 50

7. Test the program using test data. Type Emp-No Earnings 1 1234 050. 25

7. Test the program using test data. Type Emp-No Earnings 1 1234 050. 25 2 1234 025. 50 1 2345 120. 25 3 1234 010. 50 Print Proof Totals Report 1, 20, 19 Process Payroll Records * 2, 21 Print Proof Totals 1 Process A Payroll Record 19 Print Report Headings Print Regular Totals Print Overtime Totals Print Bonus Totals 3 7, 10, 4 11, 8, 5 12, 9, 6 o 2 Add To Regular 13, 16 Add To Overtime 14, 17 Add To Bonus 15, 18 050. 25 001 Employee-Rec Type Emp-No Earnings 025. 50 001 2 000. 00 000 1234 025. 50

7. Test the program using test data. Type Emp-No Earnings 1 1234 050. 25

7. Test the program using test data. Type Emp-No Earnings 1 1234 050. 25 2 1234 025. 50 1 2345 120. 25 3 1234 010. 50 Print Proof Totals Report 1, 20, 19 Process Payroll Records * 2, 21 Print Proof Totals 1 Process A Payroll Record 19 Print Report Headings Print Regular Totals Print Overtime Totals Print Bonus Totals 3 7, 10, 4 11, 8, 5 12, 9, 6 o 2 Add To Regular 13, 16 Add To Overtime 14, 17 Add To Bonus 15, 18 Employee-Rec Type Emp-No Earnings 1 2345 120. 25 050. 25 001 025. 50 001 000. 00 000

7. Test the program using test data. Type Emp-No Earnings 1 1234 050. 25

7. Test the program using test data. Type Emp-No Earnings 1 1234 050. 25 2 1234 025. 50 1 2345 120. 25 3 1234 010. 50 Print Proof Totals Report 1, 20, 19 Process Payroll Records * 2, 21 Print Proof Totals 1 Process A Payroll Record 19 Print Report Headings Print Regular Totals Print Overtime Totals Print Bonus Totals 3 7, 10, 4 11, 8, 5 12, 9, 6 o 2 Add To Regular 13, 16 Add To Overtime 14, 17 Add To Bonus 15, 18 Employee-Rec Type Emp-No Earnings 1 2345 120. 25 170. 50 002 025. 50 001 000. 00 000

7. Test the program using test data. Type Emp-No Earnings 1 1234 050. 25

7. Test the program using test data. Type Emp-No Earnings 1 1234 050. 25 2 1234 025. 50 1 2345 120. 25 3 1234 010. 50 Print Proof Totals Report 1, 20, 19 Process Payroll Records * 2, 21 Print Proof Totals 1 Process A Payroll Record 19 Print Report Headings Print Regular Totals Print Overtime Totals Print Bonus Totals 3 7, 10, 4 11, 8, 5 12, 9, 6 o 2 Add To Regular 13, 16 Add To Overtime 14, 17 Add To Bonus 15, 18 Employee-Rec Type Emp-No Earnings 3 1234 010. 50 170. 50 002 025. 50 001 000. 00 000

7. Test the program using test data. Type Emp-No Earnings 1 1234 050. 25

7. Test the program using test data. Type Emp-No Earnings 1 1234 050. 25 2 1234 025. 50 1 2345 120. 25 3 1234 010. 50 Print Proof Totals Report 1, 20, 19 Process Payroll Records * 2, 21 Print Proof Totals 1 Process A Payroll Record 19 Print Report Headings Print Regular Totals Print Overtime Totals Print Bonus Totals 3 7, 10, 4 11, 8, 5 12, 9, 6 o 2 Add To Regular 13, 16 Add To Overtime 14, 17 Add To Bonus 15, 18 Employee-Rec Type Emp-No Earnings 3 1234 010. 50 170. 50 002 025. 50 001 010. 50 001

7. Test the program using test data. Type Emp-No Earnings 1 1234 050. 25

7. Test the program using test data. Type Emp-No Earnings 1 1234 050. 25 2 1234 025. 50 1 2345 120. 25 3 1234 010. 50 Print Proof Totals Report 1, 20, 19 Process Payroll Records * Print Proof Totals 2, 21 1 Process A Payroll Record 19 Print Report Headings Print Regular Totals Print Overtime Totals Print Bonus Totals 3 7, 10, 4 11, 8, 5 12, 9, 6 o 2 Add To Regular 13, 16 Add To Overtime 14, 17 Add To Bonus 15, 18 170. 50 002 Employee-Rec Type Emp-No Earnings 025. 50 001 HIGH-VALUES 010. 50 001

7. Test the program using test data. Type Emp-No Earnings 1 1234 050. 25

7. Test the program using test data. Type Emp-No Earnings 1 1234 050. 25 2 1234 025. 50 1 2345 120. 25 3 1234 010. 50 Print Proof Totals Report 1, 20, 19 Process Payroll Records * Print Proof Totals 2, 21 1 Process A Payroll Record 19 Print Report Headings Print Regular Totals Print Overtime Totals Print Bonus Totals 3 7, 10, 4 11, 8, 5 12, 9, 6 o 2 Add To Regular 13, 16 Add To Overtime 14, 17 Add To Bonus 15, 18 170. 50 002 Employee-Rec Type Emp-No Earnings 025. 50 001 HIGH-VALUES 010. 50 001

7. Test the program using test data. Type Emp-No Earnings 1 1234 050. 25

7. Test the program using test data. Type Emp-No Earnings 1 1234 050. 25 2 1234 025. 50 1 2345 120. 25 3 1234 010. 50 Print Proof Totals Report 1, 20, 19 Process Payroll Records * Print Proof Totals 2, 21 1 Process A Payroll Record 19 Print Report Headings Print Regular Totals Print Overtime Totals Print Bonus Totals 3 7, 10, 4 11, 8, 5 12, 9, 6 o 2 Add To Regular 13, 16 Add To Overtime 14, 17 Add To Bonus 15, 18 170. 50 002 Employee-Rec Type Emp-No Earnings 025. 50 001 HIGH-VALUES 010. 50 001

8. Translate the populated PSD into COBOL code u Start at the top of

8. Translate the populated PSD into COBOL code u Start at the top of the diagram. u At each parent component write the sequence of executable operations, child components and iteration and selection conditions as statements in a paragraph. u Replace child components with PERFORMs of the component name. u At the top component, use the name as the name of the first paragraph and preceed it with the PROCEDURE DIVISION header. End the sequence with the STOP RUN statement.

Print Proof Totals Report 1, 20, 19 Process Payroll Records * Print Proof Totals

Print Proof Totals Report 1, 20, 19 Process Payroll Records * Print Proof Totals 2, 21 1 Process A Payroll Record 19 Print Report Headings Print Regular Totals Print Overtime Totals Print Bonus Totals 3 7, 10, 4 11, 8, 5 12, 9, 6 o 2 Add To Regular 13, 16 Add To Overtime Add To Bonus 14, 17 15, 18

Print Proof Totals Report 1, 20, 19 Process Payroll Records * Print Proof Totals

Print Proof Totals Report 1, 20, 19 Process Payroll Records * Print Proof Totals 2, 21 1 Process A Payroll Record 19 Print Report Headings Print Regular Totals Print Overtime Totals Print Bonus Totals 3 7, 10, 4 11, 8, 5 12, 9, 6 o 2 Add To Regular 13, 16 Add To Overtime Add To Bonus 14, 17 15, 18 PROCEDURE DIVISION. Print-Proof-Totals-Report. OPEN INPUT Payroll-File. OPEN Output Print-File. Read Payroll-File. . PERFORM Process-Payroll-Records UNTIL End-Of-File. PERFORM Print-Proof-Totals. CLOSE Print-File. CLOSE Payroll-File. STOP RUN.

Print Proof Totals Report 1, 20, 19 Process Payroll Records * Print Proof Totals

Print Proof Totals Report 1, 20, 19 Process Payroll Records * Print Proof Totals 2, 21 1 Process A Payroll Record 19 Print Report Headings Print Regular Totals Print Overtime Totals Print Bonus Totals 3 7, 10, 4 11, 8, 5 12, 9, 6 o 2 Add To Regular 13, 16 Add To Overtime Add To Bonus 14, 17 15, 18 Process-Payroll-Records. EVALUATE TRUE WHEN Regular-Rec PERFORM Add-to-Regular WHEN Overtime-Rec PERFORM Add-to-Overtime WHEN Bonus-Rec PERFORM Add-to-Bonus END-EVALUATE. READ Payroll-File AT END SET End-Of-File TO TRUE END-READ.