SLIDE 1
CSZone.co.uk
Click to reveal · Arrow keys also work
OCR J277 · Component 2 · Topic 2.1.2a

Designing Algorithms
Flowcharts

IPO Model · Structure Diagrams · Flowchart Symbols · Sequence · Selection · Iteration

CSZone OCR GCSE Computer Science J277
Learning Objectives

By the end of this video you will be able to...

Identify the inputs, processes and outputs for a given problem and produce an IPO diagram before designing any algorithm
Create structure diagrams that decompose a problem into sub-problems, showing the hierarchy of tasks at each level
Name and draw all six flowchart symbols correctly — Terminal, Process, Input/Output, Decision, Sub Program and Flow Line — and know when to use each one
Create, read, interpret and trace flowcharts for algorithms involving sequence, selection and iteration
Identify errors in flowcharts and correct or complete a given flowchart — a key exam skill worth several marks every paper
⚡ Flowchart questions appear on almost every OCR J277 Component 2 exam paper. Getting the symbols right and labelling decisions correctly are the two most common mark-earners.
IPO Model

Step one: identify inputs, processes and outputs

WHY IPO FIRST?
Before drawing a single flowchart symbol, a programmer identifies what data goes in (inputs), what must be done to it (processes), and what comes out (outputs). This is the IPO model. It tells you exactly what variables your flowchart needs and what it must produce — preventing wasted design time on the wrong algorithm.
WORKED EXAMPLE — TEMPERATURE CONVERTER (°C → °F)
INPUT
Temperature in Celsius
celsius (number)
PROCESS
Multiply celsius by 9, divide by 5, add 32
fahrenheit = (celsius × 9/5) + 32
OUTPUT
Temperature in Fahrenheit
fahrenheit (number)
MORE EXAMPLES
LOGIN SYSTEM
IN: username, password  ·  PROCESS: compare to stored credentials  ·  OUT: "Access granted" or "Access denied"
GRADE CALCULATOR
IN: score (number)  ·  PROCESS: compare score to grade boundaries  ·  OUT: "Grade A / B / C / Fail"
⚡ In the exam, you may be given a problem and asked to identify the inputs, processes and outputs before designing the algorithm. Always complete this step — it tells you exactly what symbols, variables and paths your flowchart needs.
Structure Diagrams

Structure diagrams — planning before you draw

A structure diagram shows the hierarchy of a problem — the main task at the top, broken into smaller sub-tasks below. It is drawn before any flowcharts or code. It shows what needs to be done at each level, not how it's done. Each box at the bottom level becomes its own flowchart to design.
Student Grade Tracker Input Grades Calculate Average Assign Grade Display Results Save to File Sum scores Divide by count Main problem Sub-problems (L1) Sub-problems (L2) — each becomes its own flowchart
Reading this diagram: Student Grade Tracker breaks into five Level 1 tasks. Calculate Average breaks further into two Level 2 tasks — Sum scores, then Divide by count. Each leaf node (a box with nothing below it) is simple enough to design as its own small flowchart.
⚡ The exam may give you a partially completed structure diagram and ask you to fill in the missing boxes. Always check: does each sub-task at the bottom level represent one clear, single operation? If a box can still be broken down further, it should be — decompose until each task is straightforward to implement.
Flowchart Symbols

All six symbols you must know

Every flowchart is built from exactly six shapes. Using the wrong shape — for example a rectangle where a diamond should go — will lose marks in the exam. Here are all six, with the OCR names you must use.
START / END TERMINAL Rounded rectangle Start & end of chart x = x + 1 PROCESS Rectangle Calculation / action INPUT name INPUT / OUTPUT Parallelogram Data in or out x > 10? YES / NO DECISION Diamond — 2 exits Always YES and NO calcAvg() SUB PROGRAM Rect + side bars Calls a function FLOW LINE Arrow Direction of flow MEMORY AID → Round = Terminal Plain rect = Process Slanted = Input/Output Diamond = Decision Barred = Sub prog.
Quick test yourself: which shape has slanted sides? (Parallelogram — Input/Output). Which shape has bars on its sides? (Sub Program). Which shape has exactly two exits? (Diamond — Decision).
⚡ The sub program symbol (rectangle with bars) is commonly forgotten. If your flowchart calls a function or procedure — for example, calculateVAT() — you must use this symbol, not a plain rectangle. The bars are the entire point.
Flowchart Rules

Rules every valid flowchart must follow

1
Every flowchart starts and ends with a TERMINAL
The rounded rectangle labelled START must be the first box. The rounded rectangle labelled END must be the last box on every path. A flowchart missing a START or END terminal is always wrong.
2
Every decision diamond has exactly TWO exits — labelled YES and NO
A diamond with one exit is always wrong. A diamond with unlabelled exits loses marks. One branch must be labelled YES and the other NO — not "true/false" or "T/F" — use YES and NO.
3
Every path must eventually reach an END terminal
No dead ends. If you follow any route through the flowchart — through any combination of YES and NO branches — you must be able to reach an END terminal. An arrow that goes nowhere is always a mistake.
4
Arrows show direction — always follow the arrowhead
Flow lines must have arrowheads. When reading or tracing a flowchart, follow the direction of the arrow — not just the line. Iteration (loops) uses a backward-pointing arrow that curves from a later step back up to an earlier one.
⚡ These four rules are your checklist when you draw or check any flowchart. If a flowchart breaks any of them, it is wrong — and in the exam, identifying which rule is broken is often the entire question.
Sequence

Flowchart: sequence — steps in order

WHAT IS SEQUENCE?
Sequence is the simplest structure — steps execute one after another, in order, with no decisions or loops. The flowchart is a straight vertical line from START to END. Every flowchart contains at least some sequence.
ALGORITHM: TEMPERATURE CONVERTER
1. Input a temperature in Celsius
2. Calculate Fahrenheit using the formula
3. Output the Fahrenheit temperature
Notice: the flowchart flows straight down. No branches. No arrows pointing back up. This is pure sequence — three operations executed in strict order.
⚡ In sequence flowcharts: START → all INPUT boxes first → PROCESS boxes → all OUTPUT boxes → END. The order matters — you cannot output fahrenheit before calculating it.
START INPUT celsius fahrenheit = (celsius × 9/5) + 32 OUTPUT fahrenheit END ① Input ② Process ③ Output
This flowchart follows the IPO model directly. The INPUT parallelogram captures the data. The PROCESS rectangle does the calculation. The OUTPUT parallelogram displays the result. Every sequence flowchart maps cleanly onto Input → Process → Output.
Selection

Flowchart: selection — branching with decisions

WHAT IS SELECTION?
Selection uses a decision diamond to branch the flowchart. A condition is tested. If TRUE, the YES branch executes. If FALSE, the NO branch executes. After both branches, the paths typically merge and continue to END.
ALGORITHM: AGE GATE
1. Input age
2. If age ≥ 18: output "Access granted"
3. Otherwise: output "Access denied"
4. End
TRACE WITH age = 20
START → INPUT 20 → Is 20 ≥ 18? YES → OUTPUT "Access granted" → END
TRACE WITH age = 15
START → INPUT 15 → Is 15 ≥ 18? NO → OUTPUT "Access denied" → END
⚡ Both branches must still reach END. The YES arrow and the NO arrow each follow a different path but both paths terminate. This is the rule — no dead ends. The diamond always has exactly two exits.
START INPUT age age ≥ 18? YES NO OUTPUT "Access granted" OUTPUT "Access denied" END
Iteration

Flowchart: iteration — loops with a back-arrow

WHAT IS ITERATION?
Iteration is a loop — steps repeat until a condition is met. In a flowchart, a decision diamond tests the loop condition. The YES branch continues past the loop. The NO branch loops back up to repeat. The back-arrow is the key visual that shows a loop.
ALGORITHM: INPUT SUM (stop when 0)
Set total = 0
Input num
While num ≠ 0: total = total + num, input num
Output total
TRACE: entering 3, 5, 0
total=0 → INPUT 3 → 3≠0? NO(loop) → total=3 → INPUT 5 → 5≠0? NO(loop) → total=8 → INPUT 0 → 0≠0? YES(exit) → OUTPUT 8
⚡ In iteration flowcharts: NO loops back, YES exits (or vice versa — it depends on the condition). Always check which branch loops back and which exits. Mislabelling YES/NO on the decision is a very common mistake.
START total = 0 INPUT num num = 0? YES NO total = total + num INPUT num OUTPUT total END LOOP BACK
Sub Programs & Multi-Decision

Sub program boxes & chained decisions

SUB PROGRAM BOX
When a flowchart calls a function or procedure, the sub program symbol is used instead of a plain rectangle. The vertical bars on the sides signal "this calls another named routine." Inside the box you write the function name with brackets, e.g. calculateGrade().
CHAINED DECISIONS — GRADE BOUNDARY EXAMPLE
When there are more than two outcomes, you chain decisions: the NO branch of one diamond feeds into another diamond. Each YES branch gives a different output.
score ≥ 70? YES → "A"
NO ↓
score ≥ 50? YES → "B"
NO ↓
→ "Fail"
⚡ With chained decisions: the NO branch of each diamond leads to the next test. The final NO branch leads to the default output — the catch-all case when no previous condition was true. Trace every path to check all routes reach END.
START INPUT score score ≥ 70? YES OUTPUT "A" NO score ≥ 50? YES OUTPUT "B" NO OUTPUT "Fail" END
Exam Skill

Correcting and completing flowcharts

TYPES OF FLOWCHART ERRORS TO SPOT
ERROR TYPE 1 — Wrong shape
A process (calculation) drawn as a parallelogram instead of a rectangle. Or a decision drawn as a rectangle. The examiner is testing whether you know which shape does which job.
ERROR TYPE 2 — Unlabelled decision
A decision diamond with two exits but no YES / NO labels on the arrows. You must label both exits — zero marks for unlabelled decision branches.
ERROR TYPE 3 — Missing terminal / dead end
A path that has no END terminal, or an arrow that leads nowhere. Every branch must reach END. If you follow the YES branch and hit nothing — that's a dead end and the flowchart is wrong.
HOW TO COMPLETE A PARTIAL FLOWCHART
Read the algorithm given alongside the flowchart first — understand the full logic before touching the diagram
Identify what's already there — follow existing arrows, label all boxes you can see
Find the gaps — missing boxes, missing arrows, missing labels
Check every path reaches END after completing
SPOT THE ERRORS — THIS FLOWCHART HAS THREE MISTAKES
START INPUT score ① Wrong shape! score ≥ 50? ② No label! NO OUTPUT "Pass" ③ Dead end — no END! OUTPUT "Fail" END
THREE ERRORS IDENTIFIED
INPUT box is a rectangle — must be a parallelogram
YES exit of the decision diamond has no label — must be labelled YES
The "Pass" output has no arrow to END — dead end, path never terminates
Exam-Style Questions

Flowcharts — 2.1.2a

Question 1
Draw an IPO diagram for the following problem: a program reads a user's age and outputs whether they are a "Child" (under 13), "Teenager" (13–17) or "Adult" (18 and over).
3 marks
INPUT
age (integer)
PROCESS
Compare age to boundaries: <13, 13–17, ≥18
OUTPUT
"Child", "Teenager" or "Adult"
Marks: 1 correct input · 1 correct process · 1 correct output(s)
Question 2
State the flowchart symbol used for each of the following. (a) A decision. (b) Calling a procedure. (c) Displaying output to the screen.
3 marks
a
Diamond — the decision symbol with two exits labelled YES and NO
b
Rectangle with vertical bars on both sides — the sub program symbol
c
Parallelogram — the Input/Output symbol (slanted sides)
Question 3
A flowchart is designed to count from 1 to 5 and output each number. Describe the structure of this flowchart and identify which flowchart construct (sequence, selection or iteration) it uses. State the two labels that must appear on the decision diamond.
4 marks
1
The flowchart uses iteration (a loop) — the steps repeat multiple times. (1 mark)
1
Structure: START → set count = 1 → decision: count > 5? → NO: OUTPUT count, count = count + 1, loop back → YES: END. (1 mark)
1
The decision diamond must have a back-arrow on the NO branch returning to the OUTPUT step (or the decision itself). (1 mark)
1
The two labels on the decision diamond exits are YES and NO. (1 mark)
Common Mistakes

Four mistakes that cost marks

1
Using a rectangle for INPUT or OUTPUT. Input and output operations must use the parallelogram (slanted-sided shape). The rectangle is only for processes — calculations and assignments. Writing "INPUT name" inside a rectangle instead of a parallelogram is the most common single mark-losing error in flowchart questions. Every time you write INPUT or OUTPUT on a flowchart, check: is it in a parallelogram?
2
Forgetting to label YES and NO on decision diamonds. A decision diamond with two unlabelled exits earns zero marks for that diamond. Both exits must be labelled — YES on one, NO on the other. Some students write T and F (true/false) or Y and N — the OCR mark scheme requires YES and NO. Use the full words. This applies to every decision in the flowchart, not just the first one.
3
Forgetting the sub program symbol and using a rectangle instead. The sub program symbol — a rectangle with vertical bars on both sides — is required whenever the flowchart calls a named function or procedure. Students often forget the bars exist and draw a plain rectangle. The bars are the entire point of the symbol: they tell the reader "this step calls another routine." No bars = plain process. Bars = calling a sub program.
4
Not showing the loop-back arrow in iteration flowcharts. A loop in a flowchart is only shown correctly if there is a back-arrow — an arrow that points from a step inside the loop back to an earlier step (usually back to the decision or the first step of the loop body). Without the back-arrow, the flowchart just looks like straight-line sequence with a dead end. The back-arrow is how the examiner knows it's a loop, and omitting it can lose all the marks for the iteration section.
Summary

2.1.2a — Designing Algorithms: Flowcharts

IPO MODEL
Before any design: identify Inputs, Processes and Outputs. This tells you what variables the flowchart needs and what it must produce. Structure diagrams plan the hierarchy of sub-tasks — showing WHAT, not HOW.
6 FLOWCHART SYMBOLS
Terminal (rounded rect) · Process (rect) · Input/Output (parallelogram) · Decision (diamond — YES/NO) · Sub Program (rect + side bars) · Flow Line (arrow). Using the wrong shape loses marks.
4 RULES
① Start and end with a Terminal. ② Decision diamonds always have exactly two exits — labelled YES and NO. ③ Every path reaches END. ④ Arrows show direction.
3 CONSTRUCTS IN FLOWCHARTS
Sequence — straight line, steps in order. Selection — decision diamond, YES and NO branches both reach END. Iteration — decision diamond with a back-arrow on one branch, looping back to repeat. NO loops back, YES exits (typically).
TOP 4 MARK-LOSING ERRORS
① Rectangle for INPUT/OUTPUT (must be parallelogram). ② Unlabelled decision exits (must say YES / NO). ③ Rectangle instead of sub program box (must have side bars). ④ Missing back-arrow in a loop (iteration only shows if the back-arrow is drawn).
2.1.2a Complete

That's 2.1.2a done!

Next up: 2.1.2b — Designing Algorithms: Pseudocode

📝
MARKED WORKSHEET
CSZone.co.uk
🎯
QUIZ
CSZone.co.uk
📊
SLIDES
CSZone.co.uk