Here are comprehensive **IGCSE Computer Science (0478) Notes** on **Pseudocode**, including
all required elements from the 2025 syllabus:
---
## 📌 **Pseudocode (IGCSE 0478 Notes)**
### 🔹 What is Pseudocode?
Pseudocode is a **simplified, informal language** used to design algorithms. It is **not an actual
programming language** but helps describe the **logical steps** of a solution clearly before
implementing it in code.
---
## 📑 **Basic Pseudocode Syntax**
| Concept | Syntax Example |
| ------------------------- | --------------------------- |
| **Variable declaration** | `x ← 0` |
| **Input** | `INPUT x` |
| **Output** | `OUTPUT x` |
| **Assignment** | `x ← 5` |
| **Comment** | `// This is a comment` |
| **Arithmetic operations** | `+, -, *, /, ^` |
| **String concatenation** | `firstname + " " + surname` |
---
## 🔁 **Branching and Selection**
Branching is about making **decisions** in your algorithm. Also known as **selection**, it allows
your program to follow **different paths** depending on conditions.
### ✅ **Types of Branching/Selection**
| Type | Structure | Example
|
| ----------------------------- | ---------------------------------------------------- |
----------------------------------------------------------------------------------------- |
| **IF...THEN** | Basic condition | `IF x > 0 THEN OUTPUT "Positive"`
|
| **IF...THEN...ELSE** | Dual-path condition | `IF x > 0 THEN OUTPUT
"Positive" ELSE OUTPUT "Not positive"` |
| **IF...THEN...ELSEIF...ELSE** | Multi-path condition | `IF x > 0 THEN OUTPUT
"Positive" ELSE IF x = 0 THEN OUTPUT "Zero" ELSE OUTPUT "Negative"` |
| **CASE...OF...OTHERWISE** | Switch-style branching (better for multiple choices) | `CASE grade
OF "A": OUTPUT "Excellent" "B": OUTPUT "Good" OTHERWISE: OUTPUT "Needs work"` |
---
## 🧠 **Conditional Statements**
Conditional statements are instructions that run **only when a condition is true**.
### 📐 **Structure of Conditional Statements**
```text
IF condition THEN
// statements
ELSE
// other statements
ENDIF
```
### 🧾 Example:
```text
INPUT age
IF age >= 18 THEN
OUTPUT "You are an adult"
ELSE
OUTPUT "You are underage"
ENDIF
```
---
## 🧪 **Test Data Types & Their Definitions**
Test data is used to **evaluate whether a program works correctly**. Three main types exist:
| Type | Definition | Example |
| ----------------------- | ------------------------------------------------- | ------------------------------------- |
| **Normal** | Valid input that is expected during regular use | Input: 50 for age check
(range 0–100) |
| **Boundary (Extreme)** | Values at the **edges** of valid ranges | Input: 0 and 100 for age
range test |
| **Invalid (Erroneous)** | Inputs that should be **rejected** by the program | Input: "hello" for a
numeric field |
---
## 🐞 **Errors in Pseudocode**
Pseudocode errors can be:
### 1. **Syntax Errors**
* Caused by writing code that breaks the rules of pseudocode.
* Example: `IF x > 5 OUTPUT x` ← missing `THEN`
### 2. **Logical Errors**
* Code runs, but gives incorrect results due to wrong logic.
* Example: Using `x = 5` instead of `x > 5` in a decision.
### 3. **Runtime Errors**
* Errors that happen during execution (less common in pseudocode unless simulated).
* Example: Trying to divide by zero.
---
## 🧩 **Extra Examples for Practice**
### Example 1: Grade Checker
```text
INPUT score
IF score >= 80 THEN
OUTPUT "Distinction"
ELSE IF score >= 60 THEN
OUTPUT "Merit"
ELSE
OUTPUT "Pass"
ENDIF
```
### Example 2: Login Check
```text
INPUT username
INPUT password
IF username = "admin" AND password = "1234" THEN
OUTPUT "Access Granted"
ELSE
OUTPUT "Access Denied"
ENDIF
```
---
## 🎓 Exam Tips
✅ Use correct syntax (`IF`, `THEN`, `ENDIF`, `CASE`, etc.)
✅ Watch out for **logic** mistakes in selection
✅ When testing, include **all 3 types of test data**
✅ Know how to correct both **syntax** and **logic** errors
✅ Be familiar with **indentation** and **structure** — even in pseudocode!
---
Would you like a diagram or flowchart version of this as well?