Revision Notes
Cambridge IGCSE Computer Science (0478): Programming concepts – Revision Notes
Revision notes for Cambridge IGCSE Computer Science 0478 section 8.1: pseudocode keywords, data types, selection, loops, operators, procedures, functions and library routines.
- Subject
- Computer Science
- Level
- IGCSE
- Topic
- Topic 8: Programming
- Author
- Marlbridge Academic Team
- Updated
- Reviewed by
- Harris Khan (what this means)
Aligned to Cambridge IGCSE Computer Science (0478), 2026-2028. Official specification .
Syllabus page (what it covers and how it is assessed): Cambridge IGCSE Computer Science.
Syllabus points this page covers
0478
- 8.1 Programming concepts
This page covers 1 of the 3 subtopics in topic 8, Programming.
Found an error? Report a correction.
Need help with this topic? Request a free trial class for IGCSE Computer Science (0478).
Condensed notes for syllabus section 8.1, Programming concepts, with the pseudocode forms used in the examination.
Four facts to start with
- A variable can change; a constant is fixed.
- The five data types are INTEGER, REAL, CHAR, STRING and BOOLEAN.
- Programs use sequence, selection and iteration.
- A function returns a value; a procedure does not.
Key terms
| Term | Definition |
|---|---|
| Variable | Named memory location whose value can change |
| Constant | Named value that does not change |
| Iteration | Repeating a set of statements |
| Counting | Adding 1 each time an event happens |
| Totalling | Adding values to a running total |
| Procedure | Named block of code that performs a task |
| Function | Named block of code that returns a value |
| Parameter | Value passed to a subroutine |
| Local variable | Only usable in the subroutine where it is declared |
| Global variable | Usable anywhere in the program |
Pseudocode cheat sheet
| Task | Form |
|---|---|
| Declare | DECLARE Count : INTEGER |
| Constant | CONSTANT Rate ← 6.50 |
| Assign | Count ← Count + 1 |
| Input / output | INPUT Name, OUTPUT "Total ", Total |
| Selection | IF ... THEN ... ELSE ... ENDIF |
| Multi-way | CASE OF ... ENDCASE |
| Count-controlled loop | FOR Index ← 1 TO 10 ... NEXT Index |
| Pre-condition loop | WHILE ... DO ... ENDWHILE |
| Post-condition loop | REPEAT ... UNTIL ... |
| Procedure | PROCEDURE Name(P : INTEGER) ... ENDPROCEDURE, CALL Name(5) |
| Function | FUNCTION Name(P : INTEGER) RETURNS INTEGER ... RETURN ... ENDFUNCTION |
Data types
| Type | Example |
|---|---|
| INTEGER | 7 |
| REAL | 7.0 |
| CHAR | 'a' |
| STRING | "abc" |
| BOOLEAN | TRUE |
Operators
| Group | Operators |
|---|---|
| Arithmetic | + - * / ^ MOD DIV |
| Relational | = < <= > >= <> |
| Logical | AND OR NOT |
DIV(17, 5) is 3, MOD(17, 5) is 2.
Loops compared
| FOR | WHILE | REPEAT | |
|---|---|---|---|
| Test position | Counter | Start | End |
| Minimum runs | 0 if start > end | 0 | 1 |
| Use | Known number | Unknown, may be none | Unknown, at least once |
String handling
LENGTH("Hello") is 5. SUBSTRING("Hello", 2, 3) is "ell". UCASE("hello") is "HELLO".
Library routines
ROUND(3.14159, 2) is 3.14. RANDOM() gives a number from 0 to 1. ROUND(RANDOM() * 10, 0) gives a whole number from 0 to 10.
Worked example: trace table
Number ← 1
Count ← 0
REPEAT
Number ← Number * 2
Count ← Count + 1
UNTIL Number > 50
| Number | Count |
|---|---|
| 2 | 1 |
| 4 | 2 |
| 8 | 3 |
| 16 | 4 |
| 32 | 5 |
| 64 | 6 |
The loop stops when Number is 64 (greater than 50), with Count = 6.
Maintainability checklist
- Meaningful identifiers.
- Comments starting
//. - Procedures and functions for repeated tasks.
- Constants for fixed values.
- Indentation for loops and selections.
Choosing the right loop
| Situation | Loop |
|---|---|
| Ask for exactly 10 numbers | FOR |
| Keep reading until the user types 0 | REPEAT ... UNTIL or WHILE |
| Check input is valid, asking again if not | REPEAT ... UNTIL |
| Process a list only if it is not empty | WHILE |
Worked example: validation loop
REPEAT
INPUT Age
UNTIL Age >= 0 AND Age <= 120
The question is asked at least once. It repeats while the age is below 0 or above 120. With inputs -5, 150, 14 the loop runs three times and finishes with Age = 14.
How to dry-run code in the exam
- Draw a table with one column for every variable and one for any output.
- Write the starting values on the first row.
- Work through the code line by line. Add a new row each time a variable changes.
- For a loop, check the condition each time and write down the value that makes it stop.
- Read the final values and the output from the table, not from memory.
Exam traps
- No initialisation. Set totals and counters to 0.
- Wrong loop. WHILE may never run; REPEAT always runs once.
=for assignment. Use←.- CALL on a function. Not used.
- Phone number as INTEGER. Use STRING.
- Off by one. Check start and end values.
Self-test
- What is the difference between a variable and a constant?
- Which data type should hold a telephone number?
- Name the three loop types.
- What does
MOD(23, 5)return? - What does
DIV(23, 5)return? - What does
LENGTH("Cambridge")return? - Which loop always runs at least once?
- What does a function do that a procedure does not?
- What is a local variable?
- Why use meaningful identifiers?
Answers
- A variable’s value can change; a constant’s value is fixed.
- STRING.
- Count-controlled (FOR), pre-condition (WHILE), post-condition (REPEAT).
-
-
-
- REPEAT … UNTIL.
- It returns a value.
- A variable that can only be used in the subroutine where it is declared.
- They make the program easier to read, understand and maintain.
Command words to expect
| Command word | What to write |
|---|---|
| State, Give, Identify | A short answer with no explanation |
| Define | A precise meaning |
| Describe | The main points or characteristics, or the steps in order |
| Explain | A reason or “how and why”, supported with evidence from the question |
| Compare | Similarities and differences, naming both sides every time |
| Suggest | A sensible proposal that applies your knowledge to the situation given |
| Evaluate | A judgement based on advantages and disadvantages, ending with a conclusion |
Read the full explanations in the Programming concepts study guide, then try the Programming concepts practice questions.
Official syllabus
Cambridge IGCSE Computer Science (0478) syllabus for 2026, 2027 and 2028, section 8.1: official syllabus PDF.
Related resources
-
Study guides
Cambridge IGCSE Computer Science (0478): Programming – Study Guide
Variables, data types, selection, iteration, string handling, procedures and functions, arrays and file handling in Cambridge pseudocode for IGCSE 0478.
Computer Science · Cambridge · IGCSE
Read guide -
Study guides
Cambridge IGCSE Computer Science (0478): Arrays
Study guide to Cambridge IGCSE Computer Science 0478 section 8.2: declaring and using one-dimensional and two-dimensional arrays, using variables as indexes, and reading and writing arrays with iteration and nested iteration.
Computer Science · Cambridge · IGCSE
Read guide -
Practice questions
Cambridge IGCSE Computer Science (0478): Arrays – Practice Questions
Original questions with full answers on Cambridge IGCSE Computer Science 0478 section 8.2: 1D and 2D arrays, loops, totals, searching and trace tables.
Computer Science · Cambridge · IGCSE
Try questions
Get free revision emails (optional)
Occasional emails with practice questions, worked explanations and links to free resources for the qualification and subjects you choose. No spam, and you can unsubscribe from any email. The free tools on this site never need an email.