Fundamentals

Flowcharts

Flowcharts turn an algorithm into a picture — using shapes and arrows to show each step and how the flow of control moves between them. Master the symbols, learn to draw them, and translate them into CIE pseudocode.

2.1 What is a Flowchart?

A flowchart is a diagram that uses standard shapes and arrows to represent the steps of an algorithm. Instead of writing the solution in words or code, a flowchart draws it — making it easier to see the order of operations and where the logic branches.

Key idea: A flowchart is a planning tool, not the final program. It helps you design and check your logic before you write a single line of pseudocode or code.

Why do we use flowcharts?

  • To visualise the structure of an algorithm at a glance
  • To communicate a solution to others (programmers and non-programmers)
  • To spot errors in logic before coding begins
  • To break down a complex problem into smaller, manageable steps
  • To show branching (decisions) and loops clearly

Here is a tiny example showing what a flowchart might look like for a program that reads a number and prints whether it is positive:

NoYesSTARTINPUT NumNum > 0 ?OUTPUT "Positive"OUTPUT "Not positive"END

2.2 Flowchart Symbols

Flowcharts use a small set of standard shapes. Each shape has a special meaning, so anyone reading the flowchart understands the same thing. You must learn these six symbols:

START

Terminator (Oval)

Marks the START or END of the flowchart. Every flowchart must have one START oval and (usually) one END oval.

Total <- A+B

Process (Rectangle)

Used for calculations, assignments, or any action that processes data. Example: Total <- A + B or Counter <- Counter + 1.

X > 5 ?

Decision (Diamond)

A yes/no or true/false question. The flow splits into two outgoing arrows — one for Yes, one for No. Used for IF conditions.

INPUT Age

Input / Output (Parallelogram)

Represents data going IN (INPUT) or coming OUT (OUTPUT) of the program. Example: INPUT Name or OUTPUT Result.

A

Connector (Small Circle)

Used to connect parts of a flowchart that are too far apart to join with a line, or to link to another page. Usually labelled with a letter (A, B, C...).

Flow Line (Arrow)

The arrows that connect the shapes. They show the order in which steps are executed — the actual 'flow' of the algorithm.

Remember: The shape carries the meaning — never use a rectangle for a question, and never use a diamond for a calculation. Examiners check that you have used the correct symbols!

Quick Reference Table

SymbolShapeUsed For
TerminatorOvalSTART / END
ProcessRectangleCalculations, assignments
DecisionDiamondYes/No questions (IF)
Input/OutputParallelogramINPUT and OUTPUT
ConnectorSmall circleLinking parts of the chart
Flow lineArrowShowing the order of steps

2.3 Drawing Flowcharts

Drawing a clear flowchart is a skill you can learn with practice. Follow these steps every time and your flowcharts will be easy to read and exam-correct.

Step-by-Step Method

1List the main steps in plain English before drawing anything.
2Start with a START oval at the top of the page.
3Draw each step using the correct shape (rectangle, diamond, parallelogram).
4Connect each shape with arrowed flow lines pointing downward.
5Label every decision diamond with its Yes and No branches.
6End with an END oval. Review the chart to make sure all paths lead to it.

Good Practice Rules

Flow generally moves TOP to BOTTOM, LEFT to RIGHT
Use one START and one END only
Every decision diamond has exactly TWO outgoing arrows (Yes / No)
Never cross flow lines if you can avoid it — use connectors instead
Keep shape sizes consistent and text inside each shape short
Label every arrow leaving a decision with Yes/No or True/False

Here is an example flowchart for a program that asks for a number and prints whether it is even:

YesNoSTARTINPUT NumRem <- Num MOD 2Rem = 0 ?OUTPUT "Even"OUTPUT "Odd"END

2.4 Flowchart to Pseudocode

Once you have drawn a flowchart, translating it into CIE pseudocode is straightforward — each symbol maps to a particular keyword or structure. Here is the conversion table:

Flowchart SymbolPseudocode
Terminator (START)Begins the program — no keyword needed
Terminator (END)Use STOP or simply end the pseudocode
Process (Rectangle)Assignment: Counter <- 0
Input (Parallelogram)INPUT Name
Output (Parallelogram)OUTPUT "Hello"
Decision (Diamond)IF condition THEN ... ELSE ... ENDIF

Worked Example

Consider a flowchart that inputs a number, checks if it is greater than 5, and prints "Big" or "Small". The pseudocode for this flowchart would be:

INPUT Num
IF Num > 5 THEN
  OUTPUT "Big"
ELSE
  OUTPUT "Small"
ENDIF

Notice how the decision diamond becomes an IF statement. The Yes branch becomes the THEN part, and the No branch becomes the ELSE part.

Tip: When a flowchart has a decision diamond that loops back on itself, you translate it into a WHILE loop. When the diamond counts from one value to another, you use a FOR loop.

2.5 Key Points Summary

Let's recap the most important ideas from this topic before you tackle the Question Bank.

A flowchart is a diagram of an algorithm using shapes and arrows.
Terminator (oval) marks the START and END of the flowchart.
Process (rectangle) is for calculations and assignments.
Decision (diamond) is for yes/no questions — it splits the flow.
Parallelogram is for INPUT and OUTPUT of data.
Flow lines (arrows) show the order the steps run in.
Connector (small circle) links parts of a chart that are far apart.
Every decision diamond needs Yes/No labels on its outgoing arrows.
A flowchart should have ONE START and ONE END.
Decision diamonds translate to IF...THEN...ELSE statements in pseudocode.

Exam tip: In CIE exams you may be asked to draw a flowchart from a description, or to write pseudocode from a flowchart. Always use the correct shape for each step, label every decision diamond with its Yes/No branches, and use UPPERCASE keywords (IF, THEN, ELSE, ENDIF) in the pseudocode.

Flowchart Tasks

15 scenario-based drawing tasks (3 Easy · 5 Medium · 7 Complex). Read the scenario, draw the flowchart, then check with Hint or Help.

1EasyFlowchart Task

A program asks the user to enter their age. If the user is 18 or older, the program outputs "Adult". Otherwise, it outputs "Minor". Draw the flowchart for this program.

2EasyFlowchart Task

A program inputs two numbers and outputs the larger of the two. Draw the flowchart.

3EasyFlowchart Task

A program inputs a temperature. If the temperature is above 30, it outputs "Hot". Otherwise, it outputs "Cool". Draw the flowchart.

4MediumFlowchart Task

A program inputs a student's exam score (0–100). If the score is 50 or above, output "Pass". If the score is below 50, output "Fail". However, if the score is exactly 100, output "Perfect" instead of "Pass". Draw the flowchart with two decision diamonds.

5MediumFlowchart Task

A program inputs a number and checks if it is even or odd using the MOD operator. If the remainder when divided by 2 is 0, output "Even". Otherwise, output "Odd". Draw the flowchart.

6MediumFlowchart Task

A vending machine program asks the user to enter a product code (1, 2, or 3). Code 1 outputs "Coke - $1.50", code 2 outputs "Water - $1.00", code 3 outputs "Juice - $2.00". Any other code outputs "Invalid". Draw the flowchart using a CASE structure (one decision with multiple branches or sequential decisions).

7MediumFlowchart Task

A program repeatedly asks the user to enter a positive number. If the user enters 0 or a negative number, the program asks again (input validation). Once a positive number is entered, the program outputs "Valid: " followed by the number and ends. Draw the flowchart with a REPEAT...UNTIL loop.

8MediumFlowchart Task

A program inputs 10 numbers and counts how many are positive. After all 10 numbers are entered, it outputs the count. Use a FOR loop (Counter from 1 to 10) and a running Count variable. Draw the flowchart.

9ComplexFlowchart Task

A program inputs 5 student names and their scores. It finds the student with the highest score and outputs their name. Use a FOR loop (1 to 5), a "Highest" variable initialised to -1, and a "TopName" variable. Draw the complete flowchart.

10ComplexFlowchart Task

A program asks the user for a password. The correct password is "Secret123". The user gets 3 attempts. If they enter the correct password, output "Access Granted". If they fail all 3 attempts, output "Access Denied". Use a counter for attempts and a loop. Draw the flowchart.

11ComplexFlowchart Task

A program uses bubble sort to sort an array of 5 numbers into ascending order. It repeatedly compares adjacent elements and swaps them if they are in the wrong order, until no more swaps are needed. Draw the flowchart showing the outer REPEAT...UNTIL (no swaps) loop and the inner FOR loop (1 to 4) with the swap logic.

12ComplexFlowchart Task

A program performs a linear search on an array of 20 names. The user inputs a search name. The program loops through the array and compares each element. If found, output "Found at position: " + index. If not found after checking all 20 elements, output "Not found". Use a Found flag and a Counter. Draw the complete flowchart.

13ComplexFlowchart Task

A program calculates the factorial of a number N using a loop. The user inputs N. The program initialises Factorial = 1, then multiplies Factorial by each integer from 1 to N. Finally it outputs the result. Draw the flowchart. Handle the edge case where N = 0 (output 1).

14ComplexFlowchart Task

A restaurant program takes an order: the user enters the number of diners and a tip percentage. For each diner, the user enters the price of their meal. The program calculates the subtotal, the tip amount, the total, and outputs a receipt showing all three values. Use a FOR loop to input each meal price and accumulate the subtotal. Draw the complete flowchart.

15ComplexFlowchart Task

A program manages a simple ATM. The user enters a PIN. If correct (1234), they can withdraw money: the program shows the balance ($1000), asks for the withdrawal amount. If the amount is valid (> 0 and <= balance), it deducts and outputs the new balance. If the amount is invalid, it outputs "Invalid amount". If the PIN is wrong, output "Wrong PIN" and end. Draw the complete flowchart with all decision branches.

16ComplexFlowchart Task

A program administers a 5-question quiz. For each question, the user inputs their answer (1-4). The correct answers are stored in an array Correct[1:5]. The program compares each answer, counts correct ones, and outputs the score as "X/5" and a grade (A if >= 4, B if >= 3, otherwise C). Use a FOR loop and a counter.

17ComplexFlowchart Task

A program displays a temperature conversion menu: 1 = Celsius to Fahrenheit, 2 = Fahrenheit to Celsius, 3 = Exit. The user chooses an option. If 1 or 2, input a temperature, convert using the appropriate formula, output the result, then loop back to the menu. If 3, exit. Validate the menu choice (must be 1, 2, or 3). Use REPEAT...UNTIL for the menu loop.

18ComplexFlowchart Task

A program inputs a number N and checks if it is prime. A prime number is only divisible by 1 and itself. The program loops from 2 to N-1, checking if N MOD divisor = 0. If any divisor is found, it is not prime. Handle the edge case where N < 2 (not prime). Output "Prime" or "Not prime". Use a Found flag and a FOR loop.

19ComplexFlowchart Task

A program processes 50 employees. For each, input Name, HoursWorked, and HourlyRate. Calculate pay = HoursWorked x HourlyRate (with overtime at 1.5x for hours > 40). Track the total payroll and the highest-paid employee name. After all 50, output the total payroll and the highest-paid employee. Use a FOR loop, running totals, and max tracking.

20ComplexFlowchart Task

A program manages library book returns and calculates fines. For each book, input BookID and DaysOverdue. If DaysOverdue <= 0, no fine. If 1-7 days, fine = $0.50/day. If 8-30 days, fine = $1.00/day. If > 30 days, fine = $2.00/day + $5 processing fee. The program loops for multiple books until the user enters BookID = "DONE". Output the total fine collected. Use nested decisions, a REPEAT...UNTIL loop, and a running total.

Question Bank

Test yourself — 12 questions including True/False and code-based problems. Answer all questions, then click Submit to see your score.

Answered: 0 / 12

Question 1Multiple Choice

What is a flowchart?

Question 2Multiple Choice

Which flowchart symbol is used to represent the START or END of a flowchart?

Question 3Multiple Choice

A flowchart uses a DIAMOND shape. What does this represent?

Question 4True / False

A parallelogram shape in a flowchart is used to represent INPUT or OUTPUT.

Question 5Multiple Choice

What do the arrows (flow lines) in a flowchart show?

Question 6Multiple Choice

Look at this pseudocode. Which flowchart symbol would represent the underlined step?

INPUT Num
IF Num > 10 THEN
  OUTPUT "Big"
ENDIF

Question 7True / False

A flowchart can have multiple START ovals but only one END oval.

Question 8Multiple Choice

Which of the following is an advantage of using flowcharts?

Question 9Multiple Choice

Look at this flowchart pseudocode. What will be OUTPUT when Num is 3?

INPUT Num
IF Num >= 5 THEN
  OUTPUT "Pass"
ELSE
  OUTPUT "Fail"
ENDIF

Question 10True / False

Every shape in a flowchart must be connected by flow lines — no shape should be left "floating" without a path in or out.

Question 11Multiple Choice

A rectangle (process) shape in a flowchart is used for:

Question 12Multiple Choice

You have written a flowchart for a program that asks the user for a number and prints whether it is positive, negative or zero. How many DECISION diamonds will your flowchart need at minimum?

Answer all 12 questions to enable Submit (0/12 answered).