JACKSON Structured Programming It was developed by Michael
JACKSON Structured Programming
► It was developed by Michael Jackson – it is a systematic technique for mapping the structure of a problem into program structure
The mapping is accomplished in 3 steps § Specifying input and output data structures using tree structured diagrams § Identify the correspondence between nodes in the output and input trees § The structural model of the program is expanded into a detailed design model that contains the operations needed to solve the problem
► Input and output structure are specified using a graphical notation to specify data hierarchy Sequences of data Repetition of data items alternate data items
First Step : Tree Structure A B C D E G F H I
Second Step ► Identify the points of commonality in the input and output structure and combining the two structures into a program structure
Third Step It has 3 sub steps 1) A list of operations required to perform the processing steps is developed 2) The operations are associated with the program structure 3) Program structure and operations are expressed in a notation called schematic logic, which is stylized pseudo code. Control flow for selection and iteration are specified in this step.
Example ► Input file – collection of inventory records sorted by part number Part number – each record contains it (field). It’s the number of units of that item issued or received in one transaction ► Output record - contains heading and Net movement line for each part number in the input file ► ► Because the input file is sorted by part number, all issues and receipts of a given part number are in a contiguous portion of the file called a part group. ► Each record in the part group is called a movement record.
Step 1: Tree Structure (i/o struct) Input file Output Record Part Group Heading Body Movement Record Net Movement Line Issue Receipt
Step 2: Correspondence Input file Output Record Part Group Heading Body Movement Record Net Movement Line Issue Receipt
After corresponding the resultant structure will be as follows: It’s a program structure for an inventory problem program Process heading Process Body Process PTGP and Line Process PTGP body Process Record Process issue Process Receipt Process Line
Step 3 : Sub Step 1 List of Operations needed in the inventory program 1. Open Files 2. Close Files 3. Stop Run 4. Read a record into PART_NUM, MOVMNT 5. Write Heading 6. Write NET_MOVEMENT Line 7. Set Net_Movmnt to zero 8. Add Mov. Mnt to Net_Movmnt 9. Subtract movmnt from net_movment
Sub Step 2 (Association of Operations) program 1 4 Process heading 5 Process Body 2 3 Process PTGP and Line Process PTGP body 7 4 9 Process Line Process Record Process issue Process Receipt 8 6
Sub Step 3 (Schematic Logic Representation) BEGIN PROGRAM OPEN FILES READ PART_NUM, MOVMNT WRITE HEADING ITERATE WHILE NOT(END-OF-FILE) SET NET-MOVMNT TO ZERO ITERATE WHILE SAME-PART-NUM IF (MOVMNT= ISSUE) THEN SUB MOVMNT FROM NET-MOVMNT ELSE IF (MOVMNT = RECEIPT) THEN ADD MOVMNT TO NET-MOVMNT END IF READ PART-NUM, MOVMNT END WHILE WRITE NET-MOVEMENT LINE END WHILE CLOSE FILES STOP END PROGRAM
- Slides: 14