Presentation is loading. Please wait.

Presentation is loading. Please wait.

Figure 3.4The Building Blocks of Structured Programming A B (a) Sequence BA CONDITION? (b) Selection : ENTRYEXIT A B N (d) Case CONDITION? A (c) Iteration.

Similar presentations


Presentation on theme: "Figure 3.4The Building Blocks of Structured Programming A B (a) Sequence BA CONDITION? (b) Selection : ENTRYEXIT A B N (d) Case CONDITION? A (c) Iteration."— Presentation transcript:

1 Figure 3.4The Building Blocks of Structured Programming A B (a) Sequence BA CONDITION? (b) Selection : ENTRYEXIT A B N (d) Case CONDITION? A (c) Iteration FALSE TRUE

2 Figure 3.5 Sufficiency of the Basic Structures CONDITION? A B CONDITION 2 ? C TRUE FALSE

3 Statement A Statement B IF condition is true Statement A ELSE Statement B ENDIF DO WHILE condition is true Statement A ENDDO DO CASE Case 1 is true Statement A Case 2 is true Statement B... ENDCASE (a) The Sequence Structure (b) The Selection Structure (c) The Iteration Structure (d) The Case Structure Figure 3.7Pseudocode for Building Blocks

4 Figure 4.3Student Exam Record STUDENT-EXAM-RECORD STUDENT-NAMEEXAM-SCORESSS-NUM LAST NAME FIRST NAME INIT MATHENGLISH ALGGEOREADVOCLIT ALPHANUMERICNUMERIC

5 Figure 4.4Level Numbers and PICTURE Clauses 01 STUDENT-EXAM-RECORD. 05 STUDENT-NAME. 10 LAST-NAMEPICTURE IS X(15). 10 FIRST-NAMEPICTURE IS X(15). 10 MID-INITIALPICTURE IS X. 05 SOC-SEC-NUMPICTURE IS 9(9). 05 EXAM-SCORES. 10 MATH. 15 ALGEBRAPICTURE IS 9(5). 15 GEOMETRYPICTURE IS 9(5). 10 ENGLISH. 15 READINGPICTURE IS 9(5). 15 VOCABULARYPICTURE IS 9(5). 15 LITERATUREPICTURE IS 9(5). 01 STUDENT-EXAM-RECORD. 04 STUDENT-NAME. 08 LAST-NAMEPIC X(15). 08 FIRST-NAMEPIC X(15). 08 MID-INITIALPIC X. 04 SOC-SEC-NUMPIC 9(9). 04 EXAM-SCORES. 08 MATH. 12 ALGEBRAPIC GEOMETRYPIC ENGLISH. 12 READINGPIC VOCABULARYPIC LITERATUREPIC (a) Initial Coding (b) Alternative Specification

6 Figure 4.5Assumed Decimal Point INCOMING RECORDDATA DIVISION RECORD DESCRIPTION VALUES v v v 9 87|65 4|3 | INCOMING-DATA-RECORD. 05 STUDENT-NAME PIC 9V STUDENT-NAMEPIC 99V9. 05 STUDENT-NAMEPIC STUDENT-NAMEPIC V

7 Figure 4.7Development of a COBOL Program (File Section) (b) COBOL Entries FD STUDENT-FILE RECORD CONTAINS 27 CHARACTERS. 01 STUDENT-RECORD. 05 STU-NAME. 10 STU-LAST-NAME PIC X(15). 10 STU-INITIALS PIC XX. 05 STU-CREDITSPIC 9(2). 05 STU-UNION-MEMBER PIC X. 05 STU-SCHOLARSHIP PIC 9(4). 05 STU-GPAPIC 9V99. STUDENT NAME LAST GPA INITIALS CREDITSUNION MEMBER SCHOLARSHIP (a) Program Specifications

8 Figure 4.9Development of a COBOL Program (Print Lines) (a) Report Layout

9 Figure 4.9Development of a COBOL Program (Print Lines) (b) COBOL Entries 01 HEADING-LINE. 05 FILLERPIC X VALUE SPACES. 05 FILLERPIC X(12) VALUE ‘STUDENT NAME’. 05 FILLERPIC X(10) VALUE SPACES. 05 FILLERPIC X(7) VALUE ‘CREDITS’. 05 FILLERPIC X(2) VALUE SPACES. 05 FILLERPIC X(7) VALUE ‘TUITION’. 05 FILLERPIC X(2)VALUE SPACES. 05 FILLERPIC X(9)VALUE ‘UNION FEE’. 05 FILLERPIC X(2)VALUE SPACES. 05 FILLERPIC X(7)VALUE ‘ACT FEE’. 05 FILLERPIC X(2)VALUE SPACES. 05 FILLERPIC X(11)VALUE ‘SCHOLARSHIP’. 05 FILLERPIC X(2)VALUE SPACES. 05 FILLERPIC X(10)VALUE ‘TOTAL BILL’. 05 FILLERPIC X(48)VALUE SPACES. 01 DETAIL-LINE. 05 FILLERPIC X VALUE SPACES. 05 DET-LAST-NAMEPIC X(15). 05 FILLERPIC X(2) VALUE SPACES. 05 DET-INITIALSPIC X(2). 05 FILLERPIC X(5) VALUE SPACES. 05 DET-CREDITSPIC 9(2). 05 FILLERPIC X(2)VALUE SPACES. 05 DET-TUITIONPIC 9(6). 05 FILLERPIC X(7)VALUE SPACES. 05 DET-UNION-FEEPIC 9(3). 05 FILLERPIC X(8)VALUE SPACES. 05 DET-SCHOLARSHIPPIC 9(5). 05 FILLERPIC X(6)VALUE SPACES. 05 DET-IND-BILLPIC 9(6). 05 FILLERPIC X(49)VALUE SPACES.


Download ppt "Figure 3.4The Building Blocks of Structured Programming A B (a) Sequence BA CONDITION? (b) Selection : ENTRYEXIT A B N (d) Case CONDITION? A (c) Iteration."

Similar presentations


Ads by Google