91热爆

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:

  • 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

InputsProcessesOutputs
Ten numbersValidate ten numbersTotal
Calculate total
InputsTen numbers
ProcessesValidate ten numbers
OutputsTotal
Inputs
ProcessesCalculate 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.

Structure diagran

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.

N5 Computing Science structure diagram 2

Related links