StudyVault
Home Unit Overview Exam Technique Revision Techniques ← Previous Lesson Next Lesson →

← Back to Dashboard

Overlay:
0:00 / 0:00 Narration generated using AI text-to-speech.

Algorithms: Flowcharts, Pseudocode and Constructs

Writing Algorithms Down

Once you have broken a problem into sub-problems using decomposition, you need a way to describe the solution to each one. An algorithm is that description. Algorithms can be written in three forms: as a flowchart, as pseudocode, or as actual program code (Python 3 in this qualification, using the Programming Language Subset). Your exam may ask you to read, complete or write in any of these forms.

Key Fact

Your specification lists six flowchart symbols: oval/rounded rectangle (start or end terminator), rectangle (process or action), parallelogram (input or output), diamond (decision — has yes/no exits), arrow (flow of control), and rectangle with double vertical bars (predefined subprogram call). Make sure you know every symbol — questions often ask you to identify or add missing shapes.

Flowcharts in Detail

A flowchart gives you a visual picture of how an algorithm runs. Every step is drawn as a shape; arrows connect them in sequence. The diamond shape is particularly important — it represents a decision with two exits (usually labelled Yes and No). Decisions are used to model selection (choosing between paths) and the loop condition in repetition. In a flowchart showing a loop, an arrow curves back to an earlier step from the exit that keeps the loop going. In a “while” loop the diamond tests the condition for carrying on, so the “Yes” exit loops back and the “No” exit leaves the loop.

The predefined subprogram symbol (rectangle with double vertical bars on each side) shows a call to a named subprogram. Using it keeps the flowchart at a high level of abstraction — the detail of what the subprogram does is shown in a separate flowchart for that subprogram alone.

Pseudocode — Plain English Is Fine

Your specification includes an important footnote: pseudocode is described as “an informal written description of a program” that uses “imprecise English language statements” and “does not require any strict programming syntax.” This means plain-English step descriptions are acceptable in your exam; a formal keyword dialect is not required. Number your steps, write naturally, and make the logic clear — that is all that is required.

Sequence — instructions execute in the order they are written. There is no choice and no repetition. Every algorithm has at least some sequence.

Plain-English example:
1. Ask the user for their name.
2. Ask the user for their age.
3. Display “Hello [name], you are [age] years old.”

Selection — the algorithm checks a condition and follows one of two (or more) different paths depending on the result. In plain-English pseudocode this is written as an if/else structure.

Plain-English example:
1. Ask the user for their score.
2. If the score is 50 or above, display “Pass.”
3. Otherwise, display “Fail.”

Count-controlled repetition — a block of steps repeats a fixed number of times. Use this when you know in advance exactly how many times to repeat.

Plain-English example:
1. Set total to 0.
2. Repeat the following 5 times:
   a. Ask the user for a number.
   b. Add the number to total.
3. Display total.

Condition-controlled repetition — a block of steps repeats while (or until) a condition is true. Use this when you do not know in advance how many repetitions are needed.

Plain-English example:
1. Ask the user to enter a password.
2. While the password is not correct:
   a. Display “Incorrect, please try again.”
   b. Ask the user to enter the password again.
3. Display “Access granted.”

Iteration over a data structure — process every item in a collection one by one. Use this when you need to examine or modify each element.

Plain-English example:
1. For each student in the class list:
   a. If the student’s score is above 80, add them to the high-achievers list.

Variables, Constants and Data Structures

Algorithms work on data. A variable is a named location in memory whose value can change during execution. A constant is similar, but its value is fixed for the entire run — useful for values like a maximum number of login attempts.

Data can also be stored in structures. A one-dimensional array stores items in a single list, accessed by an index position. A two-dimensional array organises data in rows and columns — like a table. A record groups related values under field names (for example, a student record might hold a name, year group, and score).

Key Fact

Arithmetic operators: addition (+), subtraction (−), multiplication (×), division (÷), modulus (remainder after division, e.g. 17 mod 5 = 2), integer division (whole-number quotient, e.g. 17 div 5 = 3), and exponentiation (power, e.g. 2 to the power 3 = 8). Relational operators compare two values and return True or False: equal to, less than, greater than, not equal to, less than or equal to, greater than or equal to. Common error: stating the output as “yes” or “no” instead of True or False.

Logical Operators

Logical operators combine or modify Boolean conditions. AND returns True only when both conditions are True. OR returns True when at least one condition is True. NOT reverses the truth value of a single condition.

Example: a ticketing system admits users if they are at least 18 years old AND have a valid ticket. Both conditions must be True. Another example: a delivery notification is sent if the parcel has arrived OR the customer has requested an early alert. Only one condition needs to be True.

Problem: go through a register of 30 students and count how many were absent today.

Plain-English algorithm:
1. Set absent count to 0.
2. For each student in the register (iteration over data structure):
   a. If the student’s attendance status is “absent” (selection):
      i. Add 1 to absent count.
3. Display “Number absent today: ” followed by absent count (sequence).

This algorithm uses all three constructs: sequence (steps 1 and 3), selection (step 2a), and iteration over the register list (step 2). The absent count is a variable; the register is a one-dimensional array or list.

Practice Questions

Test yourself on this lesson. Pick a question, write your answer, then get it marked.

AI feedback
AI feedback is guidance, not a final exam mark. If you disagree, your teacher's view is always the tie-breaker.
← Back to unit
Video

© 2026 StudyVault · About · FAQ · Copyright & IP · Privacy · Disclaimers

StudyVault Education Ltd · registered in England and Wales, company no. 17490559 · 71–75 Shelton Street, London WC2H 9JQ