ðH geocities.com /csit101/Lecture13/Page4.html geocities.com/csit101/Lecture13/Page4.html elayed x –ŽÕJ ÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÈ Àç‹ Œ OK text/html pa'9n Œ ÿÿÿÿ b‰.H Mon, 29 Nov 1999 00:37:33 GMT e Mozilla/4.5 (compatible; HTTrack 3.0x; Windows 98) en, * –ŽÕJ Œ
Step 2 - Program Design
After completion of program specification, it is time to begin program design.
In the program design step, you plan a solution to the problem.
There are two tasks in step 2, program design:
Plan the solution
Document the solution
The preliminary plan (solution) is laid out using one of the structured programming techniques.
There are four structured programming techniques that can be used to develop a program:
Top-Down Program Design
Box-like program modules are used to identify each of the program's processing steps.
The logic of the modules must flow from top to the bottom on the structure.
The program must pass in sequence from one module to the next until the computer has processed all modules.
Larger problem (top module) is broken down into smaller problems (lower modules). Each module represents a segment of program code (logically related program statements).
Example:
Pseudocode (fake code)
An outline of the logic of the program you will write.
It can contain any form of statements:
Can contain English-like statements.
Can contain statements which include program language code.
Takes the form of an algorithm.
Example:
Flowcharts (program flowcharts)
Graphically represents the detailed sequence of steps needed to solve the problem.
It uses standard flowcharting symbols.
Example:
Logic structures
Used to complete the logic of the program flow.
Uses a combination of three structures:
Sequence Structure - One program statement follows another.
Selection Structure - Follows a path when a decision is made - IF ELSE
Loop Structure - Repeated processes. Also known as iteration.
Uses DO UNTIL or DO WHILE variations for the loop structure.
Before leaving the program design step, you must document the logic of the design.
The report should include pseudocode, flowcharts, and logic structures.
When documentation is complete, then you can proceed to step 3, coding the program.