# Flowchart Symbols & Decision Logic

- **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

A flowchart represents an algorithm using shapes and directional arrows. An oval marks start/end, a rectangle marks a process such as assignment, a parallelogram marks input/output, and a diamond marks a decision. Label the decision branches Yes/No or True/False. Arrows show execution order and can return to an earlier step for a loop.

![Flowchart: input Age; decision Age at least 12; yes outputs ELIGIBLE and no outputs WAIT; both end](/curriculum/igcse/age-flowchart.svg)

## Worked trace

For Age=11, the condition is false and the output is WAIT. For Age=12, it is true and the output is ELIGIBLE. Both branches reach End. Replacing >= with > would wrongly reject the boundary value 12.

## Amend and construct

On paper amend the chart so eligibility begins at 15. Only the comparison threshold needs changing. Then draw a new chart which repeatedly asks for a value until it lies from 1 to 5 inclusive.

Self-review: Start leads to an input parallelogram; a decision tests Value >= 1 AND Value <= 5; No returns to input, and Yes reaches a success output and End. Returning to the decision without another input would repeat the same invalid value forever. Use the correct shapes, labelled branches and arrowheads.

---

## Interactive Exercises & Autotest Specifications

### Exercise 1: Exam-Style Check: Match Flowchart Shapes to Algorithmic Functions (Matching terms, 25 XP)

**Instructions:**
Match each standard flowchart symbol shape to its operational role.


**Starter Code:**
```text
{"prompt":"Match each flowchart symbol shape with its operational role:","left":[{"id":"oval","text":"Oval / Rounded rectangle"},{"id":"rect","text":"Rectangle"},{"id":"par","text":"Parallelogram"},{"id":"dia","text":"Diamond"}],"right":[{"id":"role_term","text":"Start or stop terminator of an algorithm"},{"id":"role_proc","text":"Calculation, assignment, or internal data operation"},{"id":"role_io","text":"Reading input data or displaying output results"},{"id":"role_dec","text":"Conditional decision branching with Yes/No exit paths"}]}
```

**Autotest Expectations:**
- **Flowchart shapes matched to functions**: `match_pairs` -> Expected: `{&quot;oval&quot;:&quot;role_term&quot;,&quot;rect&quot;:&quot;role_proc&quot;,&quot;par&quot;:&quot;role_io&quot;,&quot;dia&quot;:&quot;role_dec&quot;}`

### Exercise 2: Exam-Style Question: Trace Flowchart Decision Branching (Trace table, 35 XP)

**Instructions:**
### Task

The flowchart below evaluates student marks:

![Flowchart: Student Marks Evaluation](/curriculum/igcse/marks-flowchart.svg)

Trace the execution for two inputs: `Mark = 65` followed by `Mark = 40`. Complete the trace table rows.


**Starter Code:**
```text
{"columns": ["Mark", "Mark >= 50", "Mark >= 40", "Result", "OUTPUT"], "rows": [["", "", "", "", ""], ["", "", "", "", ""]]}
```

**Autotest Expectations:**
- **Flowchart decision trace matches expected values**: `table_match` -> Expected: ``

### Exercise 3: Application: Trace a decision (Fill in blank, 30 XP)

**Instructions:**
Work out each answer before submitting. A flowchart inputs Age, tests Age >= 12 and outputs ELIGIBLE on yes or WAIT on no. Output for Age 11: Output for Age 12: Shape for the decision:


**Starter Code:**
```text
{"prompt": "A flowchart inputs Age, tests Age >= 12 and outputs ELIGIBLE on yes or WAIT on no.\n\n![Flowchart: Age Eligibility](/curriculum/igcse/age-flowchart.svg)", "template": "1. Output for Age 11: [blank_1]\n2. Output for Age 12: [blank_2]\n3. Shape for the decision: [blank_3]", "blanks": [{"id": "blank_1"}, {"id": "blank_2"}, {"id": "blank_3"}], "word_bank": ["WAIT", "ELIGIBLE", "diamond", "rectangle", "parallelogram", "PASS"]}
```


