GCSE · Computer Science · Edexcel · Spec 1CP2

Pseudocode

It looks like code, reads like English, and no computer on Earth can run it. 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 every variable fill in.

Predict first: with 4 users, what will total_cost be when you reach RETURN?

1 license_cost = 5
2 vat_rate = 0.2
3 FUNCTION calculate_monthly_bill(number_users)
4 license_fee = number_users * license_cost
5 vat = license_fee * vat_rate
6 total_cost = license_fee + vat
7 RETURN total_cost
8 ENDFUNCTION
9 bill = calculate_monthly_bill(4)
10 PRINT(bill)

Variables

license_cost=5

Output

 

Step 1: A constant: £5 per user, per month. A constant is a value that can't be changed once the program is running.

1 / 10

Press Next one line at a time. Before each step, say out loud what you think the new value will be.

Step 1 of 10: A constant: £5 per user, per month. A constant is a value that can't be changed once the program is running..

Watch out: The line that defines the function isn't where things happen first. Nothing inside a function runs until it is called, so follow the call, not just the order of the lines.

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.

8 of 8 still to sort.

Pseudocode keywords are often written in capitals so they stand out. Sort each line by the job it does.

Pseudocode vs a real programming language

PseudocodevsA programming language (e.g. Python, Java, C#)

Read the first row first. It's the one that catches people out.

Focus

Can a computer run it?

Pseudocode

No. It can't be executed directly, even though it may look like real code.

A programming language (e.g. Python, Java, C#)

Yes, the computer can execute it.

The insight

Looking like code isn't the same as being code. To run pseudocode, you first translate it into a real programming language.

How strict are the rules?

Pseudocode

It doesn't follow the syntax rules of any particular language.

A programming language (e.g. Python, Java, C#)

Very strict syntax rules. The code has to follow them exactly.

Tied to one language?

Pseudocode

No. The same pseudocode can be translated into many different languages.

A programming language (e.g. Python, Java, C#)

Yes. Python code is written to Python's rules.

Who is it written for?

Pseudocode

People. Plain language, close to English, so a basic knowledge of programming is enough to read it.

A programming language (e.g. Python, Java, C#)

The computer, which has to follow it exactly.

Computer Science · Algorithms

What do you really think?

You're about to plan an algorithm and a friend offers some advice about pseudocode.

Which piece of advice is closest to what you believe right now?
How sure are you?

Computer Science · Algorithms

Spot the slip

This pseudocode rolls two dice and checks for a double. RANDOM_INT(1, 6) gives a random whole number from 1 to 6. In this style, = stores a value and == compares two values. One line breaks the algorithm. Which one?

A student's pseudocode — which line goes wrong?

Computer Science · Algorithms

Your turn: explain it in words

A programmer plans a new algorithm in pseudocode before writing any real code. Give two reasons for representing the algorithm as pseudocode, and two things the programmer should do before writing it. [4 marks]

0 words · your answer stays on this page and is not sent anywhere.

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 expresses an algorithm independently of any programming language. 'Pseudo' means pretend or fake.
  • A computer can't execute pseudocode directly. It must be translated into a real programming language first.
  • Pseudocode has no set standard, so styles differ. Be consistent and make your meaning clear.
  • Common keywords, often in capitals: INPUT, PRINT, IF … THEN … ELSE, FOR … TO, WHILE.

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 word means 'pretend code': it looks like code, but a computer can't run it until it has been translated into a real language such as Python, Java or C#. There's no set standard, so the style can vary, but it must be consistent and clear. Programmers use it to plan, to check a solution is logical, and to spot errors before writing the final program.

Key points

1Algorithms can be shown as written descriptions, flowcharts or pseudocode. The best one depends on the problem.
2Pseudocode uses plain language to set out an algorithm's steps in a logical order.
3Programming languages have very strict syntax; pseudocode follows no particular language's rules.
4Reasons to use it: close to English, not tied to a language, helps spot and fix errors, a blueprint for the final code.
5Before writing it: understand the problem, abstract the key information, and break it into smaller steps.
6Writing pseudocode first isn't always necessary, for example for a very straightforward task.

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, you have to translate it into a real programming language.

✓

Check yourself

A classmate types their pseudocode into a Python editor and gets an error. Explain what has gone wrong and what they would need to do instead.

Flashcards

(15)
What does the 'pseudo' in pseudocode mean?
Pretend or fake. Pseudocode is 'pretend code': it looks like code but isn't a real programming language.
What is pseudocode?
A way of expressing an algorithm in plain, code-like language that is independent of any specific programming language.
Can a computer execute pseudocode directly?
No. It must first be translated into a real programming language, such as Python, Java or C#.
Name three ways of representing an algorithm.
Written descriptions, flowcharts and pseudocode.
Which is the best way to represent an algorithm?
There's no one best method. The best choice depends on the problem being solved.
How do the rules of pseudocode compare with a programming language's rules?
A programming language has very strict syntax rules. Pseudocode doesn't follow the syntax of any particular language.
Is there one standard style for pseudocode?
No. It has no set standards or conventions (unlike flowcharts), so be consistent and make your meaning clear.
How much programming knowledge do you need to read pseudocode?
Only a basic knowledge. It uses plain language to set out the steps in a logical order.
When might a programmer skip writing pseudocode first?
For a very straightforward task where the code itself is clear enough, or when an experienced programmer already has a strong grasp of the algorithm.
What does != mean?
Not equal to.
In the style used here, what's the difference between = and == ?
= stores a value in a variable. == is the comparison operator: it checks whether two values are equal.
What kind of repetition does FOR … TO give you?
Count-controlled iteration: doing something a set number of times.
What kind of repetition does WHILE give you?
Condition-controlled iteration: repeating as long as a condition is met.
What is a constant?
A value that can't be changed once the program is running.
What does RETURN do at the end of a function?
It hands a value back to the line that called the 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 posted

More Edexcel GCSE Computer Science topics

See the full Edexcel Computer Science curriculum →

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 September 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.