Use a structure chart to decompose a problem into sub‑tasks and to specify the parameters passed between the modules, procedures or functions that form part of the algorithm design.
| Design artefact | When to use it | What it shows |
|---|---|---|
| Structure chart | During analysis → design for procedural/functional solutions. | Module hierarchy and parameter flow. |
| Flowchart | When you need to detail the internal logic of a single module. | Control flow (decisions, loops, sequence) inside a module. |
| State‑transition diagram | For event‑driven or reactive systems (e.g., GUIs, vending machines). | System states, events and transitions. |
main or a descriptive name such as ProcessLoan.studentMarks, totalScore).| Type | Description | Typical use |
|---|---|---|
| Input | Values supplied to a module; read‑only inside the module. | Marks, weights, IDs, search strings. |
| Output | Values returned to the caller; not modified by the caller. | Calculated score, grade letter, boolean result. |
| In‑out | Values that are both read and modified by the module. | Running totals, counters, data structures that must be updated. |
studentID, weightedScore).marksArray).inMarks, outGrade.Calculate the final grade for each student in a class.
Each student has marks for three assessments with different weights.
The final grade is the weighted sum, rounded to the nearest integer, and then classified as A, B, C, D or F.
| Module | Purpose | Input parameters | Output / In‑out parameters |
|---|---|---|---|
Main | Coordinates overall processing. | – | – |
ReadData | Read number of students and their three assessment marks. | – | studentsMarks[][3] (array), numStudents (int) – output |
ProcessStudent | Handles the complete calculation for one student. | marks[3] | grade (char) – output |
ComputeWeightedSum | Calculate S = w₁·m₁ + w₂·m₂ + w₃·m₃. | marks[3], weights[3] | rawScore (real) – output |
RoundResult | Round the raw score to the nearest integer. | rawScore (real) | roundedScore (int) – output |
ClassifyGrade | Map the rounded score to a grade letter. | roundedScore (int) | grade (char) – output |
OutputResult | Display the student’s final grade. | studentID, grade | – |
UpdateRunningTotal (in‑out example) | Maintain a cumulative total of all rounded scores. | roundedScore (int) | totalScore (int) – in‑out |
ReadData → ProcessStudent: marks[3]ProcessStudent → ComputeWeightedSum: marks[3], weights[3]ComputeWeightedSum → RoundResult: rawScoreRoundResult → ClassifyGrade: roundedScoreClassifyGrade → OutputResult: gradeRoundResult → UpdateRunningTotal: roundedScore (in‑out modifies totalScore)Note: In an exam you would draw the chart on paper. The text description below shows the hierarchy and arrows.
Main
│
├─ ReadData
│
└─ ProcessStudent
├─ ComputeWeightedSum
├─ RoundResult
├─ ClassifyGrade
├─ UpdateRunningTotal (in‑out)
└─ OutputResult
Task: Design a structure chart for a library system that allows a user to search for a book by title, check its availability, and, if available, issue the book to the user. The system must also update the inventory and record the transaction.
ProcessLoan).SearchBookCheckAvailabilityIssueBookUpdateInventoryRecordTransaction| Module | Purpose | Input | Output / In‑out |
|---|---|---|---|
ProcessLoan | Coordinates the whole loan process. | – | – |
SearchBook | Find a book by title. | title (string) | bookID (int) – output |
CheckAvailability | Determine if the identified book is on the shelf. | bookID (int) | available (bool) – output |
IssueBook | Record that the book is loaned to a user. | bookID, userID | – |
UpdateInventory | Decrement the stock count for the book. | bookID | stockCount (int) – in‑out |
RecordTransaction | Write the loan details to the transaction log. | bookID, userID, date | – |
ProcessLoan
│
├─ SearchBook ──► bookID
│
├─ CheckAvailability ──► available
│
├─ IssueBook (bookID, userID)
│
├─ UpdateInventory (bookID) ──► stockCount (in‑out)
│
└─ RecordTransaction (bookID, userID, date)
Your generous donation helps us continue providing free Cambridge IGCSE & A-Level resources, past papers, syllabus notes, revision questions, and high-quality online tutoring to students across Kenya.