# System Decomposition & Structure Charts

- **Track:** Cambridge IGCSE™ Computer Science (0478 / 0984) (CAMBRIDGE IGCSE 0478)
- **Module:** Section 7: Algorithm Design & Problem-Solving
- **Estimated Duration:** 15 minutes
- **Access:** Open Theory (All-Access for Interactive IDE &amp; Autotests)

---

## Theory & Conceptual Background

Decomposition breaks a complex task into smaller tasks. This helps people understand, develop, test and maintain the system. Tasks still need compatible inputs and outputs when brought together; decomposition does not guarantee conflict-free development.

## Worked example: equipment loans

A library equipment system can be decomposed into identify borrower, find item, check availability, record loan and display confirmation. Record loan can be divided further into calculate due date and save borrower/item/date details.

A decomposition diagram shows the hierarchy: put Equipment Loans at the top, connect it to the five tasks, then connect Record Loan to its two smaller tasks. This represents the parts of the problem, not the sequence of every instruction. A flowchart represents control flow; pseudocode expresses precise steps.

## Input, process, output and storage

Inputs are the borrower ID and requested item ID. Processing checks availability and calculates a due date. Output confirms the loan or explains rejection. Storage retains the loan for later return. Storage is needed even after the confirmation leaves the screen.

## Independent design

Design a small club attendance system. Draw a decomposition diagram, identify its input/process/output/storage, then give precise steps for recording one arrival. Compare: inputs can include member ID and date; processing checks membership and duplicate arrival; output confirms or rejects; storage keeps attendance history. Other sensible designs are possible if their responsibilities and data agree.

---

## Interactive Exercises & Autotest Specifications

### Exercise 1: Exam-Style Check: Structure Chart Notation Symbols (Multiple choice, 25 XP)

**Instructions:**
On a Cambridge structure chart, what does an arrow with a solid (filled) circle at its base represent?

**Options:**
- **A**: A data parameter or variable passed to a sub-routine
- **B**: A control flag or Boolean status passed between modules
- **C**: A loop or repetitive iteration of sub-routines
- **D**: A conditional selection branch choosing between modules


**Autotest Expectations:**
- **Correct structure chart notation identified**: `selection_match` -> Expected: `opt_flag`

### Exercise 2: Exam-Style Question: Identify Sub-system Inputs and Outputs (Fill in blank, 35 XP)

**Instructions:**
A software engineer designs a Point-of-Sale checkout system decomposed into sub-systems:

1. The Barcode Scanner sub-system accepts a physical laser scan as [blank_1] and passes the ItemID to the Pricing sub-system.
2. The Pricing sub-system queries the product database and produces the item price as [blank_2].
3. The engineering process of breaking a complex system down into smaller, self-contained sub-systems is called system [blank_3].


**Starter Code:**
```text
{"prompt":"Complete the decomposition analysis:","template":"1. Barcode scanner accepts: [blank_1]\n2. Pricing sub-system produces: [blank_2]\n3. Process of breaking down system: [blank_3]","word_bank":["input","output","storage","processing","decomposition","abstraction"],"blanks":[{"id":"blank_1"},{"id":"blank_2"},{"id":"blank_3"}]}
```

**Autotest Expectations:**
- **Scanner receives input**: `text_exact` -> Expected: `input`
- **Pricing generates output**: `text_exact` -> Expected: `output`
- **Technique is decomposition**: `text_exact` -> Expected: `decomposition`

### Exercise 3: Application: A booking system (Fill in blank, 30 XP)

**Instructions:**
Work out each answer before submitting. Names entered by a clerk are input, processing, output or storage? Calculating the remaining places is: Saving bookings for tomorrow is: Displaying a confirmation is:


**Starter Code:**
```text
{"prompt":"Application: A booking system","template":"1. Names entered by a clerk are input, processing, output or storage? [blank_1]\n2. Calculating the remaining places is: [blank_2]\n3. Saving bookings for tomorrow is: [blank_3]\n4. Displaying a confirmation is: [blank_4]","blanks":[{"id":"blank_1"},{"id":"blank_2"},{"id":"blank_3"},{"id":"blank_4"}],"word_bank":["input","processing","storage","output","validation"]}
```


