GCSE · Computer Science · Edexcel · Spec 1CP2
Pseudocode
It looks like code. It reads like English. And no computer can run it as it stands. That's not a flaw — that's the whole point.
Computer Science · Algorithms
Be the computer: a monthly software bill
A company charges £5 per user each month, plus 20% VAT. Here's that algorithm in pseudocode. Step through it and watch each variable fill in.
Before you press Next: with 4 users (just an example number), what will total_cost be when you reach RETURN?
1 license_cost = 52 vat_rate = 0.23 FUNCTION calculate_monthly_bill(number_users)4 license_fee = number_users * license_cost5 vat = license_fee * vat_rate6 total_cost = license_fee + vat7 RETURN total_cost8 ENDFUNCTION9 bill = calculate_monthly_bill(4)10 PRINT(bill)
Variables
Output
Step 1: First, a constant: £5 per user, per month. A constant is a value that can't be changed once the program is running.
One line at a time. Say the new value out loud before you reveal it.
Computer Science · Algorithms
What does each line do?
Pick a line, then pick the job it does.
Still to sort
Input (0)
The program waits for the user to type something in.
Output (0)
Information is shown on the screen.
Selection (0)
A decision: one path or another.
Count-controlled iteration (0)
Repeat a set number of times.
Where the line is: FOR fixes how many times the loop runs before it starts. WHILE doesn't: it keeps checking a condition.
Condition-controlled iteration (0)
Repeat as long as a condition is met.
Where the line is: A WHILE loop may run once, many times or not at all. It depends on the condition, not on a count.
Keywords are often written in capitals so they stand out. Sort each line by the job it does — two of them are set to trip you up.
WHAT YOU'VE LEARNED
A quick recap of today's lesson.
Code written for people, not computers. Precise enough to follow line by line, loose enough to belong to no language.
What you need to know
- Pseudocode is a way of expressing an algorithm that isn't tied to any specific programming language.
- The word gives it away: 'pseudo' means pretend or fake, so pseudocode is literally 'pretend code'.
- It uses plain language to set out an algorithm's steps in a logical order — a basic knowledge of programming is enough to follow it.
- Looks like code? Still can't run. A computer can only execute it once it's translated into a real language like Python, Java or C#.
Have a goSam has written perfect pseudocode — not a single mistake — and is certain the computer will run it first time. What would you tell Sam?
It still won't run. It has to be translated into a real programming language first.
Being error-free isn't the problem: pseudocode doesn't follow any language's syntax rules, so even flawless pseudocode can't be executed directly.
- Keywords are often written in capitals so they stand out: INPUT, PRINT, IF, THEN, ELSE, FOR and WHILE.
- There's no set standard, so styles differ, even between exam boards. Whatever style you use, stay consistent and make the meaning clear.
Have a goOne algorithm uses PRINT("Hi") on line 2 and output "Bye" on line 6. Each line makes sense on its own. So what's wrong?
The style isn't consistent.
There's no set standard, but within one algorithm you stick to one style — mixing them makes a reader wonder whether the two lines do different things.
- FOR … TO repeats a set number of times; WHILE keeps repeating as long as its condition is met.
Have a goYou want a program to print "Hip hip hooray!" exactly three times. FOR or WHILE?
FOR, e.g. FOR count = 1 TO 3.
You know the number of repeats before you start, so it's count-controlled. WHILE suits 'keep going as long as…' when the count isn't known in advance.
- In this style, = gives a variable a value, == compares two values, and != means 'not equal to'.
- Written descriptions, flowcharts and pseudocode can all show an algorithm. No one method is best: it depends on the problem.
The big picture
Pseudocode is a way of writing an algorithm in plain, code-like language that isn't tied to any programming language. The name means 'pretend code': it looks like code, but a computer can't execute it until it's translated into a real language such as Python, Java or C#. There's no set standard, so styles vary — just keep yours consistent and clear. Programmers use it to plan, to check a solution is possible and logical, and to catch errors before the final program exists.
Key points
Worked example
Problem
A program keeps asking the user to guess the password until they get it right, then it displays Welcome. The correct password is already stored in a variable called password. Write this algorithm in pseudocode.
⚠ Watch out
Treating pseudocode as if a computer could run it. It may look like real code, but it follows no language's syntax rules, so it has to be translated into a real programming language first.
Memory hook
Pseudo = pretend. Pretend code is like a recipe written for a person: a cook can follow it step by step, but you can't feed it to the oven. To make a computer run it, translate it into a real programming language.
Check yourself
In your own words, explain how pseudocode differs from a real programming language, and give one reason a programmer might write pseudocode before the real code.
Flashcards
(15)What does the 'pseudo' in pseudocode mean?
What is pseudocode?
Can a computer execute pseudocode directly?
Name three ways of representing an algorithm.
Which is the best way to represent an algorithm?
How do the rules of pseudocode compare with a programming language's rules?
Is there one standard style for pseudocode?
How much programming knowledge do you need to read pseudocode?
When might a programmer skip writing pseudocode first?
What does != mean?
In the style used here, what's the difference between = and == ?
What kind of repetition does FOR … TO give you?
What kind of repetition does WHILE give you?
What is a constant?
What does RETURN do at the end of a function?
Tap any card to flip it, or use Study as deck to go through them one at a time. In the full lesson these run as a spaced-repetition deck — you rate each card Hard, Good or Easy and the tricky ones keep coming back until they stick.
Learning with Lightbulb is opening soon
You can use this lesson now. Join the waitlist and we'll let you know when the full Lightbulb experience is ready.
Keep me postedMore Edexcel GCSE Computer Science topics
How this lesson was checked. This Edexcel GCSE Computer Science (specification 1CP2)lesson was published through Lightbulb Learning's human-designed editorial process — the educational standards, accuracy rules and publication checks it must pass were authored and approved by Philip Halpin. It passed subject-specific assessment, automated educational checks and technical publication verification before going live (publication checks completed 30 October 2026). Published pages are monitored, human spot-checking is ongoing across the lesson library, and anything found wrong is corrected or withdrawn. How our lessons are made and checked. Spotted a mistake? Email hello@lightbulblearning.co and we'll review it.