A complete printable guide to Information Technology for Grade 12 - practical Delphi programming and theory.
SQL (pronounced "S-Q-L" or "sequel") is the language used to communicate with a database. It lets you retrieve, add, update and delete records. In Delphi, SQL is added to a TADOQuery component.
Think of a database as a massive spreadsheet with thousands of rows. SQL is how you ask the database a question: "Give me all students in Grade 12 with a mark above 80, sorted by surname." Without SQL, you would have to scroll through every row manually.
SQL goes into the SQL property of a TADOQuery component. Always close the query before changing the SQL, then open it again.
// Method 1: assign as one string
qryStudents.Close;
qryStudents.SQL.Text := 'SELECT * FROM tblStudents WHERE Grade = 12';
qryStudents.Open;
// Method 2: build line-by-line (easier to read for long queries)
qryStudents.Close;
qryStudents.SQL.Clear;
qryStudents.SQL.Add('SELECT Name, Surname, Mark');
qryStudents.SQL.Add('FROM tblStudents');
qryStudents.SQL.Add('WHERE Grade = 12');
qryStudents.SQL.Add('ORDER BY Surname ASC');
qryStudents.Open;SELECT * FROM tblCD; -- all fields, all records
SELECT CDName, Artist FROM tblCD; -- only these two fields
SELECT DISTINCT Genre FROM tblCD; -- each genre shown once only
SELECT TOP 5 * FROM tblCD; -- first 5 records onlyThe WHERE clause is how you filter — like asking "show me only the records that match this condition."
WHERE Genre = "Rock" -- exact match (text in double quotes)
WHERE Price < 100 -- numbers (no quotes)
WHERE Grade <> 11 -- not equal
WHERE Mark >= 50 -- greater than or equal
WHERE Genre = "Pop" AND Price < 100 -- both must be true
WHERE Genre = "Pop" OR Genre = "Rock" -- either can be trueWhen a WHERE clause mixes AND and OR, SQL doesn't just evaluate left to right — it follows a fixed order of precedence, same as in maths:
| Order | Operator(s) |
|---|---|
| 1 (first) | Parentheses ( ) |
| 2 | Multiplication, division |
| 3 | Subtraction, addition |
| 4 | NOT |
| 5 | AND |
| 6 (last) | OR |
AND is evaluated before OR, so a mixed condition may not filter the way you expect unless you add brackets to force the order you want.
WHERE Genre = "Pop" OR Genre = "Rock" AND Price < 100
-- reads as: Genre = "Pop" OR (Genre = "Rock" AND Price < 100)
-- ALL Pop CDs are included, regardless of price!
-- To make BOTH genres respect the price limit, use brackets:
WHERE (Genre = "Pop" OR Genre = "Rock") AND Price < 100You don't have to memorise the precedence table if you always wrap OR conditions in brackets when combining them with AND. Brackets make your intention explicit and remove any ambiguity — for the reader and for the database.
| Operator | Meaning | Example |
|---|---|---|
LIKE | Pattern match. % = any chars, _ = one char | WHERE Name LIKE "S%" — starts with S |
IN | Match any value in a list | WHERE Genre IN ("Rock","Pop","Jazz") |
BETWEEN | Within a range (inclusive for numbers) | WHERE Price BETWEEN 50 AND 150 |
IS NULL | Field is empty/blank | WHERE CellNo IS NULL |
IS NOT NULL | Field has a value | WHERE CellNo IS NOT NULL |
#date# | Date values use # symbols | WHERE OrderDate = #2024-05-01# |
Access SQL can misinterpret a date written as dd/mm/yyyy, reading it as month/day/year instead. Writing the year first removes the ambiguity: prefer #2024/05/01# (yyyy/mm/dd) over #01/05/2024#.
WHERE CDName LIKE "S%" -- starts with S
WHERE CDName LIKE "%love%" -- contains the word "love"
WHERE CDName LIKE "%s" -- ends with s
WHERE Code LIKE "A__" -- starts with A followed by exactly 2 charsSELECT * FROM tblCD ORDER BY Artist; -- ascending (default)
SELECT * FROM tblCD ORDER BY Price DESC; -- most expensive first
SELECT * FROM tblCD ORDER BY Genre, CDName ASC; -- sort by genre, then nameYou can do maths inside a SELECT and give the result a name using AS.
SELECT Name, Price, Price * 1.15 AS PriceWithVAT FROM tblProducts;
SELECT Name, Mark, ROUND(Mark / 2, 0) AS HalfMark FROM tblStudents;| Function | What it calculates | Example |
|---|---|---|
COUNT(*) | Number of records | SELECT COUNT(*) FROM tblStudents |
SUM(field) | Total of numeric field | SELECT SUM(Mark) FROM tblResults |
AVG(field) | Average of numeric field | SELECT AVG(Mark) FROM tblResults |
MIN(field) | Lowest value | SELECT MIN(Price) FROM tblProducts |
MAX(field) | Highest value | SELECT MAX(Price) FROM tblProducts |
-- Count students per grade
SELECT Grade, COUNT(*) AS Total
FROM tblStudents
GROUP BY Grade;
-- Only show groups with more than 10 students
SELECT Grade, COUNT(*) AS Total
FROM tblStudents
GROUP BY Grade
HAVING COUNT(*) > 10;WHERE filters individual records before grouping. HAVING filters groups after GROUP BY. If you have both, WHERE runs first.
| Function | Returns | Example |
|---|---|---|
LEN(field) | Character count | SELECT LEN(Name) FROM tblStudents |
LEFT(field, n) | First n characters | LEFT(Surname, 3) → first 3 letters |
RIGHT(field, n) | Last n characters | RIGHT(IDNo, 4) |
MID(field, start, n) | Substring from position | MID(IDNo, 3, 2) → month of birth (position 1–2 is the year) |
ROUND(field, dec) | Rounded value | ROUND(Avg, 2) → 2 decimal places |
INT(field) | Integer part (no decimal) | INT(75.8) = 75 |
FORMAT(field, "0.00") | Formatted string | FORMAT(Price, "R0.00") |
SELECT Name, YEAR(BirthDate) AS BirthYear FROM tblStudents;
SELECT * FROM tblOrders WHERE MONTH(OrderDate) = 12; -- December orders
SELECT * FROM tblStudents WHERE YEAR(BirthDate) = 2008;-- Add a new record
INSERT INTO tblStudents (Name, Surname, Grade)
VALUES ("Alice", "Smith", 12);
-- Change existing data
UPDATE tblStudents
SET Grade = 12
WHERE StudentID = 45;
-- Remove a record
DELETE FROM tblStudents
WHERE StudentID = 45;Without a WHERE clause, UPDATE changes every record and DELETE removes every record in the table. Always double-check your condition.
Instead of a parameterised query, you will sometimes build the whole SQL statement as one string by joining Delphi variables onto it directly. Text values need quotes around them in the final SQL string — the QuotedStr function wraps a string value in quotes for you, so you don't have to type them by hand.
qryStudents.Close;
qryStudents.SQL.Text := 'INSERT INTO tblStudents (Name, Surname) VALUES (' +
QuotedStr(edtName.Text) + ', ' + QuotedStr(edtSurname.Text) + ')';
qryStudents.ExecSQL; // use ExecSQL (not Open) for INSERT/UPDATE/DELETE — they don't return recordsQuotedStr is a quick way to build a query from a string variable, but a parameterised query (below) is the safer, preferred technique — it avoids manually matching quotes and is more resistant to SQL injection.
Instead of hardcoding a value, use a parameter that is filled in by the user at runtime.
qryStudents.Close;
qryStudents.SQL.Clear;
qryStudents.SQL.Add('SELECT * FROM tblStudents');
qryStudents.SQL.Add('WHERE Grade = :pGrade'); // :pGrade is the parameter
qryStudents.Parameters.ParamByName('pGrade').Value := sedGrade.Value;
qryStudents.Open;// Read a field value from the current record
sName := qryStudents['Name'];
iGrade := qryStudents['Grade'];
rMark := qryStudents['Average'];
// Loop through all records
qryStudents.First;
while not qryStudents.Eof do
begin
memOut.Lines.Add(qryStudents['Name'] + ' ' + qryStudents['Surname']);
qryStudents.Next;
end;A classic Paper 1 task: the user types (part of) a surname into edtSearch and clicks a button. The program must build a parameterised query from that input, run it, list every match in memOut, and report how many were found. This combines user input, SQL, looping a dataset and string output.
procedure TfrmMain.btnSearchClick(Sender: TObject);
var
iFound : integer;
begin
memOut.Clear;
iFound := 0;
// 1. Build a parameterised query from the user's input
qryStudents.Close;
qryStudents.SQL.Clear;
qryStudents.SQL.Add('SELECT Name, Surname, Grade, Average');
qryStudents.SQL.Add('FROM tblStudents');
qryStudents.SQL.Add('WHERE Surname LIKE :pName');
qryStudents.SQL.Add('ORDER BY Surname ASC');
// add a wildcard so 'coe' matches 'Coetzee'
qryStudents.Parameters.ParamByName('pName').Value := edtSearch.Text + '%';
qryStudents.Open;
// 2. Loop through the result set and display each record
qryStudents.First;
while not qryStudents.Eof do
begin
memOut.Lines.Add(qryStudents['Name'] + ' ' + qryStudents['Surname']
+ ' (Gr ' + IntToStr(qryStudents['Grade'])
+ ', ' + FloatToStrF(qryStudents['Average'], ffFixed, 4, 1) + '%)');
Inc(iFound);
qryStudents.Next;
end;
// 3. Report how many were found
if iFound = 0 then
ShowMessage('No learner found starting with "' + edtSearch.Text + '".')
else
lblCount.Caption := IntToStr(iFound) + ' learner(s) found';
end;Using :pName and ParamByName is safer and cleaner than gluing the user's text straight into the SQL string — it avoids quote/type errors and blocks SQL injection (see Cybercrime). The wildcard '%' is added to the value, so a partial surname still matches.
In SA IT CAPS, joining two tables is done using the WHERE clause method — listing both tables in FROM and linking them with a matching condition in WHERE. This is the only join method required for CAPS.
The official SA IT CAPS specifies the WHERE method for single joins. The CAPS document states: “Create a join query (single joins) using WHERE”. Do NOT use the INNER JOIN keyword in exams.
A relational database splits related data across tables. For example, a student record stores a ClassID but the class name lives in a separate table. To display both together, you join the tables.
SELECT TableA.Field1, TableB.Field2
FROM TableA, TableB
WHERE TableA.KeyField = TableB.KeyField;Both tables appear in FROM, separated by a comma. The WHERE clause links the tables on their shared key field.
SELECT tblStudents.Name, tblStudents.Surname, tblClasses.ClassName
FROM tblStudents, tblClasses
WHERE tblStudents.ClassID = tblClasses.ClassID;SELECT tblStudents.Name, tblStudents.Surname, tblClasses.ClassName
FROM tblStudents, tblClasses
WHERE tblStudents.ClassID = tblClasses.ClassID
AND tblStudents.Grade = 12
ORDER BY tblStudents.Surname ASC;Use AND after the join condition to filter results further. The join condition always comes first in WHERE.
SELECT tblClasses.ClassName, COUNT(tblStudents.StudentID) AS Total
FROM tblStudents, tblClasses
WHERE tblStudents.ClassID = tblClasses.ClassID
GROUP BY tblClasses.ClassName
ORDER BY Total DESC;SELECT tblBooks.Title, tblAuthors.AuthorName, tblBooks.Price
FROM tblBooks, tblAuthors
WHERE tblBooks.AuthorID = tblAuthors.AuthorID
AND tblBooks.Title LIKE "IT%"
ORDER BY tblBooks.Price DESC;qryData.Close;
qryData.SQL.Clear;
qryData.SQL.Add('SELECT tblStudents.Name, tblStudents.Surname, tblClasses.ClassName');
qryData.SQL.Add('FROM tblStudents, tblClasses');
qryData.SQL.Add('WHERE tblStudents.ClassID = tblClasses.ClassID');
qryData.SQL.Add('AND tblStudents.Grade = 12');
qryData.Open;If you list two tables in FROM but omit the WHERE link condition, SQL returns every possible combination of rows (a Cartesian product). For two tables with 100 rows each, this produces 10,000 rows — all incorrect. Always include WHERE TableA.Key = TableB.Key.
| Mistake | Effect | Fix |
|---|---|---|
| Missing join condition in WHERE | Cartesian product (massive wrong result) | Always link: WHERE tblA.Key = tblB.Key |
Ambiguous field name (e.g. just Name when both tables have it) | SQL error | Always prefix: tblStudents.Name |
Not calling qryData.Close before changing SQL | Runtime error | Always close first |
OOP lets you model real-world things as objects in code. Think of a class as a blueprint (like architectural plans for a house) and an object as the actual building made from that plan. One blueprint, many buildings — one class, many objects.
Every part of OOP maps neatly onto a taxi:
StartEngine, Drive, Stop, PickUp, DropOff, Hoot.TVehicle, then adds its own meter and passenger seats.Hoot and each does it its own way — a sedan taxi beeps, a minibus blares.
| Term | Definition |
|---|---|
| Class | A blueprint or template that describes what an object looks like and can do |
| Object | A specific instance of a class (like one particular cat — Whiskers) |
| Attribute | A variable that stores data about the object (e.g. fName, fAge) |
| Method | A procedure or function that belongs to the class (e.g. GetName, SetAge) |
| Constructor | Special method Create that creates an instance and sets initial values |
| Encapsulation | Hiding private data inside a class; only accessible through public methods |
| Inheritance | A new class inherits all attributes and methods of an existing (parent) class |
| Polymorphism | The same method name behaves differently in different classes |
In Delphi, every component is an object. TButton is a class; btnOK is an object. TForm is a class; Form1 is an object. OOP lets you create your own custom classes.
A class is defined once. You can create as many objects (instances) from it as you need — each with its own data.
Before coding a class, design it using a UML (Unified Modeling Language) diagram — a rectangle divided into 3 sections.
Keep attributes private — hidden from the outside world. Only expose them through controlled public methods (getters and setters). This protects data from accidental or invalid changes.
private
fName: string; // hidden from outside — direct access blocked
public
procedure SetName(s: string); // controlled write access (can include validation)
function GetName: string; // controlled read accessA child class inherits all attributes and methods from a parent class, and can add or override its own. This avoids repeating code.
type
TAnimal = class
procedure Speak; virtual; // can be overridden in child classes
end;
TDog = class(TAnimal) // inherits everything from TAnimal
procedure Speak; override; // replaces TAnimal.Speak
end;
TCat = class(TAnimal)
procedure Speak; override;
end;The same method name (Speak) behaves differently depending on the type of object. "Many forms" — poly = many, morph = form.
| Object | Method Called | Result |
|---|---|---|
objAnimal.Speak | TAnimal.Speak | 'Animal sound...' |
objDog.Speak | TDog.Speak (overridden) | 'Woof!' |
objCat.Speak | TCat.Speak (overridden) | 'Meow!' |
procedure TAnimal.Speak;
begin
ShowMessage('Animal sound...');
end;
procedure TDog.Speak;
begin
ShowMessage('Woof!');
end;
procedure TCat.Speak;
begin
ShowMessage('Meow!');
end;| Method Type | Keyword | Description |
|---|---|---|
| Constructor | constructor | Creates the object and sets initial attribute values. Called on the class name: TCat.Create(...) |
| Accessor (getter) | function | Returns the value of a private attribute. Read-only access. |
| Mutator (setter) | procedure | Updates the value of a private attribute. Can include validation. |
| ToString | function | Returns a string representation of the object's state — used for display. |
| Auxiliary | private | Internal helper methods used by other methods, not accessible from outside. |
An auxiliary method is a private helper that does one small job for an accessor or mutator, so that method doesn't get cluttered with extra logic. It takes the data it's given, processes it, and returns the result — it never changes the object's attributes itself. Using auxiliary methods reduces complexity inside a class and keeps each method focused on a single task.
private
function FormatWeight(rWeight: real): string; // auxiliary — helper only, not called from outside the class
public
function ToString: string;
// ...
function TCat.FormatWeight(rWeight: real): string;
begin
Result := FloatToStrF(rWeight, ffFixed, 4, 1) + 'kg'; // just formats — doesn't change fWeight
end;
function TCat.ToString: string;
begin
Result := fName + ', ' + FormatWeight(fWeight); // ToString calls the auxiliary method
end;UCar.pas).interface section (see template below).implementation section.uses clause (e.g. uses ..., UCar;).After writing the class declaration in the interface section, press Ctrl+Shift+C and Delphi automatically creates all the empty method implementations in the implementation section. You just fill in the code.
unit UCat;
interface
type
TCat = class
private
fName : string;
fAge : integer;
fWeight : real;
public
constructor Create(sName: string; iAge: integer; rWeight: real);
function GetName : string;
function GetAge : integer;
function GetWeight : real;
procedure SetName(sNew: string);
function ToString : string;
end;
implementation
constructor TCat.Create(sName: string; iAge: integer; rWeight: real);
begin
fName := sName;
fAge := iAge;
fWeight := rWeight;
end;
function TCat.GetName : string;
begin
Result := fName;
end;
function TCat.GetAge : integer;
begin
Result := fAge;
end;
function TCat.GetWeight : real;
begin
Result := fWeight;
end;
procedure TCat.SetName(sNew: string);
begin
fName := sNew;
end;
function TCat.ToString : string;
begin
Result := fName + ', Age: ' + IntToStr(fAge)
+ ', Weight: ' + FloatToStr(fWeight) + 'kg';
end;
end.This is the kind of class you will write in a Grade 12 exam. Study the pattern carefully — constructor, accessors, mutator, ToString.
unit UCar;
interface
type
TCar = class
private
fMake : string; // e.g. 'Toyota'
fYear : integer; // e.g. 2022
public
constructor Create(sMake: string; iYear: integer);
function GetMake : string;
function GetYear : integer;
procedure SetMake(sNewMake: string);
function ToString : string;
end;
implementation
constructor TCar.Create(sMake: string; iYear: integer);
begin
fMake := sMake;
fYear := iYear;
end;
function TCar.GetMake : string;
begin
Result := fMake;
end;
function TCar.GetYear : integer;
begin
Result := fYear;
end;
procedure TCar.SetMake(sNewMake: string);
begin
fMake := sNewMake; // could add validation here (e.g. check not empty)
end;
function TCar.ToString : string;
begin
Result := fMake + ' (' + IntToStr(fYear) + ')';
// Output example: 'Toyota (2022)'
end;
end.// 1. Add UCar to uses clause of the main form
uses
..., UCar;
// 2. Declare object variable (global or local)
var
objCar : TCar;
// 3. Create the object — in a button click or FormCreate
objCar := TCar.Create('Toyota', 2022);
// 4. Read values using accessors
lblMake.Caption := objCar.GetMake; // 'Toyota'
lblYear.Caption := IntToStr(objCar.GetYear); // '2022'
memOut.Lines.Add(objCar.ToString); // 'Toyota (2022)'
// 5. Update a value using mutator
objCar.SetMake('Honda');
lblMake.Caption := objCar.GetMake; // 'Honda'
Always call Create before using any other method. The object does not exist until it is created. Also make sure the class unit name is in the uses clause of your main form.
uses
..., UCat;
var
objCat : TCat;
// Create the object
objCat := TCat.Create('Whiskers', 3, 4.2);
// Use its accessors
lblName.Caption := objCat.GetName; // 'Whiskers'
lblAge.Caption := IntToStr(objCat.GetAge); // '3'
memOut.Lines.Add(objCat.ToString); // 'Whiskers, Age: 3, Weight: 4.2kg'
// Update via mutator
objCat.SetName('Felix');
lblName.Caption := objCat.GetName; // 'Felix'You already know that every Delphi control is an object of a class (a button is a TButton, a label is a TLabel). Because they are classes, you can create them in code while the program is running using the same Create constructor you use for your own classes — instead of dragging them onto the form at design time.
This is called creating a dynamic component. It is useful when you don't know in advance how many controls you need (e.g. one button per record loaded from a file).
var
btnDynamic : TButton;
begin
// 1. Create the object (Form1 is the owner – frees it automatically)
btnDynamic := TButton.Create(Form1);
// 2. Set the Parent so it appears on the form
btnDynamic.Parent := Form1;
// 3. Set properties
btnDynamic.Left := 50;
btnDynamic.Top := 50;
btnDynamic.Width := 100;
btnDynamic.Height := 30;
btnDynamic.Caption := 'Click Me';
// 4. Assign an event handler (a procedure you wrote)
btnDynamic.OnClick := btnDynamicClick;
end;
// The handler the button will run when clicked
procedure TForm1.btnDynamicClick(Sender: TObject);
begin
ShowMessage('Dynamic button clicked!');
end;Owner (the argument to Create) is responsible for freeing the component from memory when the form closes. Parent decides where on screen the component is drawn. They are usually the same form, but not always (e.g. Owner = Form, Parent = a Panel on that form).
If you create a component with Create(nil) (no owner), you must free it yourself with btnDynamic.Free; when you are done, otherwise it stays in memory. Passing the form as the owner lets Delphi clean up for you automatically.
A two-dimensional array stores data in a grid of rows and columns — like a table or spreadsheet. Each element is accessed using two indices: [row, column].
A two-dimensional (2D) array is a single variable that stores many values arranged in a grid of rows and columns. Where an ordinary (one-dimensional) array is like a single shopping list running down the page, a 2D array is like a whole spreadsheet — a block of cells where every value sits at the crossing point of a row and a column.
Analogy: think of a spreadsheet such as Excel. To find a cell you give a column letter and a row number — for example C5. A 2D array works exactly the same way, except we use two numbers: the first for the row and the second for the column. So myArray[2,3] means "the value in row 2, column 3", just like clicking one cell in a grid.
We use 2D arrays to store tables of data that naturally have rows and columns — for example a class register of marks where each row is a learner and each column is a subject, a seating plan, a noughts-and-crosses board, or temperatures recorded for each day across several weeks. One neat variable holds the whole table instead of dozens of separate variables.
mark1, mark2, mark3 … you keep every mark in one organised grid.Before you can use a 2D array you must declare it, telling Delphi how many rows and columns it has and what type of data each cell holds. You give two ranges in the square brackets: the first range is the rows and the second is the columns.
var
arrName : array [rowStart..rowEnd, colStart..colEnd] of DataType;var
myArray : array [1..2, 1..3] of Integer;The example above creates a grid with 2 rows and 3 columns, giving 6 integer cells in total. Note: the ranges can start at any number, but in CAPS we almost always start at 1 so that "row 1" really is the first row.
The table below shows how the index numbers map onto the grid. Read it like a spreadsheet: pick a row down the side and a column across the top, and the cell where they meet is the array element you are referring to.
| Col 1 | Col 2 | Col 3 | |
|---|---|---|---|
| Row 1 | myArray[1,1] | myArray[1,2] | myArray[1,3] |
| Row 2 | myArray[2,1] | myArray[2,2] | myArray[2,3] |
Populating means putting values into the cells. There are two common ways: assigning each cell one by one (fine for a few known values), or using nested loops to fill the whole grid quickly.
Here we set each cell directly by naming its row and column. This is clear but tedious — imagine doing it for a 30 × 6 register. Use it only when you have a handful of specific values to place.
myArray[1,1] := 10; myArray[1,2] := 20; myArray[1,3] := 30;
myArray[2,1] := 40; myArray[2,2] := 50; myArray[2,3] := 60;This is the technique you will use most often. The outer loop moves through the rows; for each row the inner loop moves through every column. The result is that the inner loop runs completely for each turn of the outer loop, so the code visits every cell, one full row at a time — exactly like reading a spreadsheet left-to-right, then dropping down to the next line.
var
myArray : array [1..3, 1..4] of Integer;
r, c : Integer;
begin
for r := 1 to 3 do
for c := 1 to 4 do
myArray[r, c] := r * c; // e.g. row 2, col 3 = 6
end;To show the grid neatly we again use nested loops, but this time we build up one line of text per row. For each row we start with an empty string, add every column value to it (padding each so the columns line up), and only then add the finished line to the memo. Important Rule: the line is built inside the inner loop but written out in the outer loop — that is what keeps each row on its own line.
var
sLine: string;
r, c: Integer;
begin
memOut.Clear;
for r := 1 to 3 do
begin
sLine := '';
for c := 1 to 4 do
sLine := sLine + IntToStr(myArray[r,c]).PadLeft(5);
memOut.Lines.Add(sLine);
end;
end;A big reason for using a grid is to add things up. The trick is knowing which index to fix and which to vary. If you think of the class register again: a row total is one learner's marks added across all subjects, while a column total is one subject's marks added across all learners.
To total a single row we fix the row number (here row 1) and let the column index c change. The loop walks across that one row, adding each cell to a running total. This answers "what is everything in this row added together?" — for example one learner's total mark.
iTotal := 0;
for c := 1 to 4 do
iTotal := iTotal + myArray[1, c];Now we do the opposite: we fix the column number (here column 2) and let the row index r change. The loop runs straight down that one column, adding each cell. This answers "what is everything in this column added together?" — for example the total of all learners' marks for one subject.
iTotal := 0;
for r := 1 to 3 do
iTotal := iTotal + myArray[r, 2];To add up every cell in the whole grid we need nested loops again — the outer loop for rows, the inner loop for columns — so the running total picks up each cell exactly once. This is how you would work out the grand total of all marks for the entire class across all subjects.
iTotal := 0;
for r := 1 to 3 do
for c := 1 to 4 do
iTotal := iTotal + myArray[r, c];A full exam question ties the pieces together: a 2D array of marks, a parallel 1D array of names, nested loops, and both a row and a column calculation. Here the grid arrMark holds marks for each learner (rows) across 4 subjects (columns), and arrName holds the matching learner names.
const
LEARNERS = 5;
SUBJECTS = 4;
var
arrMark : array[1..LEARNERS, 1..SUBJECTS] of Integer; // the grid: row = learner, col = subject
arrName : array[1..LEARNERS] of string; // parallel to the rowsarrName[r] is the name of the learner whose marks are in arrMark[r, 1..SUBJECTS] — the name array runs parallel to the rows of the grid.
Fix the row (one learner) and loop across the columns to total their subjects, then divide.
var
r, c, iRowTotal : Integer;
rAvg : Real;
begin
for r := 1 to LEARNERS do
begin
iRowTotal := 0;
for c := 1 to SUBJECTS do
iRowTotal := iRowTotal + arrMark[r, c];
rAvg := iRowTotal / SUBJECTS;
memOut.Lines.Add(arrName[r] + ': ' +
FloatToStrF(rAvg, ffFixed, 4, 1) + '%');
end;
end;Now fix each column (one subject) and loop down the rows to average that subject across all learners, keeping track of the highest.
var
r, c, iColTotal, iBestCol : Integer;
rColAvg, rBestAvg : Real;
begin
iBestCol := 1;
rBestAvg := 0;
for c := 1 to SUBJECTS do
begin
iColTotal := 0;
for r := 1 to LEARNERS do
iColTotal := iColTotal + arrMark[r, c];
rColAvg := iColTotal / LEARNERS;
if rColAvg > rBestAvg then
begin
rBestAvg := rColAvg;
iBestCol := c; // remember WHICH subject
end;
end;
ShowMessage('Best subject: column ' + IntToStr(iBestCol) +
' (average ' + FloatToStrF(rBestAvg, ffFixed, 4, 1) + '%)');
end;Row calculation → fix the row, loop the columns (one learner across all subjects). Column calculation → fix the column, loop the rows (one subject down all learners). To find a "best/worst", store the index as you go — that index links straight back to the parallel arrName.
Recursion is when a function or procedure calls itself repeatedly until a base condition is met. It is a powerful technique for problems that can be broken down into smaller versions of the same problem.
Recursion is when a function calls itself to solve a smaller version of the same problem, again and again, until the problem becomes so small it can be answered directly.
Analogy: picture a set of Russian nesting dolls. You open the biggest doll and find a smaller doll inside, open that and find a smaller one still, and you keep going until you reach the tiny doll that does not open. Recursion works the same way — each call opens up a slightly smaller version of the problem, and the smallest doll (the one that does not open) is the point where you stop.
A recursive routine is one that calls itself. Every recursive solution must have two parts:
A recursive function without a base case will call itself forever, causing a stack overflow error and crashing the program.
Factorial of n (written n!) = n × (n-1) × (n-2) × … × 1. Example: 5! = 5 × 4 × 3 × 2 × 1 = 120
function Factorial(n: Integer): Integer;
begin
if n <= 1 then // base case: factorial of 0 or 1 is 1
Result := 1
else // recursive case
Result := n * Factorial(n - 1);
end;
// Calling it:
lblResult.Caption := IntToStr(Factorial(5)); // = 120Factorial(4)
= 4 * Factorial(3)
= 3 * Factorial(2)
= 2 * Factorial(1)
= 1 ← base case reached
= 2 * 1 = 2
= 3 * 2 = 6
= 4 * 6 = 24function SumToN(n: Integer): Integer;
begin
if n <= 0 then
Result := 0 // base case
else
Result := n + SumToN(n - 1); // recursive case
end;
// SumToN(4) = 4 + 3 + 2 + 1 + 0 = 10function PowerOf(base, exp: Integer): Integer;
begin
if exp = 0 then
Result := 1 // base case: x^0 = 1
else
Result := base * PowerOf(base, exp - 1); // recursive
end;
// PowerOf(2, 4) = 2*2*2*2 = 16Each number is the sum of the previous two: 0, 1, 1, 2, 3, 5, 8, 13…
function Fibonacci(n: Integer): Integer;
begin
if n <= 1 then
Result := n // base cases: F(0)=0, F(1)=1
else
Result := Fibonacci(n - 1) + Fibonacci(n - 2);
end;| Recursion | Iteration (loop) | |
|---|---|---|
| How it works | Function calls itself | Loop repeats a block |
| Code clarity | Often more elegant for naturally recursive problems | Usually easier to trace and debug |
| Memory use | Uses call stack (risk of stack overflow for large n) | Constant memory use |
| Speed | Can be slower due to function call overhead | Generally faster |
| Best for | Tree traversal, divide-and-conquer algorithms | Simple counting and totalling |
Modern databases are fed by many automated data collection methods. Large organisations store historical data in warehouses for analysis and decision-making.
Data collection is the process of gathering raw facts and figures from many different sources so that they can be stored, processed and turned into useful information. In the old days a person sat with a clipboard and wrote everything down by hand. Today most data is collected automatically — every time you swipe a card, drive under an e-toll gantry or tap a website, data is being captured about you without anyone writing a single thing.
A database is only as good as the data inside it. The more accurate, complete and up-to-date the collected data is, the better the decisions an organisation can make. Automated collection means more data, collected faster, with fewer human mistakes.
Example: When you scan your Pick n Pay Smart Shopper card at the till, the shop instantly records what you bought, when, where and for how much — that single swipe feeds a database that the shop later uses to send you targeted specials.
| Method | Description | Example |
|---|---|---|
| Forms (manual) | User types data directly into a form | School registration, job application |
| Web forms | Online interactive pages with GUI components (dropdowns, checkboxes) | Online survey, account sign-up |
| RFID tags | Wireless chips store ID data, read without contact | Library books, inventory, e-toll, access cards |
| Digital sensors | Gather environmental data automatically | Temperature sensors, motion detectors |
| Cookies | Small files stored by websites to record browsing behaviour and preferences | Login sessions, shopping carts, ad targeting |
| Transaction tracking | Records each purchase: date, time, location, product, amount | Credit card transactions, loyalty cards |
| Mobile apps | Collect app usage, location, device data | Uber location tracking, fitness app steps |
| Type | Description | Example |
|---|---|---|
| Static | Fixed, does not change once recorded | Address of a shop, GPS coordinates of a landmark |
| Dynamic | Changes as the object moves, updated continuously | Uber driver location, delivery truck tracking |
A data warehouse is a large central storage system that collects and consolidates historical data from many separate source databases into one single place, so that it can be analysed for trends and decision-making.
Think of it like this: a normal database is like the till at one Pick n Pay branch — it records today's sales as they happen. A data warehouse is like head office in Cape Town, where the sales from every branch in the country, going back many years, are all poured into one giant store. Head office does not use this to ring up a sale; they use it to spot the big picture — which products sell best in winter, which branches are growing, where to open the next store.
Central – one single store that brings many sources together.
Historical – it keeps years of old data, not just today's transactions.
Read-mostly – data is loaded in and then read for reports; it is not constantly changed.
Subject-oriented – organised around topics like "sales" or "customers" for easy analysis.
Note: Because a warehouse holds so much data from so many sources, the data must first be cleaned and put into a consistent format before it is loaded in — otherwise the same customer might appear three different ways and the analysis would be wrong.
| Database | Data Warehouse | |
|---|---|---|
| Purpose | Day-to-day transactions | Historical analysis and reporting |
| Data | Current transactions only | Historical data from many sources |
| Operations | Read + write (INSERT, UPDATE, DELETE) | Mostly read (SELECT, reports) |
| Used by | Operational staff | Analysts, management, BI tools |
Data mining is the process of analysing very large datasets to discover hidden patterns, trends and useful relationships that a human could never spot by eye. The name is a good clue: just as a gold miner digs through tonnes of rock to find a few grams of gold, data mining digs through millions of records to find the valuable nuggets of knowledge buried inside.
Companies collect enormous amounts of data, but raw data on its own is useless — it is just numbers and words. Data mining turns that raw data into insight they can act on. For example, Pick n Pay's Smart Shopper data might reveal that customers who buy nappies on a Friday evening also tend to buy snacks — so the shop places those products near each other and increases sales. Nobody told the computer to look for that link; the pattern was mined out of the data.
Caring for data means protecting the accuracy, security and availability of an organisation's data throughout its life. Data is one of the most valuable assets a company owns — often worth more than its buildings or equipment — because decisions, money and reputations all depend on it. Poor data leads to poor decisions, and lost data can shut a business down completely.
"Garbage in, garbage out." If incorrect data goes into the system, only incorrect information can come out — no matter how clever your analysis is. This is why validation and verification at the point of capture are so important.
Below are the main ways an organisation looks after its data. Notice how each one protects against a different danger — wrong data, lost data, or stolen data.
A relational database stores data in structured tables linked together. Normalisation is the process of cleaning up a database design to remove repetition and prevent errors.
A relational database stores data in tables (also called relations). Each table represents one type of thing — for example, a table for students, a separate table for subjects. Tables are then linked together using key fields.
| Key Type | Description | Example |
|---|---|---|
| Primary Key (PK) | Uniquely identifies each record. No duplicates, no blanks. | StudentID in tblStudents |
| Foreign Key (FK) | A field that links to the primary key of another table. Creates the relationship. | ClassID in tblStudents → links to tblClasses |
| Composite Key | Two or more fields combined to create a unique identifier | StudentID + SubjectID in tblMarks |
| Alternate Key | Could be a primary key but wasn't chosen as one | Email address (also unique, but ID was chosen as PK) |
Referential integrity is a rule that ensures relationships between tables remain consistent. It means: a foreign key value must always match an existing primary key value in the related table.
If ClassID C03 doesn't exist in tblClasses, you cannot add a student with ClassID = C03. The database will reject this to prevent orphan records (records with no matching parent).
An ERD is a diagram that shows the entities (tables) in a database and the relationships between them. Each box is a table; the line between boxes shows how they relate. You are often asked to draw one in the exam, so practise the crow's-foot notation below.
The relationship is created by putting the primary key of the "one" table into the "many" table as a foreign key (here BookID links tblBooks to tblLoans).
| Relationship | Meaning | Example |
|---|---|---|
| One-to-One (1:1) | One record links to exactly one record in the other table | One person ↔ one ID number |
| One-to-Many (1:∞) | One record links to many records in the other table | One book can appear in many loans |
| Many-to-Many (∞:∞) | Many records link to many records — resolved with a third "link" table | Students ↔ Activities (via a link table) |
A relational database can't store a many-to-many relationship directly. You break it into two one-to-many relationships using a junction/link table (e.g. tblLoans links books and borrowers).
| Type | What it protects | How it is ensured |
|---|---|---|
| Physical integrity | The data is not lost or damaged by hardware failure, power loss or disaster | RAID, UPS, regular backups, off-site storage |
| Logical integrity | The data stays correct, consistent and valid within the database | Validation rules, referential integrity, record locking |
Record locking temporarily "locks" a record while one user is editing it, so that a second user cannot change the same record at the same time. This prevents two users overwriting each other's changes and keeps the data consistent (a key way to protect logical integrity in a multi-user database).
When a database is poorly designed (not normalised), three types of errors can occur when working with data:
| Anomaly | When it happens | Example |
|---|---|---|
| Insertion anomaly | You can't add new data without first adding other unrelated data | Can't add a new class until at least one student enrols in it |
| Deletion anomaly | Deleting one record accidentally removes other important data | Deleting the only student in a class also deletes the class's information |
| Modification anomaly | Changing one value means updating many rows — and missing some creates inconsistency | A teacher's name appears in 50 student records; update one and the others are wrong |
Normalisation splits large, messy tables into smaller, focused tables and links them properly. This eliminates all three anomalies.
Normalisation is the systematic process of organising the fields and tables of a relational database, by applying a set of rules called normal forms, in order to reduce data redundancy and prevent insertion, deletion and modification anomalies.
Imagine one giant spreadsheet where every order repeats the customer's full name, address and phone number. If a customer moves house you must change it in dozens of rows — and if you miss one, the data disagrees with itself. Normalisation is like splitting that mess into tidy, single-topic tables: one Customers table (each customer stored once) and one Orders table that just points back with the customer's ID (a foreign key). Now a change is made in one place only. The three normal forms are simply three tidy-up rules you apply in order.
A table is in 1NF when:
| StudentID | Name | Subjects |
|---|---|---|
| 1 | Alice | Maths, IT, English |
❌ Problem: Three values in one cell (Subjects column)
| StudentID | Name | Subject |
|---|---|---|
| 1 | Alice | Maths |
| 1 | Alice | IT |
| 1 | Alice | English |
A table is in 2NF when it is in 1NF AND every non-key field depends on the whole primary key (not just part of it). This only matters when the primary key is a composite key.
| StudentID (PK) | SubjectID (PK) | StudentName | Mark |
|---|---|---|---|
| 1 | IT | Alice | 85 |
❌ Problem: StudentName only depends on StudentID, not on (StudentID + SubjectID) together
| StudentID (PK) | StudentName |
|---|---|
| 1 | Alice |
| StudentID (PK+FK) | SubjectID (PK) | Mark |
|---|---|---|
| 1 | IT | 85 |
A table is in 3NF when it is in 2NF AND no non-key field depends on another non-key field (no transitive dependency).
| StudentID (PK) | Name | GradeLevel | GradeDescription |
|---|---|---|---|
| 1 | Alice | 12 | Matric |
❌ Problem: GradeDescription depends on GradeLevel (a non-key field), not on StudentID
| StudentID (PK) | Name | GradeLevel (FK) |
|---|---|---|
| 1 | Alice | 12 |
| GradeLevel (PK) | GradeDescription |
|---|---|
| 12 | Matric |
| Normal Form | Check for | Fix by |
|---|---|---|
| 1NF | Multiple values in one cell? Repeating columns? | Split into separate rows; add PK |
| 2NF | Non-key field depends on only PART of the composite PK? | Move that field to its own table |
| 3NF | Non-key field depends on another non-key field? | Move the dependency to its own table |
| Characteristic | Meaning |
|---|---|
| Data integrity | Data is accurate, consistent and complete throughout its lifecycle |
| Data independence | Changing the database structure doesn't break the programs that use it |
| Data redundancy | Minimum — the same data should not be stored in multiple places |
| Data security | Only authorised users can access or modify data |
| Ease of maintenance | The database design makes it simple to insert, update and delete without causing problems |
Mobile device hardware, factors that affect computer performance, and choosing the right system for a user's needs.
Smartphones have similar hardware to desktops but in miniaturised form. Key differences:
| Component | Desktop | Smartphone |
|---|---|---|
| CPU | Separate chip; very powerful; many cores | SoC (System on a Chip) — CPU+GPU+modem+RAM in one chip |
| Input | Keyboard and mouse | Touchscreen; virtual keyboard |
| Display | Large external monitor | Small built-in touchscreen |
| Connectivity | Wired NIC or Wi-Fi card | Built-in Bluetooth, Wi-Fi, 4G/5G, GPS, NFC |
| Battery | Plugged in; no battery constraint | Limited battery; performance vs battery trade-off |
| Factor | How it affects performance |
|---|---|
| CPU clock speed (GHz) | Higher = more instructions per second; faster processing |
| CPU cores | More cores = better multitasking and parallel processing |
| RAM amount and speed | More RAM = more programs running simultaneously; higher speed = faster data transfer to CPU |
| Cache size (L1/L2/L3) | Larger cache = CPU waits less for data from RAM |
| GPU clock speed | Higher GPU speed = faster graphics rendering; important for gaming and video |
| Storage type (HDD vs SSD) | SSD gives dramatically faster boot times and application loading |
| NIC speed (Mbps) | Faster NIC = faster downloads, streaming, network file transfers |
| Operating system | Outdated OS causes compatibility issues, security risks and slower operation |
| Feature | HDD | SSD |
|---|---|---|
| Speed | Slow (mechanical) | Very fast |
| Durability | Fragile (moving parts) | Durable (no moving parts) |
| Noise | Audible spinning | Silent |
| Cost per GB | Cheaper | More expensive |
| Boot time | Long (30–60 seconds) | Very short (5–15 seconds) |
When recommending a computer, match the components to the user's needs:
| User type | Recommended specs |
|---|---|
| Office/admin worker | Moderate CPU, 8GB RAM, SSD, integrated graphics |
| Graphic designer / video editor | Fast multi-core CPU, 16–32GB RAM, dedicated GPU, large SSD |
| Gamer | Fast CPU, 16GB+ RAM, high-end dedicated GPU, fast SSD |
| Student | Mid-range CPU, 8GB RAM, SSD, Wi-Fi, long battery (laptop) |
| Server / database host | Many cores, large ECC RAM, RAID storage, redundant power |
Grade 12 Term 2 theory: cloud computing, Artificial Intelligence, Virtual Reality, Augmented Reality, Mixed Reality and virtualisation — all new Software topics in the updated CAPS.
AI refers to computer systems that can perform tasks that normally require human intelligence — such as learning, reasoning, decision-making and pattern recognition.
Software, storage and computing power delivered as a service over the Internet, rather than installed locally.
You don't build a power station in your back yard — you just plug into the wall and pay for what you use, and someone else runs the generators. Cloud computing works the same way: instead of buying and maintaining your own servers, you rent storage and computing power from a provider (Google, Microsoft, Amazon) over the internet and pay only for what you use. It scales up when you need more and down when you don't, exactly like drawing more or less electricity from the grid.
| Advantage | Disadvantage |
|---|---|
| Scalable — capacity grows automatically | Requires internet connection |
| Affordable — pay only for what you use | Downtime affects all users |
| Accessible from any device anywhere | Security and privacy concerns |
| Maintained by experts; always updated | Ongoing subscription costs |
| Easy collaboration between users | Limited control over infrastructure |
Applications accessed via browser with no local installation. Examples: Google Docs, Microsoft 365, Gmail.
Cloud reduces the need for powerful local hardware — thin clients and low-spec devices can run complex software via the cloud. Businesses no longer need to buy expensive servers.
Running multiple virtual machines on a single physical computer. Each VM has its own OS, RAM, storage and apps, isolated from others.
A fully artificial, immersive 3D environment created by software. The user is completely cut off from the real world.
| Use Case | Example |
|---|---|
| Training | Military simulations, surgical training |
| Education | Virtual field trips, interactive lessons |
| Entertainment | VR gaming, virtual cinemas |
| Healthcare | Phobia treatment, pain management |
| Engineering | Virtual prototypes, architectural walkthroughs |
Overlays computer-generated content on the real world — you still see reality, with digital elements added.
| Use Case | Example |
|---|---|
| Retail | Preview furniture in your room before buying |
| Training | Step-by-step repair instructions overlaid on equipment |
| Navigation | AR arrows overlaid on road view |
| Marketing | Interactive product advertisements |
How the web works under the hood — search technologies, web technologies, online applications, and how data is stored and processed online.
| Type | Description |
|---|---|
| Keyword search | Matches exact words in the query |
| Semantic search | Understands meaning and context behind words — interprets user intent, not just keywords |
| Mediated search | A middleman system filters results for a specific database or organisation (e.g. Google Scholar) |
| SEO | Search Engine Optimisation — techniques to make websites rank higher in search results (keywords, speed, mobile-friendly, backlinks) |
| Static | Dynamic | |
|---|---|---|
| Content | Fixed HTML — changes only if developer edits files | Generated on demand from a database |
| Database | No | Yes |
| Examples | Simple portfolio, business info page | Online shop, social media, news sites |
| Security risk | Low | Higher (SQL injection, data breaches) |
| Technology | Role | Example |
|---|---|---|
| HTML | Structure and content of web pages | Headings, paragraphs, links, images |
| CSS | Visual styling — colours, fonts, layout | Blue buttons, responsive grid |
| JavaScript | Client-side interactivity; runs in the browser | Form validation, dropdown menus, AJAX |
| PHP | Server-side scripting; processes forms, talks to databases | Login authentication, database queries |
| SQL | Query and manage database data | SELECT user data, INSERT orders |
| XML | Structured data exchange between systems | Product data feeds between websites |
| Client-side (browser) | Server-side (web server) | |
|---|---|---|
| Language | JavaScript, AJAX | PHP, Python, Node.js |
| Purpose | Real-time page updates, validation, animations | Authentication, database access, processing |
| AJAX | Updates parts of a page without reloading | — |
| HTTP | HTTPS | |
|---|---|---|
| Encryption | None — data sent in plain text | SSL/TLS encryption |
| Padlock | No padlock in browser | Padlock icon shown |
| Use | Non-sensitive public pages | Login, banking, shopping — any sensitive data |
Essential network components, internet connection methods, file sharing, and remote access technologies.
| Component | Function |
|---|---|
| NIC | Network Interface Card — hardware that connects a device to a network (wired or wireless) |
| Switch | Connects devices on a LAN and forwards data only to the intended device (not broadcast like a hub) |
| Router | Connects different networks; routes packets; assigns IP addresses; acts as gateway to ISP |
| Modem | Converts digital signals to analogue for telephone lines (and back); connects to ISP |
| Wireless access point | Enables wireless devices to connect to a wired network via Wi-Fi |
| All-in-one home router | Combines modem + router + switch + Wi-Fi access point in one device |
| Medium | Speed | Range | Notes |
|---|---|---|---|
| UTP cable (Ethernet) | Up to 10 Gbps | 100m per segment | Common in offices and schools; easy to install |
| Fibre optic | Up to Tbps | Kilometres | Uses light; most secure; expensive to install |
| Coaxial | Moderate | Hundreds of meters | Older standard; still used in some broadband |
| Technology | Description | Speed |
|---|---|---|
| ADSL | Uses telephone copper lines; download faster than upload | Up to ~20 Mbps |
| Fibre | Light through fibre optic cables; fastest and most reliable | 100 Mbps–1 Gbps+ |
| WiMAX | Long-range wireless; used in rural/remote areas | Moderate |
| 4G/LTE | Mobile broadband; widely available | 5–100 Mbps |
| 5G | New generation mobile; very low latency; supports IoT | 50 Mbps–10 Gbps |
On a network, users can share resources. Access can be restricted by permission level:
| Permission Level | What the user can do |
|---|---|
| No access | Cannot see the shared resource |
| Read-only | Can view/copy files but not modify or delete |
| Read/Write | Can view, copy, modify files |
| Full control (Admin) | Can do everything including change permissions |
Accessing a device or network from a physically different location.
Sending private data across the open internet is like carrying cash through a busy public street — anyone could grab it. A VPN is like an armoured van driving through that same street: it builds a sealed, encrypted "tunnel" so that, even though your data travels over the public internet, no one on the outside can see or reach what is inside. That is how an employee at home can safely reach the private company network.
| Type | Description | Example |
|---|---|---|
| LAN remote access | Access another computer in the same building | Shared folder on school server |
| Internet remote access | Access home/work resources from anywhere | Google Drive, OneDrive, Remote Desktop |
| VPN | Encrypted tunnel over internet; secure remote access to private network | Employee working from home via company VPN |
Files are split into small pieces and downloaded simultaneously from many peers.
This page focuses on how data is kept safe as it travels across a network — VPNs, encryption, digital certificates and authentication. For network hardware, internet access technologies and general remote access, see Networks & Remote Access.
A VPN creates an encrypted tunnel over the Internet, allowing secure remote access to a private network. (See Networks & Remote Access for the armoured-van analogy and a worked example.)
| Concept | Description |
|---|---|
| Encryption | Converts readable data into unreadable code. Only someone with the correct key can decrypt it. |
| SSL/TLS | Protocol securing communication between browser and server (HTTPS). Uses public/private key pairs. |
| Digital certificate | Issued by a trusted Certificate Authority. Verifies the website is legitimate. |
| Firewall | Filters incoming and outgoing traffic based on security rules |
| MFA | Multi-Factor Authentication — requires password + second factor (OTP, fingerprint) |
| OTP | One-Time PIN — valid for one login only; prevents replay attacks |
| Concept | Description |
|---|---|
| Spam filtering | Automatically detects and quarantines unsolicited/junk email before it reaches the inbox |
| Email encryption | Encrypts the message content so only the intended recipient's key can decrypt and read it |
| End-to-end encryption | Used by apps like WhatsApp/Signal — only the sender and recipient can read the message, not even the service provider |
| Digital signature | Confirms a message really came from the claimed sender and was not altered in transit |
Types of cybercrime, the people who commit them, their effects on individuals and organisations, and the safeguards used to prevent them.
| Type | Description |
|---|---|
| Hacker | Gains unauthorised access to systems. White hat (ethical) vs Black hat (malicious). |
| Cracker | Breaks software protection or encryption for illegal access or distribution |
| Script kiddie | Uses pre-written tools without understanding them; less skilled |
| Insider threat | Current or former employee who misuses access privileges |
| Cybercriminal | Commits crime for financial gain (fraud, ransomware, identity theft) |
| Cyber gang | An organised group of criminals who work together to carry out large-scale cyberattacks |
| Virus author | A person who writes and releases malware such as viruses and worms |
| Crime | Description |
|---|---|
| Identity theft | Stealing personal information to impersonate someone (open accounts, get loans) |
| Phishing | Fake emails that look official to steal credentials |
| Pharming | Redirecting users to fake websites to steal information |
| Ransomware | Encrypts victim's data; demands payment to restore access |
| Business data theft | Stealing trade secrets, customer databases, or financial records |
| SQL Injection | Inserting malicious SQL via web forms to manipulate or steal database data |
| DDoS attack | Distributed Denial of Service — overwhelming a server with traffic to take it offline |
| Online fraud | Scams, fake auctions, advance-fee fraud (419 scams) |
| Cyberbullying | Harassment, threats or humiliation via digital channels |
| Piracy | Illegally copying, distributing or using copyrighted software/media |
| Bandwidth theft | Using someone else's network/internet connection, or hotlinking their content, without permission |
| Theft of time & services | Using an employer's computers, internet or work time for personal or unauthorised purposes |
| Botnet / zombies | A network of infected computers ("zombies") secretly controlled by an attacker, often used for DDoS attacks or spam |
| Back door | A hidden way to bypass normal security and gain remote access to a system |
| Safeguard | How it protects |
|---|---|
| Antivirus / Antimalware | Detects and removes malicious software |
| Firewall | Filters unauthorised network traffic |
| Encryption | Scrambles data so intercepted data is unreadable |
| Strong passwords + MFA | Makes accounts much harder to compromise |
| Regular backups | Allows recovery after ransomware or data loss |
| Software updates / patches | Fixes known vulnerabilities before criminals exploit them |
| User training / awareness | Educated users are less likely to click phishing links |
| Access control | Least-privilege principle: users only access what they need |
| Input validation | Prevents SQL injection by sanitising user input |
| Digital certificates + HTTPS | Verifies website legitimacy; encrypts all data in transit |
In South Africa, cybercrime is covered by:
How Big Data, data warehousing, globalisation and the 4IR affect society — privacy, employment, social media and the evolution of the web.
Social implications are revisited every term rather than taught once. The sections below are grouped by the term where each topic is introduced on the Year Planner — but all of it stays examinable afterwards. A few sections (globalisation, decision-making systems, protecting your identity) don't map to a single Year Planner bullet, so they are grouped with the closest related term.
Big Data is the term for datasets so enormous, fast-moving and varied that ordinary database tools cannot store or process them — think of every Facebook post, every WhatsApp message and every e-toll swipe in the country, all at once. When companies and governments mine this Big Data, the results affect real people's lives, and that brings both wonderful benefits and serious dangers.
The same data that lets a hospital predict and prevent illness can also let an insurance company refuse you cover because your shopping habits suggest you eat unhealthily. The technology is neutral — it is how the data is used that creates the social problem. As IT students you must be able to argue both sides.
| Positive | Negative |
|---|---|
| Healthcare: predict and prevent illness | Privacy erosion — habits tracked without full consent |
| Fraud detection in banking | Discrimination based on data profiles |
| Personalised education programmes | Security breaches expose millions of records |
| Better government services | Data sold to third parties without user knowledge |
| Precision agriculture: monitoring soil, weather and crop data to improve yields (e.g. a Free State maize farmer using sensor data to decide when to irrigate) | Small-scale farmers without access to this technology fall further behind larger commercial operations |
| Aspect | Effect |
|---|---|
| Globalisation | World interconnected economically and culturally; faster trade; outsourcing; cultural exchange; increased competition |
| 4IR technologies | AI, machine learning, IoT, robotics, automation, biotechnology, AR/VR, Big Data |
| Jobs | Routine jobs replaced by machines; new careers in data science, AI, cybersecurity |
| Workers | Must reskill constantly; digital literacy essential |
As the amount of data in the world explodes, organisations increasingly rely on software not just to store data, but to help people make decisions with it. Two related kinds of system come up in the exam, and they are easy to confuse.
| System | What it does | Example |
|---|---|---|
| Decision Support System (DSS) | Analyses large amounts of data and presents it in a useful way (summaries, graphs, "what-if" models) so that a human can make a better-informed decision. It supports the decision — it does not make it. | A retail manager using sales dashboards to decide which stores to stock for winter |
| Expert / knowledge-based system | Captures the knowledge of human experts as a knowledge base of facts plus a set of rules (an inference engine), then uses them to give advice or a diagnosis — mimicking how an expert reasons. | A medical system that suggests likely diagnoses from a patient's symptoms |
A DSS hands the data to a person to decide; an expert system tries to reach the conclusion itself using stored expert knowledge. Both rely on good-quality data — "garbage in, garbage out".
Key factors affecting computer performance and maintenance:
Some problems are too big for any single computer — modelling climate change, searching for new medicines, or analysing astronomical data. Distributed computing splits one enormous task into many small pieces and shares them across thousands of computers (or cloud servers) that work on them at the same time, then combines the results.
| Concept | Privacy implication |
|---|---|
| Cookies | Track browsing behaviour; can be used for targeted advertising |
| Anonymity | Enables free expression; also enables cyberbullying and illegal activity |
| GUIDs | Globally Unique Identifiers track behaviour across websites and apps |
| Location data | Apps continuously track movement; risk of stalking and profiling |
| File sharing | Piracy is illegal and harms creators; but sharing also enables legal distribution |
Based on the 2026 IT CAPS. Grade 12 introduces SQL (Term 1), OOP & 2D arrays (Term 2). Paper 2 is cumulative across all Grades 10–12.
This shows when each topic is taught during the year — it is not a list of what any single test covers. Any work done so far this year, plus the foundational work from earlier grades, can still be assessed, so don't study only the current term's topics.
Paper 1 (3 hrs): Delphi programming — SQL, OOP, 2D arrays, recursion, file handling, arrays, general programming.
Paper 2 (3 hrs): All theory from Gr10–12.
These topics are not explicitly required by CAPS but have appeared in NSC past papers (2015–2024). Knowing them can mean the difference between a pass and a distinction.
Items marked P1 appear in Paper 1 (practical/Delphi), P2 in Paper 2 (theory), and Both in either paper. These are supplementary — master your CAPS content first.
CAPS never teaches "how to plan a whole program" as one topic — instead it hands you the individual planning tools (IPO tables, TOE charts, pseudocode) at different points across Grade 10 and 11. Strung together in order, those tools form a complete process for turning a vague idea into a finished, working program. None of this is examinable on its own, but following it will make your PAT — and any open-ended practical question — far less overwhelming.
A PAT is marked over months, revisited many times, and often built on by a partner or by future-you after a long break. Time spent planning up front — even just a page of notes on what each form does — is what makes it possible to pick the project back up in Term 4 and still understand your own Term 2 code.
These Delphi functions, components and techniques are not listed in CAPS but appear regularly in exam questions or are needed to solve exam problems efficiently.
Replaces all or first occurrence of a substring within a string.
s := StringReplace(s, 'old', 'new', [rfReplaceAll]);
A powerful list of strings — very useful for loading file lines into memory.
sl := TStringList.Create; sl.LoadFromFile('data.txt'); sl.Free;
Formats numbers/strings with precise control — Format('%.2f', [rVal]) gives 2 decimal places. More powerful than FloatToStrF.
Generate random integers. Always call Randomize; first to seed the generator. Random(100) returns 0–99.
Let users browse for files at runtime.
if OpenDialog1.Execute then sFile := OpenDialog1.FileName;
Convert between TDate values and string representation. Used with TDateTimePicker.
sDate := DateToStr(dtpDate.Date);
Catch runtime errors gracefully — e.g. invalid StrToInt input.
try iNum := StrToInt(edtNum.Text); except ShowMessage('Invalid'); end;
Returns the number of lines in a Memo. Often used in loops to process all memo lines.
for i := 0 to Memo1.Lines.Count - 1 do
Case-insensitive string comparison — avoids problems when user types 'yes', 'YES' or 'Yes'.
if SameText(sInput, 'yes') then
Convert integers to hexadecimal strings and back. Sometimes tested in conjunction with number systems theory.
sHex := IntToHex(255, 4); // = '00FF'
Built-in boolean checks — cleaner than MOD 2.
if Odd(iNum) then // true if iNum is odd
Break exits the loop immediately. Continue skips to the next iteration. Both appear in exam solutions — know the difference.
These theory topics have appeared in NSC Theory papers but sit at the edge of or outside the formal CAPS scope. They typically appear in social implications or "current technology" questions.
AI appears regularly in social implications questions — automation of jobs, AI decision-making, bias in AI, chatbots. Not deeply technical — understand the concept and its social effects.
A distributed digital ledger of linked blocks. Used in cryptocurrency, supply chain, and secure records. Appeared in Gr12 theory papers. Know: what it is, how it works, and 2 uses.
AI-generated fake videos or audio that appear authentic. Social implications question topic — impacts on trust, truth, and politics. Know the definition and two risks.
A part of the internet not indexed by search engines, accessed via special software (Tor). Used for anonymity — legal and illegal uses. Appeared in theory cybercrime questions.
The principle that all internet traffic should be treated equally — ISPs cannot throttle or prioritise certain content. A social/political IT topic.
The successor to IPv4 — uses 128-bit addresses (vs 32-bit) to solve address exhaustion. Format: 2001:0db8:85a3::8a2e:0370:7334. Know why it was introduced.
RAID 0: speed (striping, no redundancy). RAID 1: mirroring (exact copy). RAID 5: striping with parity (balance of speed + fault tolerance). CAPS only mentions RAID in general — exams go deeper.
Hiding secret information within ordinary files (images, audio) without detection. Different from encryption — encryption scrambles data; steganography hides its existence. Appeared in theory questions.
Self-executing contracts where terms are written in code on a blockchain. No middlemen needed. Related to blockchain technology — appeared in Gr12 social implications.
Processing data close to where it is generated (the "edge" of the network) rather than sending it all to a central cloud server. Reduces latency — important for IoT and 5G.
All devices share a single communication line (the bus). Not in the current CAPS but appeared in older papers. Advantage: cheap. Disadvantage: single point of failure; performance drops with more devices.
Each device connects to several others, so data has more than one possible path. Not in the current CAPS (it sits under "network innovation"). Advantage: very reliable — traffic reroutes if a link fails. Disadvantage: expensive, many connections needed. It's how "mesh Wi-Fi" systems work.
Manipulating people (rather than systems) to reveal confidential information. Includes pretexting, baiting, tailgating. Appears in cybercrime theory questions.
Exams frequently ask you to convert values — not just explain systems. Practise: decimal↔binary, decimal↔hex, binary↔hex. Know the place values (powers of 2 and 16).
South African law governing how personal data must be collected, stored, and protected. Appears in privacy and legal implications questions. Know: what it is, who it protects, and 2 requirements.
SA legislation that criminalises hacking, ransomware, online fraud, and malicious communications. Often referenced in cybercrime theory questions for Gr12.
A virtual replica of a physical object or system, updated in real time from sensor data. Used in engineering, manufacturing, and smart cities. Appeared in 4IR/IoT questions.
A comprehensive reference of all Delphi functions you need to know — both CAPS-required and commonly appearing in exams.
| Function/Procedure | What it does | Example |
|---|---|---|
Length(s) | Returns number of characters | Length('Hello') = 5 |
Pos(find, source) | Position of substring (0 if not found) | Pos('lo','Hello') = 4 |
Copy(source, start, len) | Extract substring | Copy('Hello',2,3) = 'ell' |
Insert(text, var s, pos) | Insert text into string at position | Insert('!','Hello',6) → 'Hello!' |
Delete(var s, pos, len) | Remove characters from string | Delete(s,1,3) |
UpperCase(s) | All uppercase | UpperCase('hi') = 'HI' |
LowerCase(s) | All lowercase | LowerCase('HI') = 'hi' |
Trim(s) | Remove leading/trailing spaces | Trim(' Hi ') = 'Hi' |
StringReplace(s,old,new,flags) | Replace substring(s) | StringReplace(s,'a','e',[rfReplaceAll]) |
SameText(s1,s2) | Case-insensitive comparison (boolean) | SameText('Yes','yes') = True |
Concat(s1,s2) | Join two strings (same as +) | Concat('Hel','lo') |
s[i] | Character at index i (1-based) | s[1] = first character |
| Function | What it does | Example |
|---|---|---|
Sqr(x) | x squared (x²) | Sqr(4) = 16 |
Sqrt(x) | Square root | Sqrt(16) = 4 |
Power(base, exp) | base to the power of exp | Power(2,8) = 256 |
Round(x) | Round to nearest integer | Round(4.6) = 5 |
Trunc(x) | Remove decimal (truncate toward zero) | Trunc(4.9) = 4 |
Ceil(x) | Round UP to integer | Ceil(4.1) = 5 |
Floor(x) | Round DOWN to integer | Floor(4.9) = 4 |
Abs(x) | Absolute value | Abs(-5) = 5 |
Random(n) | Random integer 0 to n-1 | Random(6)+1 simulates a die |
Randomize | Seed the random generator (call once) | Call before Random() |
Inc(x) / Inc(x,n) | Increment by 1 or n | Inc(i) ≡ i := i+1 |
Dec(x) / Dec(x,n) | Decrement by 1 or n | Dec(i,3) ≡ i := i-3 |
Odd(n) | True if n is odd | Odd(3) = True |
Pi | Returns π (3.14159…) | rArea := Pi * Sqr(r) |
| Function | Converts | Example |
|---|---|---|
StrToInt(s) | String → Integer | StrToInt('42') = 42 |
StrToFloat(s) | String → Real | StrToFloat('3.14') |
StrToIntDef(s, default) | String → Integer (safe — returns default if invalid) | StrToIntDef(edtNum.Text, 0) |
IntToStr(n) | Integer → String | IntToStr(42) = '42' |
FloatToStr(r) | Real → String | FloatToStr(3.14) |
FloatToStrF(r, fmt, digits, dec) | Formatted real → String | FloatToStrF(r, ffFixed, 6, 2) |
Ord(c) | Char → Integer (ASCII value) | Ord('A') = 65 |
Chr(n) | Integer → Char | Chr(65) = 'A' |
UpCase(c) | Single char to uppercase | UpCase('a') = 'A' |
IntToHex(n, digits) | Integer → Hex string | IntToHex(255,2) = 'FF' |
DateToStr(d) | TDate → String | DateToStr(Now) |
FormatFloat(fmt, r) | Real → formatted string | FormatFloat('#,##0.00', 1234.5) |
| Section | What to expect | Common traps |
|---|---|---|
| Q1: General programming | Strings, loops, decisions, calculations (~30–40 marks) | Off-by-one errors in loops; forgetting to initialise variables |
| Q2: Arrays & files | 1D/2D arrays, text file reading/writing (~20–25 marks) | Using wrong index (0 vs 1-based); not closing file |
| Q3: OOP | Class with constructor, accessors, mutators, toString (~25–30 marks) | Calling Create on the object var (not class name); forgetting Result in functions |
| Q4: Database/SQL | TADOQuery, SQL statements including JOIN (~20–25 marks) | Not calling qry.Close before changing SQL; wrong JOIN ON condition |
| Recursion (Gr12) | Write a recursive function; trace it (~10–15 marks) | Missing base case; not returning Result |
| Topic | Typical mark allocation | What examiners look for |
|---|---|---|
| Hardware & software | 15–20 marks | Specific advantages/disadvantages; real-world examples |
| Networks & internet | 20–25 marks | Correct terminology; topology advantages/disadvantages |
| Databases & normalisation | 20–30 marks | Correct normal form identification; proper primary/foreign key use |
| Social implications | 20–25 marks | Balance of positive AND negative effects; specific examples |
| Cybercrime | 10–15 marks (Gr12) | Correct crime type names; effects on both victim and business |
| Current technology (IoT, AI, VR) | 10–15 marks (Gr12) | Practical application examples; social implications |