Structure diagram examples
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 to provide a context for the structure diagrams that follow.
Analysis used to inform design
Purpose:
- softwareThe programs, applications and data in a computer system. Any parts of a computer system that aren't physical. 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 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.