Write precise pseudocode
Turn a design into ordered, unambiguous instructions using conditions, assignments and outputs.
Section 7 · Algorithm design and problem-solving
Exam scope and assessment notes
This sequence follows Cambridge IGCSE Computer Science 0984, 2026–2028 syllabus Version 4. It covers subject content Topic 7 only. The separately published 2029–2031 syllabus is not mapped here. Practice is original, self-checked and does not award an official Cambridge grade. Full timed papers and human subject-teacher review remain outstanding. Cambridge states that 0984 has the same 2026–2028 subject content as 0478, with 9–1 grading. In June and November, Cambridge lists 0984 in Administrative zone 3 and for centres in Oman and the UAE. Confirm availability for your centre and exam series with Cambridge International. The separately published 2029–2031 syllabus changes to Python 3 only and removes pseudocode; this 2026–2028 route does not cover those changes.
Before you begin
- No programming language is required. Be comfortable with place value and multiplication; each lesson introduces the computer-science notation it uses.
Work on paper. Try each question before revealing help, and explain why your method works.
Quick readiness check
Which is more precise in pseudocode?
What you will learn
- Use assignment and comparison precisely
- Indent nested instructions consistently
- Write a pseudocode plan that can be tested
Pseudocode expresses algorithm logic
Pseudocode describes the steps of an algorithm without committing to a particular programming language. Use clear input, assignment, selection, iteration and output statements in the required order.
Apply and check the rule
Be precise: write a comparison such as Score > BestScore rather than prose like “score is greater than the best score”. Indent nested actions consistently and make each branch and loop endpoint clear so another person can trace the instructions.
Pause and explain
What should happen to nested pseudocode instructions?
Worked example
Write pseudocode logic that displays “Adult” for Age >= 18 and “Under 18” otherwise.
Show the worked solution
- Input Age.
- Test the condition Age >= 18.
- Output one result in each branch.
Answer INPUT Age; IF Age >= 18 THEN OUTPUT "Adult" ELSE OUTPUT "Under 18" ENDIF.
Try a topic test
Choose Easy, Normal or Difficult. Save your answers and open worked review after finishing.
Test this topic →From guided practice to a new situation
Write your answer and reasoning first. Use a hint only if you are stuck. The model solution is for self-checking; your written work is not automatically marked.
Write one precise comparison that is True when Quantity is at least 5 and at most 20.
Give me a hint
Use inclusive operators at both endpoints.
Compare my reasoning
- The lower comparison is Quantity >= 5.
- The upper comparison is Quantity <= 20.
- Both conditions must be True.
Quantity >= 5 AND Quantity <= 20.
Look for these in your work
- Lower bound
- Upper bound
- AND
A design says “if the account has enough money, subtract the cost.” Rewrite the decision precisely using Balance and Cost.
Give me a hint
Define what enough means and what changes after the check.
Compare my reasoning
- Check Balance >= Cost.
- If True, calculate Balance ← Balance − Cost.
- Otherwise, display a message that funds are insufficient.
IF Balance >= Cost THEN Balance ← Balance − Cost ELSE OUTPUT "Insufficient funds" ENDIF.
Look for these in your work
- Condition
- Correct assignment
- Alternative result
A pseudocode routine contains IF Score >= 50 THEN, but both the pass and fail outputs are indented under THEN. Explain the error and correct the branch structure.
Give me a hint
The ELSE path must be separate from the THEN path.
Compare my reasoning
- The current structure outputs both messages when the condition is True.
- Move the failure output under ELSE.
- Close the condition after both mutually exclusive branches.
Use IF Score >= 50 THEN OUTPUT "Pass" ELSE OUTPUT "Not pass" ENDIF so only the matching result is produced.
Look for these in your work
- Behavioural error
- Mutual exclusion
- Correct structure
Common mistakes
- Using prose where a precise comparison is required
- Forgetting to close a selection or loop
What can you explain now?
Why should a comparison be written precisely?
Compare with the explanation
So its true and false outcomes are unambiguous
Precise operators allow a programmer to implement and test the intended rule.
After trying it yourself, choose your next review. This is your self-assessment.
Your review choice appears on Today. Sign in to sync it across devices.
Make it stick
What makes a pseudocode comparison or branch precise enough to implement?
If you needed the solution, close it and solve the problem again from a blank page. A correct answer is stronger when you can explain the reason for each step.