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 flowcharts as a method for representing algorithms, as required by OCR J277 Section 2.1. Flowcharts are a visual way to show the step-by-step logic of an algorithm, including decisions and loops.
A flowchart is a diagram that represents an algorithm using standard symbols connected by arrows (flow lines). Flowcharts show the sequence of steps, decision points, and flow of control in an algorithm.
Flowcharts are useful because they:
You must know these standard symbols for the OCR J277 exam:
| Symbol | Shape | Purpose | Example |
|---|---|---|---|
| Terminator | Rounded rectangle (oval) | Start or end of the algorithm | "Start" / "Stop" |
| Process | Rectangle | A step or action | "total = total + number" |
| Decision | Diamond | A question with Yes/No (True/False) outcomes | "Is score > 50?" |
| Input/Output | Parallelogram | Receiving input or producing output | "INPUT name" / "OUTPUT total" |
| Flow line | Arrow | Shows the direction of flow between symbols | Connects symbols |
| Subroutine | Rectangle with double side lines | Call to a separate procedure/function | "CALL calculateTotal()" |
OCR Exam Tip: The most common mistake is using the wrong shape. Rectangles are for processes (calculations, assignments). Parallelograms are for input/output. Diamonds are ONLY for decisions (yes/no questions). Make sure you draw the correct shapes in the exam.
| Convention | Detail |
|---|---|
| Every flowchart has one Start and one Stop | Use terminators (ovals) |
| Arrows show direction of flow | Flow goes downward by default, with arrows indicating any changes |
| Decisions have exactly two exits | Labelled "Yes" and "No" (or "True" and "False") |
| Each symbol has one entry point | Except decisions which have one entry and two exits |
| Write inside the symbols | Instructions, conditions, or labels go inside the shapes |
| Keep it clear and neat | Use straight lines, avoid crossing arrows where possible |
Here is an example flowchart for checking whether a number is even or odd:
flowchart TD
A([Start]) --> B[/INPUT number/]
B --> C{number MOD 2 = 0?}
C -- Yes --> D[/OUTPUT 'Even'/]
C -- No --> E[/OUTPUT 'Odd'/]
D --> F([Stop])
E --> F
A flowchart to calculate the area of a rectangle:
flowchart TD
A(["Start"]) --> B["INPUT length"]
B --> C["INPUT width"]
C --> D["area = length x width"]
D --> E["OUTPUT area"]
E --> F(["Stop"])
Symbols used: Terminator (Start, Stop), Input/Output (INPUT, OUTPUT), Process (calculation)
A flowchart to check if a student has passed (score >= 50):
flowchart TD
A(["Start"]) --> B["INPUT score"]
B --> C{"Is score >= 50?"}
C -->|Yes| D["OUTPUT 'Pass'"]
C -->|No| E["OUTPUT 'Fail'"]
D --> F(["Stop"])
E --> F
Symbols used: Terminator, Input/Output, Decision (diamond), Process (output)
A flowchart to keep asking for passwords until the correct one is entered:
flowchart TD
A(["Start"]) --> B["INPUT password"]
B --> C{"Is password = 'secret'?"}
C -->|No| D["OUTPUT 'Try again'"]
D --> E["INPUT password"]
E --> C
C -->|Yes| F["OUTPUT 'Access granted'"]
F --> G(["Stop"])
A flowchart to output the numbers 1 to 5:
flowchart TD
A(["Start"]) --> B["counter = 1"]
B --> C{"Is counter <= 5?"}
C -->|No| D(["Stop"])
C -->|Yes| E["OUTPUT counter"]
E --> F["counter = counter + 1"]
F --> C
OCR Exam Tip: When drawing flowcharts in the exam, use a pencil so you can correct mistakes. Draw the shapes clearly and label all arrows from decisions (Yes/No). Check that every path eventually reaches the Stop terminator. Make sure decisions are phrased as questions with exactly two outcomes.
Tracing means following the flowchart step by step with specific input values to determine the output. Use a trace table to track the values of variables at each step.
flowchart TD
A(["Start"]) --> B["INPUT x"]
B --> C["y = x * 2"]
C --> D{"Is y > 10?"}
D -->|Yes| E["OUTPUT y"]
E --> F(["Stop"])
D -->|No| G["OUTPUT x"]
G --> H(["Stop"])
Trace:
| Step | x | y | Decision | Output |
|---|---|---|---|---|
| 1 | 7 | - | - | - |
| 2 | 7 | 14 | - | - |
| 3 | 7 | 14 | 14 > 10? Yes | - |
| 4 | 7 | 14 | - | 14 |
Output: 14
| Question Type | What To Do |
|---|---|
| Draw a flowchart | Design the algorithm and draw it using correct symbols |
| Trace a flowchart | Follow the steps with given input values, use a trace table |
| Identify the output | Trace through and state what the algorithm outputs |
| Find errors | Look for incorrect logic, missing paths, or wrong symbols |
| Explain what the flowchart does | Describe the algorithm's purpose in plain English |
Flowcharts are visual representations of algorithms using standard symbols: terminators, processes, decisions, input/output, and flow lines. They show sequence, selection, and iteration clearly. For the OCR J277 exam, make sure you know all the symbols, can draw flowcharts for given problems, and can trace through flowcharts to determine outputs. Always use correct symbols and label decision exits clearly.
A shop awards discounts at the checkout based on the value of the basket and whether the customer holds a loyalty card:
Draw a flowchart that inputs the basket total and a Boolean indicating whether the customer has a loyalty card, then outputs the final amount to pay.
flowchart TD
A([Start]) --> B[/INPUT total/]
B --> C[/INPUT hasCard/]
C --> D{total >= 20?}
D -- No --> E[finalAmount = total]
D -- Yes --> F{hasCard = true?}
F -- Yes --> G[finalAmount = total * 0.90]
F -- No --> H[finalAmount = total * 0.95]
E --> I[/OUTPUT finalAmount/]
G --> I
H --> I
I --> J([Stop])
Why this flowchart earns full marks:
Subscribe to continue reading
Get full access to this lesson and all 10 lessons in this course.