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:
Quiz Game
|
┌───────────────┼───────────────┐
| | |
Setup Game Play End Game
| | |
┌───┴───┐ ┌────┼────┐ ┌───┴───┐
| | | | | | |
Load Show Show Get Check Show Ask
Questions Menu Question Input Answer Score 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 |
Library Management System
|
┌─────────────┬──────┴──────┬─────────────┐
| | | |
Manage Books Manage Loans Manage Members Reports
| | | |
┌───┼───┐ ┌────┼────┐ ┌───┼───┐ ┌───┼───┐
| | | | | | | | | | | |
Add Edit Search Borrow Return Register Edit Overdue Popular Member
Book Book Book Book Book Member Member Books Books 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.
Subscribe to continue reading
Get full access to this lesson and all 10 lessons in this course.