Pseudocode, flow charts and structure diagram are techniques that are used to design software. These allow data flow, constructs and variables to be identified before coding begins.
At the top of each structure diagram, it is necessary to define the general problem that is to be solved. The programmer will consider the purpose and functional requirements that were established at the analysis phase.
In this example, the information from the analysis phase is shown below to provide a context for the structure diagrams that follow.
Analysis used to inform design
Purpose:
Software should be created to allow a user to enter ten numbers.
Each number must be validated to make sure that it is no less than 0 and no more than 100.
The program should keep a running total of the numbers entered and output the final total.
Functional requirements
Inputs
Processes
Outputs
Ten numbers
Validate ten numbers
Total
Calculate total
Inputs
Ten numbers
Processes
Validate ten numbers
Outputs
Total
Inputs
Processes
Calculate total
Outputs
Design using structure diagram
This structure diagram shows one approach to creating a design that is based upon the purpose and functional requirements shown above.
The structure diagram shown below is an alternative design for the same problem. This time a selection statement is used as part of the solution.