Learning Objectives
  • Explain the purpose of a structure diagram.
  • Construct a hierarchical diagram from a decomposed problem.
  • Interpret the relationship between a system, modules and sub-modules.
  • Distinguish a structure diagram from a flowchart.
Key Terms
Structure diagram
A hierarchical design representation showing how a problem or system is divided into modules and sub-modules.
Root
The top element representing the complete system or problem.
Parent module
A module that is divided into lower-level child modules.
Child module
A lower-level component belonging to a parent module.
Hierarchy
The arrangement of modules in levels.
Sequence flow
The order in which individual algorithm steps execute; this is normally represented in a flowchart, not a structure diagram.
Summary diagram
Summary Of The Main Ideas In This Lesson
Purpose Of A Structure Diagram

A structure diagram represents decomposition. It shows the whole problem at the top and component parts underneath. It is useful for seeing the organisation of a solution before the detailed steps inside each component are designed.

The diagram answers “What parts make up this system?” It does not normally show the precise execution order, loop conditions or decision paths. Those details are better represented by a flowchart or pseudocode.

Constructing The Diagram

Begin with one box for the complete system. Draw branches to the major modules. If a module is still complex, divide it into smaller modules on a lower level.

Module names should be meaningful and should describe one responsibility. “Validate customer,” “calculate order total” and “produce receipt” are clearer than “part 1,” “processing” and “other.”

Checking The Structure

Every required operation should appear in the hierarchy, either as a module or inside a module that will be designed later. At the same time, the diagram should not include irrelevant features.

Modules at the same level should be of a reasonably similar scale. A diagram is difficult to use if one box represents the whole payment process while another represents only adding two numbers.

Structure Diagram Versus Flowchart
Feature Structure Diagram Flowchart
Main purpose Show decomposition and hierarchy Show algorithm control flow
Arrangement Whole system to modules and sub-modules Steps connected by directional arrows
Decisions and loops Usually not shown in detail Shown using decision symbols and flow lines
Best question answered What are the component parts? In what order do steps execute?
From Structure To Detailed Design

After the structure is agreed, each lower-level module can be represented with pseudocode or a flowchart. The designer should identify inputs supplied to the module and outputs returned from it.

A structure diagram therefore supports modular thinking without replacing the detailed algorithm. It is especially useful early in design, when the main concern is organising the problem.

Common Diagram Quality Checks
  • One clear root represents the entire problem.
  • Each child is genuinely part of its parent.
  • Names describe tasks or responsibilities.
  • No compulsory requirement is missing.
  • No irrelevant component has been added.
  • The level of detail is sufficient for later design but not cluttered with individual instructions.
Worked Examples
Fitness Club Membership

Question: Suggest a structure diagram for a program that records members, calculates fees and produces a membership summary.

  1. Root: Manage Fitness Club Membership.
  2. Major modules: Enter Member Details, Validate Details, Calculate Fee, Store Membership, Produce Summary.
  3. Further divide Calculate Fee into Determine Membership Type, Apply Discount and Calculate Final Fee.

Answer: The hierarchy shows the component tasks without attempting to show every decision path.

Choosing The Correct Representation

Question: A student needs to show that an invalid mark is entered again until valid. Should a structure diagram show this loop?

  1. The requirement concerns control flow and repetition.
  2. A structure diagram shows components, not detailed repetition.

Answer: Use a flowchart or pseudocode for the loop; the structure diagram may simply contain a Validate Mark module.

Examination Guidance
  • Draw a hierarchy, not a chain of sequential arrows.
  • Use labels that reflect the scenario.
  • Include sub-modules only when they clarify a complex parent task.
  • When comparing diagrams, explain that structure diagrams show decomposition while flowcharts show control flow.
  • Avoid placing detailed variable assignments inside structure-diagram boxes.
Common Mistakes
  • Drawing a flowchart and calling it a structure diagram.
  • Using vague labels such as “do task.”
  • Showing decisions as yes/no branches in a structure hierarchy.
  • Omitting the complete system at the top.
  • Including modules unrelated to the stated requirements.
Knowledge Check

1. What does a structure diagram show?

Answer: How a system or problem is decomposed into modules and sub-modules.

2. What is the top box called?

Answer: The root, representing the complete system or problem.

3. Does a structure diagram show execution order in detail?

Answer: No; a flowchart or pseudocode is used for detailed control flow.

4. What should module names describe?

Answer: A clear task or responsibility.

5. What follows after a structure diagram?

Answer: Each module can be designed in detail using flowcharts or pseudocode.