| Component | Role | Typical Exam Example |
|---|---|---|
| CPU (ALU, control unit, registers) | Executes instructions, performs arithmetic/logic. | Explain the fetch‑decode‑execute cycle. |
| Memory hierarchy | Registers → Cache → RAM → Secondary storage. | Why RAM is faster than a hard‑disk. |
| I/O devices | Input (keyboard, mouse, scanner) & output (monitor, printer, speaker). | Identify an example of an analogue‑to‑digital converter. |
| Operating system | Manages resources, provides interface, handles files. | State two OS functions. |
| Symbol | Name | Purpose |
|---|---|---|
| ▭ | Process | Assignment, arithmetic, input/output. |
| ◇ | Decision | True/false test (IF). |
| ▶︎ | Start/End | Oval – marks the program’s boundaries. |
| ⇐▶︎ | Connector | Joins separated parts of a large diagram. |
| ⎕ | Input/Output | Parallelogram – read or display data. |
// or are enclosed in /* … */.mark, total, studentName).
IF condition1 THEN
… // statements for condition1
ELSE IF condition2 THEN
… // statements for condition2
ELSE
… // default case
END IF
FOR i ← 1 TO n DO … END FOR
WHILE condition DO … END WHILE
REPEAT … UNTIL condition
// 1‑D array of 10 integers DECLARE scores[10] AS INTEGER // 2‑D array – 3 rows, 4 columns DECLARE board[3][4] AS INTEGER
OPEN "results.txt" FOR WRITE AS f WRITE f, "Alice", 85 CLOSE f
OPEN, CLOSE, READ, WRITE, APPEND.SELECT name, mark FROM students WHERE mark >= 70 ORDER BY mark DESC;
Typical AO2 tasks: write a SELECT statement, identify the primary key, or describe the purpose of a WHERE clause.
| A | B | A AND B | A OR B | NOT A |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 1 |
| 0 | 1 | 0 | 1 | 1 |
| 1 | 0 | 0 | 1 | 0 |
| 1 | 1 | 1 | 1 | 0 |
Gate symbols (AND, OR, NOT) are often required for circuit‑drawing questions.
| Section | AO1 (knowledge) | AO2 (application) | AO3 (evaluation) |
|---|---|---|---|
| Data representation | ✓ | ||
| Hardware & software | ✓ | ||
| Networks & internet | ✓ | ||
| Emerging tech | ✓ | ||
| Flow‑chart symbols | ✓ | ✓ | |
| Pseudocode conventions | ✓ | ✓ | |
| Selection & iteration | ✓ | ✓ | |
| Arrays & nested loops | ✓ | ✓ | |
| File handling | ✓ | ✓ | |
| Database & SQL | ✓ | ✓ | |
| Boolean logic & truth tables | ✓ | ✓ | |
| Standard algorithms | ✓ | ✓ | |
| Validation checks | ✓ | ✓ | ✓ |
| Verification techniques | ✓ | ✓ | ✓ |
Before the main algorithm runs, the program must be sure that the data it receives satisfies the constraints set by the problem. Without validation the program may:
| Check | Description | Typical Exam Example |
|---|---|---|
| Type | Is the input an integer, real, character string, etc.? | Mark must be an INTEGER. |
| Range | Does the value lie between a lower and upper bound? | 0 ≤ mark ≤ 100. |
| Format | Does the input follow a pattern (date, time, ISBN, email)? | DD/MM/YYYY. |
| Presence | Is a required field left empty? | Student name cannot be blank. |
| Check‑digit | Arithmetic rule that validates a code (ISBN, bar‑code, credit‑card). | ISBN‑10 check‑digit formula. |
READ isbn // expects 10 characters
IF LENGTH(isbn) ≠ 10 THEN
WRITE "ISBN must be 10 characters"
STOP
END IF
sum ← 0
FOR i ← 1 TO 9 DO
digit ← NUMERIC_VALUE(isbn[i]) // 0‑9
sum ← sum + i * digit
END FOR
check ← (11 - (sum MOD 11)) MOD 11
IF check = 10 THEN
expected ← 'X'
ELSE
expected ← CHAR(check + 48) // convert to character
END IF
IF isbn[10] = expected THEN
WRITE "ISBN is valid"
ELSE
WRITE "ISBN is invalid"
END IF
Verification confirms that, **given only valid inputs**, the algorithm always produces the correct output. It does not test the handling of bad data – that is the role of validation.
| Category | Purpose | Typical Example (Mark 0‑100) |
|---|---|---|
| Normal | Typical value inside the range. | 73 |
| Abnormal | Correct type but outside the permitted range. | -5 or 120 |
| Boundary | Exact limits of the range. | 0 and 100 |
| Extreme | Largest/smallest valid values that stress the algorithm (e.g., very large n for a loop). | n = 0, n = 1000 (if allowed) |
| Step | mark | Condition Tested | grade |
|---|---|---|---|
| 1 | 85 | mark ≥ 80 | A |
| 2 | 73 | mark ≥ 80 ? No → mark ≥ 70 | B |
| 3 | 66 | … ≥ 60 | C |
| 4 | 52 | … ≥ 50 | D |
| 5 | 38 | None of the above | F |
total ← 0
FOR i ← 1 TO n‑1 DO // ❌ should be TO n
total ← total + i
END FOR
How to locate:
n (e.g., 5).i = 4, giving total = 10 instead of 15.FOR i ← 1 TO n DO.Write a program that reads a student’s numeric mark (0‑100) and outputs the corresponding grade (A‑F). Include validation of the input and verify the algorithm with appropriate test data.
// 1. Type check – assume READ returns an integer; if not, the exam will state “integer input”.
READ mark
IF mark < 0 OR mark > 100 THEN
WRITE "Error: mark must be between 0 and 100"
STOP
END IF
IF mark ≥ 80 THEN
grade ← 'A'
ELSE IF mark ≥ 70 THEN
grade ← 'B'
ELSE IF mark ≥ 60 THEN
grade ← 'C'
ELSE IF mark ≥ 50 THEN
grade ← 'D'
ELSE
grade ← 'F'
END IF
WRITE "Grade:", grade
| Line | mark | Test | grade |
|---|---|---|---|
| 1 | 73 | mark ≥ 80 ? No | |
| 2 | 73 | mark ≥ 70 ? Yes | B |
// validation and // main algorithm comments – they earn marks for clarity.
Create an account or Login to take a Quiz
Log in to suggest improvements to this note.
Your generous donation helps us continue providing free Cambridge IGCSE & A-Level resources, past papers, syllabus notes, revision questions, and high-quality online tutoring to students across Kenya.