Declare and use one-dimensional and two-dimensional arrays

IGCSE 0478 – Complete Syllabus Notes

1 Computer Systems (Syllabus 1‑6)

1.1 Number Systems & Data Representation

  • Binary, denary (decimal) and hexadecimal
    • Conversion methods (repeated division, multiplication, grouping of 4 bits)
    • Common binary prefixes: 0b, 0x
    • Overflow & under‑flow in fixed‑width registers (e.g. 8‑bit signed range –128 … 127)
    • Two’s‑complement for negative numbers
    • Logical shifts (<<, >>) vs arithmetic shifts
  • Text representation
    • ASCII (7‑bit) – 128 characters, basic codes 0‑127
    • Unicode (UTF‑8) – variable‑length, supports world scripts
  • Images, sound & video
    • Pixel, colour depth (bits per pixel), resolution (e.g. 1920 × 1080)
    • Sample rate & bit depth for audio (e.g. 44 kHz, 16‑bit)
    • File‑size calculations:
      size (bits) = width × height × colour‑depth
      size (bytes) = size (bits) ÷ 8
    • Lossless vs lossy compression (e.g. PNG vs JPEG)

1.2 Data Storage & Compression

  • Units: bit, byte (8 bits), kilobyte (KB = 2³ = 1024 B), megabyte (MB), gigabyte (GB), terabyte (TB)
  • Primary storage (RAM, cache) – volatile, fast access
  • Secondary storage (HDD, SSD, optical media, magnetic tape) – non‑volatile, larger capacity
  • Virtual memory – paging, address translation
  • Cloud storage – remote servers, redundancy, subscription models

1.3 Data Transmission

  • Transmission media: copper (twisted pair, coaxial), fibre‑optic, wireless (Wi‑Fi, Bluetooth, satellite)
  • Packet structure – header, payload, trailer; error‑detection bits (parity, checksum, CRC)
  • Switching techniques: circuit‑switched, packet‑switched, virtual‑circuit
  • Protocols: TCP/IP, UDP, HTTP/HTTPS, FTP, SMTP
  • Encryption basics – symmetric (AES), asymmetric (RSA), public‑key certificates

1.4 Hardware Architecture

  • CPU components – ALU, control unit, registers, program counter
  • Fetch‑Decode‑Execute (FDE) cycle
  • Multi‑core processors, pipelining, cache hierarchy (L1, L2, L3)
  • Embedded systems – microcontrollers, real‑time constraints
  • Input devices (keyboard, mouse, sensors) & output devices (monitor, printer, actuators)

1.5 Software & Operating Systems

  • System software vs application software
  • Operating system functions: process management, memory management, file system, device drivers, security
  • Interrupts – hardware vs software, priority handling
  • Language translators: assembler, compiler, interpreter, just‑in‑time (JIT) compiler
  • Integrated Development Environments (IDEs) – code editor, debugger, build tools

1.6 Internet & World‑Wide Web

  • Client‑server model, browsers, web servers
  • URL structure, DNS resolution
  • HTTP request/response cycle, status codes, cookies, sessions
  • Secure communication – HTTPS, TLS/SSL handshakes
  • Emerging technologies: IoT, blockchain, digital currencies, AI & robotics

1.7 Cyber‑Security & Emerging Tech (AO3 focus)

  • Common threats: malware, phishing, DDoS, man‑in‑the‑middle
  • Counter‑measures: firewalls, anti‑virus, authentication, hashing, digital signatures
  • Ethical considerations – privacy, data protection (GDPR), digital footprints

2 Algorithms, Programming & Logic (Syllabus 7‑10)

2.1 Algorithm Design Cycle (AO2)

  1. Analyse the problem – identify inputs, outputs, constraints.
  2. Design – choose appropriate structures (flowchart, structure diagram, pseudocode).
  3. Develop – write the code or detailed pseudocode.
  4. Test – trace tables, boundary testing, validation & verification.
  5. Document – comments, naming conventions, complexity notes.

2.2 Pseudocode Conventions (Official Cambridge Syntax)

  • Upper‑case reserved words (DECLARE, SET, IF, THEN, END IF, FOR, FROM, TO, END FOR, WHILE, END WHILE, REPEAT, UNTIL, END REPEAT).
  • Indentation to show block structure; optional line numbers for reference.
  • Comments start with // or /* … */.
  • Array notation: name[lower:upper] for one‑dimensional, name[lowerR:upperR, lowerC:upperC] for two‑dimensional.
  • Meta‑variables (e.g. i, j, total) are declared before use.

2.3 Flowcharts & Structure Diagrams

SymbolNamePurpose
ProcessAssign/compute a value
DecisionTrue/false test (IF)
LoopFOR, WHILE, REPEAT
Input/OutputREAD, PRINT
Start/EndProgram boundaries

2.4 Programming Constructs (Java‑style examples, applicable to all languages)

Selection (IF / SWITCH)
// IF…THEN…ELSE
IF score >= 40 THEN
    SET result TO "Pass"
ELSE
    SET result TO "Fail"
END IF
Iteration
  • FOR loop – known number of repetitions
  • WHILE loop – repeat while a condition is true
  • REPEAT…UNTIL – execute at least once, stop when condition becomes true
// FOR loop counting 1‑10
FOR i FROM 1 TO 10
    OUTPUT i
END FOR

// WHILE loop summing until total ≥ 100
SET total TO 0
WHILE total < 100 DO
    SET total TO total + 5
END WHILE
Procedures & Functions
PROCEDURE displayArray(arr : ARRAY[1:5] OF INTEGER)
    FOR i FROM 1 TO 5
        OUTPUT arr[i]
    END FOR
END PROCEDURE

FUNCTION max(a : INTEGER, b : INTEGER) RETURNS INTEGER
    IF a > b THEN
        RETURN a
    ELSE
        RETURN b
    END IF
END FUNCTION
String Handling (required for AO2)
DECLARE name : STRING
SET name TO "Cambridge"
OUTPUT "Length = ", LENGTH(name)          // 9
OUTPUT "Uppercase = ", UPPERCASE(name)   // CAMBRIDGE
OUTPUT "First three = ", SUBSTRING(name,1,3) // Cam

2.5 One‑Dimensional Arrays (Fully Covered in Original Notes)

  • Declaration, initialisation, indexing (lower bound 1 in pseudocode, 0 in Java/C/Python).
  • Common operations: total, average, maximum, searching, counting.
  • Example – highest mark (pseudocode and Java shown).

2.6 Two‑Dimensional Arrays

  • Declaration with explicit row/column bounds.
  • Initialisation with literals or nested loops.
  • Access using array[row][col] (Java) or array[row,col] (pseudocode).
  • Nested loops for traversal; handling ragged arrays where rows differ in length.

2.7 Boolean Logic & Digital Circuits (AO1‑AO3)

GateSymbolTruth Table
AND & A B | A&B
0 0 → 0
0 1 → 0
1 0 → 0
1 1 → 1
OR | A B | A|B
0 0 → 0
0 1 → 1
1 0 → 1
1 1 → 1
NOT ~ A | ~A
0 → 1
1 → 0
XOR A B | A⊕B
0 0 → 0
0 1 → 1
1 0 → 1
1 1 → 0

Use Boolean algebra to simplify expressions, e.g. (A & B) | (A & ~B) = A.

2.8 Databases & Basic SQL (AO2)

  • Table structure – fields, records, primary key.
  • Data types: INTEGER, REAL, CHAR(n), VARCHAR(n), DATE.
  • Simple SQL statements:
    -- Select all marks for a given class
    SELECT student_id, mark
    FROM Marks
    WHERE class = '10A'
    ORDER BY mark DESC;
    
    -- Total and average marks
    SELECT SUM(mark) AS total, AVG(mark) AS average
    FROM Marks;
    
    -- Count of students who passed
    SELECT COUNT(*) AS passed
    FROM Marks
    WHERE mark >= 40;
    

2.9 Testing, Validation & Verification (AO2)

  • Validation – does the program meet the specification? Use test cases that cover normal, boundary and error conditions.
  • Verification – does the code correctly implement the algorithm? Use trace tables or step‑through debugging.
  • Typical test data for arrays:
    • Minimum size (e.g., 1 element)
    • Maximum size allowed by the exam (e.g., 10 or 20)
    • All identical values, all zeros, mixed positive/negative (if allowed)

2.10 Assessment Objective Mapping (Quick Reference)

AOWhat It AssessesRelevant Topics
AO1Recall of factual knowledgeNumber systems, hardware components, Boolean gates, array syntax, SQL keywords.
AO2Application of knowledge to solve problemsAlgorithm design, pseudocode, flowcharts, programming constructs, array manipulation, SQL queries.
AO3Evaluation & justificationChoosing appropriate data structures, comparing storage media, discussing security measures, analysing algorithm efficiency.

3 Sample Exam‑Style Questions (All Topics)

3.1 Number‑System Conversion (AO1)

Convert the binary number 10110110₂ to (a) decimal, (b) hexadecimal.

3.2 Array Algorithm (AO2)

DECLARE temps : ARRAY[1:7] OF INTEGER
DECLARE i, total, avg : INTEGER

SET total TO 0
FOR i FROM 1 TO 7
    INPUT temps[i]
    SET total TO total + temps[i]
END FOR
SET avg TO total DIV 7
OUTPUT "Average temperature = ", avg

3.3 Boolean Logic Evaluation (AO1‑AO2)

Given A = 1, B = 0, evaluate (A AND NOT B) OR (A XOR B).

3.4 SQL Query (AO2)

Write an SQL statement to list the names of all students who scored above the class average in the table Results(student_name, mark).

3.5 Evaluation Question (AO3)

Discuss the advantages and disadvantages of using a two‑dimensional array to store a timetable compared with a list of records (e.g., a database table).

4 Key Take‑aways (Summary)

  1. Understand the fundamental hardware and software components that make up a computer system.
  2. Master number‑system conversions and data‑representation techniques for text, images, and sound.
  3. Know how data is stored, transmitted and secured – essential for AO3 evaluation.
  4. Follow the algorithm design cycle: analyse, design (flowchart/pseudocode), develop, test, document.
  5. Write clear, correctly indented pseudocode using Cambridge’s official syntax.
  6. Use selection, iteration, procedures, functions, and arrays effectively; remember index bases (0 vs 1).
  7. Apply Boolean logic to simplify conditions and to design simple digital circuits.
  8. Construct basic relational tables and retrieve information with SQL SELECT statements.
  9. Always test with boundary and error data; produce trace tables to verify correctness.
  10. When answering exam questions, link your solution to the relevant AO (knowledge, application, evaluation).

Create an account or Login to take a Quiz

37 views
0 improvement suggestions

Log in to suggest improvements to this note.