You are viewing a free preview of this lesson.
Subscribe to unlock all 10 lessons in this course and every other course on LearningBro.
This lesson covers structure diagrams as a method for representing decomposed problems, as required by OCR J277 Section 2.1. Structure diagrams provide a clear, visual way to show how a complex problem is broken down into smaller sub-problems.
A structure diagram (also called a hierarchy chart or top-down design diagram) is a visual representation of how a problem has been decomposed into sub-problems. It uses a tree-like structure where:
Structure diagrams are a direct visual representation of the decomposition process.
A structure diagram is read from top to bottom and (generally) from left to right:
graph TD
A["Quiz Game"] --> B["Setup"]
A --> C["Game Play"]
A --> D["End Game"]
B --> B1["Load Questions"]
B --> B2["Show Menu"]
C --> C1["Show Question"]
C --> C2["Get Input"]
C --> C3["Check Answer"]
D --> D1["Show Score"]
D --> D2["Ask Play Again"]
| Level | Content |
|---|---|
| Level 0 | The overall problem: Quiz Game |
| Level 1 | Main sub-problems: Setup, Game Play, End Game |
| Level 2 | Detailed sub-problems: Load Questions, Show Menu, etc. |
| Rule | Explanation |
|---|---|
| One box at the top | The overall problem is a single box at Level 0 |
| Each box connects to its parent | Lines show which sub-problems belong to which parent |
| Read top to bottom | Each level represents increasing detail |
| Each box is a sub-problem | Boxes represent tasks, not data |
| Sufficient detail | Decompose until each box represents a single, manageable task |
graph TD
A["Library Management System"] --> B["Manage Books"]
A --> C["Manage Loans"]
A --> D["Manage Members"]
A --> E["Reports"]
B --> B1["Add Book"]
B --> B2["Edit Book"]
B --> B3["Search Book"]
C --> C1["Borrow Book"]
C --> C2["Return Book"]
D --> D1["Register Member"]
D --> D2["Edit Member"]
E --> E1["Overdue Books"]
E --> E2["Popular Books"]
E --> E3["Member History"]
| Level | Sub-Problems |
|---|---|
| Level 0 | Library Management System |
| Level 1 | Manage Books, Manage Loans, Manage Members, Reports |
| Level 2 | Add Book, Edit Book, Search Book, Borrow Book, Return Book, etc. |
Each Level 2 sub-problem is simple enough to be solved directly with an algorithm.
graph TD
A["Login System"] --> B["Get Credentials"]
A --> C["Validate"]
A --> D["Respond"]
B --> B1["Input Username"]
B --> B2["Input Password"]
C --> C1["Hash Password"]
C --> C2["Compare With Stored"]
C --> C3["Check Attempts & Lock"]
D --> D1["Grant Access"]
D --> D2["Deny Access"]
| Representation | Shows | Best For |
|---|---|---|
| Structure diagram | How a problem is decomposed into sub-problems | Planning the overall structure of a solution |
| Flowchart | The step-by-step flow of an algorithm | Showing the logic and decision points in an algorithm |
| Pseudocode | The detailed logic of an algorithm in code-like text | Writing out the specific instructions for a solution |
Structure diagrams are used at the planning stage — before you write flowcharts or pseudocode. They help you understand the overall shape of the problem.
OCR Exam Tip: In the exam, you may be given a partially completed structure diagram and asked to fill in the missing boxes. Read the existing boxes carefully to understand the pattern and level of detail, then add boxes at the same level of detail. You may also be asked to create a structure diagram from a given scenario — start by identifying the main sub-problems (Level 1) before adding detail (Level 2).
| Benefit | Explanation |
|---|---|
| Visual clarity | Easy to see the overall structure at a glance |
| Shows decomposition | Clearly demonstrates how a problem is broken into parts |
| Identifies sub-programs | Each low-level box can become a function or procedure |
| Supports teamwork | Different team members can be assigned different branches |
| Planning tool | Helps plan before coding — reduces errors and rework |
"The structure diagram below shows part of a school timetable system. Complete the missing boxes."
Approach: Look at the existing boxes, identify what is missing logically, and add boxes at the appropriate level with clear, specific labels.
"Draw a structure diagram for a system that manages a sports day event."
Approach:
"Explain how a structure diagram is used in the development of a computer system."
Approach: Explain that it visually represents decomposition, shows sub-problems at different levels of detail, helps plan before coding, and allows tasks to be assigned to team members.
Structure diagrams visually represent how a problem has been decomposed into sub-problems using a hierarchical tree structure. They are created by identifying the main problem, decomposing it into sub-problems, and continuing until each sub-problem is simple enough to solve. For the OCR J277 exam, practise creating, completing, and interpreting structure diagrams for different scenarios.
A local secondary school wants to build an app so students can pre-order their lunch in the morning. The kitchen uses the orders to know how much to prepare, parents can top up their child's balance online, and teachers can see who has not paid.
Step 1 — Write down the overall problem. "Canteen Ordering App" goes at Level 0.
Step 2 — Identify the Level 1 sub-problems. Ask: what broad areas must the app cover?
Step 3 — Decompose each Level 1 sub-problem.
Subscribe to continue reading
Get full access to this lesson and all 10 lessons in this course.