Understand and use sequence, selection, and iteration

Cambridge IGCSE Computer Science (0478) – Complete Syllabus Notes (2026‑28)

This set of notes covers all required sub‑topics for Topics 1‑10 of the Cambridge IGCSE Computer Science (0478) syllabus. It is written in the Cambridge‑style pseudocode conventions, includes clear examples, tables, and test‑data strategies, and highlights the limits imposed by the syllabus (e.g., parameters, nesting depth, circuit inputs).


1. Algorithm Design & Problem Solving (Topic 7)

  • Four‑stage problem‑solving cycle (PDLC)
    1. Analysis – understand the problem, list inputs, outputs, constraints, and any validation required.
    2. Design – decompose the problem into sub‑problems, produce a structure diagram and a clear algorithm (flowchart + pseudocode).
    3. Coding – translate the algorithm into pseudocode (or a programming language).
    4. Testing & Evaluation – verify correctness (validation) and improve the solution (verification).
  • Decomposition – break a large problem into smaller, manageable parts. Each part can be expressed as a separate procedure/function.
  • Structure diagram – a hierarchical block diagram that shows the main program and its sub‑routines. Example:
    +-------------------+
    |   Main Program    |
    +-------------------+
    |  Initialise()    |
    |  GetData()       |
    |  ProcessData()   |
    |  OutputResult()  |
    +-------------------+
            
  • Trace tables – record the values of variables after each step of an algorithm. Example for a FOR loop that adds the numbers 1‑5:
    Stepisum
    Initialise0
    1st iteration10 + 1 = 1
    2nd iteration21 + 2 = 3
    3rd iteration33 + 3 = 6
    4th iteration46 + 4 = 10
    5th iteration510 + 5 = 15
    Loop ends15
  • Validation vs. Verification
    • Validation – checks that input data are sensible (type, range, format). Example:
      // Validate age input
      READ age
      IF age < 0 OR age > 120 THEN
          PRINT "Invalid age"
          STOP
      END IF
                      
    • Verification – confirms that the program does what the specification requires. Use test‑data categories:
      • Normal data – typical values within the expected range.
      • Boundary data – values at the limits (e.g., 0 and 120 for age).
      • Extreme/invalid data – outside the limits or wrong type (e.g., –5, 999, “abc”).

2. Core Programming Concepts (Topic 8)

2.1 Variables, Constants & Data Types

  • Variables – named storage locations whose values can change. Types required:
    • INTEGER – whole numbers.
    • REAL – numbers with a decimal point.
    • BOOLEAN – TRUE or FALSE.
    • CHARACTER – a single character.
    • STRING – a sequence of characters.
  • Constants – values that never change during execution. Declared with the CONST keyword and written in ALL CAPS:
    CONST MAX_STUDENTS ← 30
    CONST TAX_RATE ← 0.20
            
  • Commenting & Indentation
    • Comments begin with // and are ignored by the interpreter.
    • Indent one level (four spaces) for each block inside IF, FOR, WHILE, etc.
    // Calculate average mark
    FOR i ← 1 TO n DO
        total ← total + marks[i]
    END FOR
    average ← total / n
            

2.2 Operators

CategoryOperator(s)Example
Arithmetic+, –, *, /, %area ← length * width
Relational=, ≠, <, >, ≤, ≥IF score ≥ 50 THEN …
LogicalAND, OR, NOTIF age ≥ 18 AND citizen = TRUE THEN …

2.3 Input / Output

  • READ variable – obtains a value from the user.
  • PRINT … – displays text and/or variable values.
  • Multiple items can be printed in one statement, separated by commas.

2.4 Procedures & Functions

  • Reusable blocks of code. Syllabus limits:
    • Maximum 2 parameters per routine.
    • Maximum 3 levels of nesting** (e.g., a loop inside an IF inside another loop).
  • Syntax (Cambridge style):
    // Procedure – no return value
    PROCEDURE DisplayHeader()
        PRINT "=== STUDENT MARKS ==="
    END PROCEDURE
    
    // Function – returns a value
    FUNCTION Max(a, b) RETURNS INTEGER
        IF a > b THEN
            RETURN a
        ELSE
            RETURN b
        END IF
    END FUNCTION
            

2.5 Pseudocode Conventions (Cambridge style)

IF condition THEN
    statements
END IF

IF condition THEN
    statements1
ELSE
    statements2
END IF

IF cond1 THEN
    statements1
ELSE IF cond2 THEN
    statements2
ELSE
    statements3
END IF

FOR i ← start TO end STEP step DO
    statements
END FOR

WHILE condition DO
    statements
END WHILE

REPEAT
    statements
UNTIL condition

3. Control Structures – Sequence, Selection, Iteration

3.1 Sequence

The default flow of a program – each statement is executed once, top to bottom, unless a later control structure changes the order.

3.2 Selection (Decision Making)

Allows a program to choose actions based on a Boolean condition.

FormPseudocodeTypical Use
Simple IF
IF condition THEN
    statements
END IF
Execute a block only when the condition is true.
IF‑ELSE
IF condition THEN
    statements1
ELSE
    statements2
END IF
Choose between two alternatives.
Nested selection
IF cond1 THEN
    IF cond2 THEN
        statements
    END IF
END IF
Decision inside another decision (max 3 levels).
Multiple selection (ELSE IF)
IF cond1 THEN
    statements1
ELSE IF cond2 THEN
    statements2
ELSE
    statements3
END IF
More than two alternatives.

3.3 Iteration (Loops)

Repeats a block of statements. Choose the loop type that best matches the known information about the number of repetitions.

Loop typePseudocodeWhen to use
WHILE (pre‑test)
WHILE condition DO
    statements
END WHILE
Number of repetitions unknown; loop may execute zero times.
FOR (counter‑controlled)
FOR i ← start TO end STEP step DO
    statements
END FOR
Exact number of repetitions known; i is the loop counter.
REPEAT‑UNTIL (post‑test)
REPEAT
    statements
UNTIL condition
Loop must execute at least once.

4. Arrays (Topic 8)

  • Only **one‑dimensional arrays** are required for IGCSE.
  • Declaration syntax (Cambridge style):
    DECLARE Scores : ARRAY[1:10] OF INTEGER   // 10 elements, indexed 1‑10
            
  • Accessing elements – use Scores[i] where i is an integer within the declared bounds.
  • Typical iteration – reading values into an array:
    FOR i ← 1 TO 10 DO
        READ Scores[i]
    END FOR
            
  • Common array operations
    • Find maximum:
      max ← Scores[1]
      FOR i ← 2 TO 10 DO
          IF Scores[i] > max THEN
              max ← Scores[i]
          END IF
      END FOR
                  
    • Calculate average:
      total ← 0
      FOR i ← 1 TO 10 DO
          total ← total + Scores[i]
      END FOR
      average ← total / 10
                      
    • Search for a value:
      found ← FALSE
      FOR i ← 1 TO 10 DO
          IF Scores[i] = target THEN
              found ← TRUE
              EXIT FOR
          END IF
      END FOR
                      

5. File Handling (Topic 8)

Cambridge pseudocode distinguishes between INPUT (reading) and OUTPUT (writing) modes. A file must be opened before any read/write operation and closed afterwards.

StatementPurpose
OPEN file_name FOR INPUTOpen an existing text file for reading.
OPEN file_name FOR OUTPUTCreate a new file (or overwrite an existing one) for writing.
READ file_name, variableRead the next record from the file into variable.
WRITE file_name, variableWrite the value of variable as a new record.
CLOSE file_nameClose the file and release the resource.

Example – Store 5 marks in a file and then display them:

// Write marks to file
OPEN "marks.txt" FOR OUTPUT
FOR i ← 1 TO 5 DO
    READ mark
    WRITE "marks.txt", mark
END FOR
CLOSE "marks.txt"

// Read marks back and display
OPEN "marks.txt" FOR INPUT
FOR i ← 1 TO 5 DO
    READ "marks.txt", mark
    PRINT "Mark", i, "=", mark
END FOR
CLOSE "marks.txt"

6. Databases & SQL (Topic 9)

6.1 Defining a Single‑Table Database

  • A table consists of fields (columns) and records (rows).
  • Each field has a name and a data type (INTEGER, REAL, CHAR, VARCHAR, BOOLEAN).
  • One field must be designated as the primary key – it uniquely identifies each record.

Example – Table definition (Cambridge style description)

Table: Students
Fields:
    StudentID : INTEGER   // Primary key, >0, unique
    Name      : VARCHAR(30)
    Age       : INTEGER   // 5 ≤ Age ≤ 120
    Mark      : INTEGER   // 0 ≤ Mark ≤ 100

6.2 Basic SQL Statements

PurposeSQL (Cambridge style)
List all records ordered by a fieldSELECT * FROM Students ORDER BY Mark DESC;
Count records that meet a conditionSELECT COUNT(*) FROM Students WHERE Mark ≥ 80;
Sum a numeric fieldSELECT SUM(Mark) FROM Students;
Find a specific recordSELECT * FROM Students WHERE StudentID = 3;
Insert a new recordINSERT INTO Students (StudentID, Name, Age, Mark) VALUES (4, 'David', 17, 73);
Update a fieldUPDATE Students SET Mark = 88 WHERE StudentID = 2;
Delete a recordDELETE FROM Students WHERE StudentID = 5;

6.3 Validation Rules for Tables

  • Field‑level validation (e.g., Age must be between 5 and 120).
  • Primary‑key uniqueness is automatically enforced.
  • Data‑type consistency – a VARCHAR field cannot store a numeric value without conversion.

7. Boolean Logic & Logic‑Gate Circuits (Topic 9)

7.1 Logical Operators & Truth Tables

OperatorSymbolResult
ANDTRUE only when both operands are TRUE
ORTRUE when at least one operand is TRUE
NOT¬Inverts the operand

7.2 Building Circuits from Boolean Expressions

  • Each gate can have **a maximum of three inputs** (as required by the syllabus).
  • Example – XOR expressed as (A AND NOT B) OR (B AND NOT A):
    A ──► AND ──► OR ──► Output
          │          │
          NOT B      B
                    │
                    NOT A
            
  • To simplify an expression, use Boolean algebra rules (e.g., De Morgan’s laws, absorption).

7.3 Writing Expressions from Truth Tables

Given a truth table, write the minimal Boolean expression and then draw the corresponding circuit.

Exercise – Complete the truth table for (A AND NOT B) OR (B AND NOT A). The completed table is the XOR function:

ABNOT BA AND NOT BNOT AB AND NOT AResult
0010100
0100111
1011001
1100000

8. Data Representation (Topic 9)

  • Binary ↔ Decimal – each binary digit (bit) represents a power of 2.
    Decimal 13 = 1·2³ + 1·2² + 0·2¹ + 1·2⁰ → 1101₂
            
  • Binary ↔ Hexadecimal – group binary digits in fours (nibbles).
    1011 1100₂ = BC₁₆
            
  • Two’s‑complement (signed integers) – used to represent negative numbers.
    +7  = 0000 0111₂
    -7  = invert bits → 1111 1000₂
          add 1      → 1111 1001₂
            
  • Floating‑point (real numbers) – stored in scientific notation: ± mantissa × 2^exponent. IGCSE expects only a conceptual understanding.

9. Computer Systems (Topics 1‑6)

9.1 Hardware

  • CPU – central processing unit; performs arithmetic, logic, control, and I/O operations.
  • Memory
    • RAM – volatile, stores data and instructions while a program runs.
    • ROM – non‑volatile, stores firmware.
  • Storage devices – magnetic (HDD), solid‑state (SSD), optical (CD/DVD), and flash (USB).
  • Input devices – keyboard, mouse, scanner, microphone.
  • Output devices – monitor, printer, speaker.

9.2 Software

  • System software – operating system (OS) manages hardware resources.
  • Application software – programs that perform specific tasks (e.g., word processor, database).
  • Utility software – antivirus, backup, file‑compression tools.

9.3 Data Representation & Communication

  • Characters are stored using ASCII (7‑bit) or Unicode (16‑bit). Example: 'A' = 65₁₀ = 01000001₂.
  • Images: raster (bitmap) vs. vector; colour depth expressed in bits per pixel.
  • Sound: sampled at a rate (e.g., 44 kHz) and stored with a bit depth (e.g., 16‑bit).
  • Network basics – LAN, WAN, Internet, protocols (TCP/IP, HTTP, FTP).

9.4 Networking & Cyber‑Security

  • Common network topologies: star, bus, ring.
  • Security measures: firewalls, encryption, authentication, anti‑malware.
  • Legal and ethical issues – copyright, data protection, responsible use.

9.5 Automated Technologies

  • Embedded systems – microcontrollers in appliances, vehicles, and IoT devices.
  • Robotics – sensors, actuators, and control algorithms.
  • Artificial intelligence basics – rule‑based systems, machine learning concepts.

10. Summary of Key Limits Imposed by the Syllabus

  • Maximum 2 parameters per procedure/function.
  • Maximum 3 levels of nesting** (loops/selection inside another).
  • Arrays are limited to one dimension and index range must be specified.
  • Logic‑gate circuits may have up to three inputs per gate.
  • All pseudocode must use the exact keywords and indentation rules shown above.

Useful Revision Checklist

  1. Can you write a complete PDLC for a given problem?
  2. Can you produce a structure diagram and translate it into pseudocode?
  3. Are you comfortable with the correct declaration syntax for variables, constants, arrays, and files?
  4. Do you know the exact limits on parameters and nesting depth?
  5. Can you design and trace IF‑ELSE, FOR, WHILE and REPEAT‑UNTIL loops?
  6. Can you write, read, and close files correctly?
  7. Can you define a single‑table database, choose appropriate field types, and write basic SQL statements?
  8. Can you construct truth tables, simplify Boolean expressions, and draw the corresponding gate circuits (max 3 inputs per gate)?
  9. Do you understand binary, hexadecimal, two’s‑complement, and basic floating‑point concepts?
  10. Are you familiar with the hardware, software, networking, and security concepts listed in Topics 1‑6?

Use this checklist to identify any weak areas before the exam. Good luck!

Create an account or Login to take a Quiz

52 views
0 improvement suggestions

Log in to suggest improvements to this note.