Skip to content
Marlbridge

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.

Level
IGCSE
Topic
Topic 8: Programming
Updated

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

  1. A variable can change; a constant is fixed.
  2. The five data types are INTEGER, REAL, CHAR, STRING and BOOLEAN.
  3. Programs use sequence, selection and iteration.
  4. 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

  1. Draw a table with one column for every variable and one for any output.
  2. Write the starting values on the first row.
  3. Work through the code line by line. Add a new row each time a variable changes.
  4. For a loop, check the condition each time and write down the value that makes it stop.
  5. 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

  1. What is the difference between a variable and a constant?
  2. Which data type should hold a telephone number?
  3. Name the three loop types.
  4. What does MOD(23, 5) return?
  5. What does DIV(23, 5) return?
  6. What does LENGTH("Cambridge") return?
  7. Which loop always runs at least once?
  8. What does a function do that a procedure does not?
  9. What is a local variable?
  10. Why use meaningful identifiers?

Answers

  1. A variable’s value can change; a constant’s value is fixed.
  2. STRING.
  3. Count-controlled (FOR), pre-condition (WHILE), post-condition (REPEAT).
  4. REPEAT … UNTIL.
  5. It returns a value.
  6. A variable that can only be used in the subroutine where it is declared.
  7. 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

More on this topic

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

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.