← All workbooksPrint double-sided, A4, black and white
GRADE 12 · TERM 4

Refresher: Grades 10 to 12, Paper by Paper

One last pass through the whole course, organised the way you will be tested.

Name:
Class: Date:

How to use this workbook

  1. Work with a pencil. Mistakes are how we learn: rub out and try again.
  2. Start each unit with Think First. Try it on your own before you read the explanation.
  3. Read Learn It, then do the activities. Trace tables and code are written by hand.
  4. At the end of each unit, tick the “I can” boxes you are sure of. Write down anything you still want to ask.
  5. The checkpoint test is done under test conditions, with no notes.

In this workbook

  1. Where do I stand?
  2. Programming core: Grade 10 skills
  3. Arrays and text files: Grade 11 skills
  4. OOP: classes and objects (Grade 12)
  5. 2D arrays and recursion (Grade 12)
  6. Databases and SQL (Grades 11 and 12)
  7. Paper 1 mini-exam: Delphi programming and SQL
  8. Hardware and software
  9. Networks and the internet
  10. Data and databases
  11. Number systems and data representation
  12. Security, crime and society
  13. Exam answering skills
  14. Paper 2 mini-exam: Theory, Grades 10 to 12
  15. The final stretch
Matches the Annual Teaching Plan: Term 4 — no new content. Revision of Grade 10, 11 and 12 work, Paper 1 then Paper 2, with a mini-exam for each. Every question is tagged G10, G11 or G12 so you can see which year's work needs attention.

UNIT 1Where do I stand?

You have three years of Information Technology behind you. Before you revise, be honest about where you are strong and where you are shaky, so you spend your time where it counts.

By the end of this unit I can: (tick each box when you are sure)
One thing I want to ask my teacher:

1.1Self-audit

Write ✓ if you are confident, ? if you are nearly there, or ✗ if you are not yet comfortable. The grade shows where the topic was first taught. Come back at the end and change the marks.

TopicFromMy rating
Variables, operators, IF and CASEG10
Loops and strings from first principlesG10
Number algorithms (prime, GCD, LCM)G10
1D arrays, searching and sortingG11
Text files and parallel arraysG11
Procedures and functionsG11
Databases in Delphi (no SQL)G11
OOP: classes and objectsG12
2D arraysG12
RecursionG12
SQL and joinsG12
Hardware, software and the operating systemG10-12
Networks and the internetG10-12
Number systems, ASCII and compressionG10-11
Data quality, validation and ERDsG11
Normalisation and anomaliesG12
Security, malware and cybercrimeG10-12
Social implications: 4IR, IoT, Big Data, AI, cloudG11-12
Writing exam answers in paragraphsAll

1.2My plan

Write the three weakest topics from your table, and for each one the first thing you will do this week (for example: redo the trace tables on paper, or write the normalisation steps again).

UNIT 2Programming core: Grade 10 skills

Everything later in the course is built on four old friends: variables and operators, decisions, loops and strings. Warm up here, because Question 1 of the practical paper tests them every year.

By the end of this unit I can: (tick each box when you are sure)
One thing I want to ask my teacher:
THINK FIRST · no computer needed

2.1Counting the change

A till must hand back R137 using only R50 notes, R20 notes and R10 notes, and then coins for whatever is left. Work out by hand how many of each note, and how much is left for coins. Then say which two Delphi operators did the work in each step.
LEARN IT

Operators and decisions: the rules and the traps

Delphi
case iMark of
  80..100 : sSym := 'A';
  60..79  : sSym := 'B';
  else      sSym := 'C';
end;
if (iMark mod 10 = 0) or (iMark = 99) then   // brackets round each test
  sSym := sSym + '*';
LEARN IT

Loops, strings and number algorithms: the patterns

Delphi
while iB <> 0 do            // GCD by remainders
begin
  iTemp := iB;
  iB := iA mod iB;
  iA := iTemp;
end;                         // answer is in iA

iSp := Pos(' ', sName);
sFirst := Copy(sName, 1, iSp - 1);
Delete(sName, 1, iSp);       // sName is now the rest

2.2[G10] Evaluate [8]

Write the value of each expression. Real values are written as Delphi would show them.

ExpressionValue
23 div 4
23 mod 4
23 / 4
Round(6.7) + Trunc(6.7)
Sqr(5) - Sqrt(16)
(23 mod 4 = 3) and (23 div 4 > 5)
Length('Cape Town') - Pos('T', 'Cape Town')
Chr(Ord('A') + 7)

2.3[G10] CASE and a bonus [7]

Write the symbol stored in sSym at the end of the code for each mark.

Delphi
case iMark of
  80..100 : sSym := 'A';
  70..79  : sSym := 'B';
  60..69  : sSym := 'C';
  50..59  : sSym := 'D';
  else      sSym := 'F';
end;
if (iMark mod 10 >= 8) and (sSym <> 'F') then
  sSym := sSym + '+';
iMarksSym at the end
85
59
70
49
100
79
88

2.4[G10] Digits with a WHILE loop [6]

Trace the code with iNum = 4093 at the start. Write the values after each pass of the loop.

Delphi
iRev := 0;
iSum := 0;
while iNum > 0 do
begin
  iDigit := iNum mod 10;
  iRev := iRev * 10 + iDigit;
  iSum := iSum + iDigit;
  iNum := iNum div 10;
end;
PassiDigitiReviSumiNum
1
2
3
4

2.5[G10] Debug: is it prime? [4]

This code should show Prime in lblOut when iNum is a prime number, but it is wrong for every number. Find four errors.

Delphi
bPrime := False;
for i := 2 to iNum do
  if iNum div i = 0 then
    bPrime := True;
if bPrime then
  lblOut.Caption := 'Prime';

2.6[G10] Write it: read an ID number [7]

A South African ID number is 13 digits: YYMMDD (birth date), then SSSS (4 digits: 5000 or more is male, below 5000 is female), then a citizenship digit (position 11: 0 is a citizen, 1 a permanent resident). sID holds the number and every learner was born in the 2000s. Write code that shows in lblInfo the birth date as dd/mm/yyyy, the gender and the citizenship, for example 02/04/2009, Male, South African citizen.

UNIT 3Arrays and text files: Grade 11 skills

Arrays hold a list in memory and text files keep it after the program closes. Put them together with procedures and functions and you can load, search, sort and save data. This unit revises exactly that chain.

By the end of this unit I can: (tick each box when you are sure)
One thing I want to ask my teacher:
THINK FIRST · no computer needed

3.1The big phone book

A sorted list has 15 surnames. You look at the middle name; it tells you whether your surname comes before or after it, so you can throw half the list away. (a) How many names are left after your first look? After the second? After the third? (b) What is the largest number of looks you will ever need for 15 names? (c) A list of 1 000 sorted names: is the answer closer to 10 or to 500?
LEARN IT

Arrays: the patterns to know by heart

Delphi
iBest := 1;                          // highest with index
for i := 2 to 8 do
  if arrTimes[i] > arrTimes[iBest] then
    iBest := i;

for i := 1 to n - 1 do               // bubble sort, ascending
  for j := 1 to n - i do
    if arrMark[j] > arrMark[j + 1] then
    begin
      iTemp := arrMark[j];  arrMark[j] := arrMark[j + 1];  arrMark[j + 1] := iTemp;
      sTemp := arrName[j];  arrName[j] := arrName[j + 1];  arrName[j + 1] := sTemp;
    end;
LEARN IT

Text files, procedures and functions

Delphi
AssignFile(tFile, 'names.txt');
Reset(tFile);
while not Eof(tFile) do
begin
  ReadLn(tFile, sLine);
  memOut.Lines.Add(sLine);
end;
CloseFile(tFile);

procedure Swap(var iA, iB: Integer);    // var: the caller's values change
var iTemp: Integer;
begin
  iTemp := iA;  iA := iB;  iB := iTemp;
end;

3.2[G11] Bubble sort pass by pass [7]

Sort 41, 17, 33, 9, 25, 12 into ascending order with a bubble sort (the code in Learn It, n = 6). Write the whole list after each pass and the number of swaps made in that pass.

PassList after the passSwaps
1
2
3
4
5

3.3[G11] Binary search by hand [7]

The sorted array arrCodes holds 102, 115, 121, 134, 148, 152, 167, 173, 189, 195, 204 (positions 1 to 11). Trace the search for iTarget = 160.

Delphi
iLow := 1;  iHigh := 11;  bFound := False;
while (iLow <= iHigh) and (not bFound) do
begin
  iMid := (iLow + iHigh) div 2;
  if arrCodes[iMid] = iTarget then
    bFound := True
  else if arrCodes[iMid] < iTarget then
    iLow := iMid + 1
  else
    iHigh := iMid - 1;
end;
PassiLowiHighiMidarrCodes[iMid]What happens
1
2
3
end

3.4[G11] Trace a text file [8]

The file stock.txt has the five lines below (name#price#quantity). Complete the table for the code. iTotal is the running total of price × quantity.

stock.txt
Maize meal#43#18
Sugar 2kg#39#7
Cooking oil#54#12
Rusks#31#4
Tea bags#27#20

Delphi
AssignFile(tFile, 'stock.txt');
Reset(tFile);
iTotal := 0;
while not Eof(tFile) do
begin
  ReadLn(tFile, sLine);
  iPos := Pos('#', sLine);
  sName := Copy(sLine, 1, iPos - 1);
  Delete(sLine, 1, iPos);
  iPos := Pos('#', sLine);
  iPrice := StrToInt(Copy(sLine, 1, iPos - 1));
  iQty := StrToInt(Copy(sLine, iPos + 1, Length(sLine)));
  iTotal := iTotal + iPrice * iQty;
  if iQty < 10 then
    memLow.Lines.Add(sName);
end;
CloseFile(tFile);
LinesNameiPriceiQtyiTotal afterAdded to memLow?
1
2
3
4
5

3.5[G11] Debug: add to a log file [5]

The code should add the text in edtEntry to the end of the existing file log.txt and then show in lblLines how many lines the file now has. Find five errors.

Delphi
AssignFile(tLog, 'log.txt');
Rewrite(tLog);
WriteLn(tLog, edtEntry.Text);
Reset(tLog);
iLines := 0;
while Eof(tLog) do
  ReadLn(tLog, sLine);
lblLines.Caption := IntToStr(iLines);

3.6[G11] Write it: a procedure with var parameters [8]

Declare type TTimes = array[1..8] of Integer; and write a procedure MinMax that receives a TTimes array and sends back the lowest and highest times through var parameters iMin and iMax. Then write the call that stores them in iFast and iLast.

UNIT 4OOP: classes and objects (Grade 12)

A class is a blueprint and an object is one thing built from it. Question 3 of the practical paper always asks for the same pattern: attributes, a constructor, accessors, a mutator, an auxiliary method and ToString, then code that uses the objects.

By the end of this unit I can: (tick each box when you are sure)
One thing I want to ask my teacher:
THINK FIRST · no computer needed

4.1Blueprint for an airtime wallet

A learner uses a phone app that keeps an airtime wallet for one person. The wallet knows its owner's name and its balance in rand. The owner can top up (only with an amount above 0) and can spend money. (a) List the private attributes and their data types. (b) List the public methods. (c) What should Spend do if the balance is too small, and what should it give back to the caller? (d) Why must the balance be private?
LEARN IT

A complete class: TPlayer (netball shooting record)

Private attributes (prefix f); public methods. The constructor sets the starting values. An accessor (Get) returns an attribute. A mutator (Set, AddShot) changes one, with a rule if needed. An auxiliary method is a private helper that works something out and never changes an attribute. ToString returns the object's state as text.
Delphi
type
  TPlayer = class
  private
    fName     : string;
    fGoals    : Integer;
    fAttempts : Integer;
    function Accuracy : Real;              // auxiliary: private helper
  public
    constructor Create(sName: string);
    function    GetGoals : Integer;        // accessor
    procedure   SetName(sNew: string);     // mutator
    procedure   AddShot(bScored: Boolean); // mutator
    function    ToString : string;
  end;

constructor TPlayer.Create(sName: string);
begin
  fName := sName;  fGoals := 0;  fAttempts := 0;
end;

function TPlayer.GetGoals : Integer;
begin
  Result := fGoals;
end;

procedure TPlayer.SetName(sNew: string);
begin
  if sNew <> '' then                       // the mutator protects the attribute
    fName := sNew;
end;

procedure TPlayer.AddShot(bScored: Boolean);
begin
  Inc(fAttempts);
  if bScored then Inc(fGoals);
end;

function TPlayer.Accuracy : Real;
begin
  if fAttempts = 0 then Result := 0
  else Result := fGoals / fAttempts * 100;
end;

function TPlayer.ToString : string;
begin
  Result := fName + ': ' + IntToStr(fGoals) + '/' + IntToStr(fAttempts)
            + ' (' + FloatToStrF(Accuracy, ffFixed, 5, 1) + '%)';
end;
LEARN IT

The class used in the next questions: TTrip

A minibus taxi route stores its route name, its capacity, how many seats are booked and the fare per seat. Book adds seats only if enough are left and says whether it worked. SeatsLeft is a private helper. IsFull is True when no seats are left. Income is booked × fare.
Delphi
type
  TTrip = class
  private
    fRoute    : string;
    fCapacity : Integer;
    fBooked   : Integer;
    fFare     : Real;
    function SeatsLeft : Integer;
  public
    constructor Create(sRoute: string; iCapacity: Integer; rFare: Real);
    function    GetBooked : Integer;
    procedure   SetFare(rNew: Real);
    function    Book(iSeats: Integer) : Boolean;
    function    Income : Real;
    function    IsFull : Boolean;
    function    ToString : string;
  end;

4.2[G12] Be the computer: an object and its alias [7]

Complete the table for the object objT after each statement. SetFare accepts only a fare above 0, and Book accepts a booking only when enough seats are left. Show the money with 2 decimals.

Delphi
objT := TTrip.Create('Bellville-CBD', 15, 24.50);
objT.Book(6);
objT.Book(10);
objT.SetFare(-5);
objU := objT;
objU.SetFare(26);
objU.Book(9);
After this statementfBookedfFare (R)Book returnedIncome (R)
objT := TTrip.Create('Bellville-CBD', 15, 24.50);
objT.Book(6);
objT.Book(10);
objT.SetFare(-5);
objU := objT;
objU.SetFare(26);
objU.Book(9);

4.3[G12] Debug: a faulty class [4]

This part of TTrip compiles, but the program gives wrong answers. Find four errors.

Delphi
constructor TTrip.Create(sRoute: string; iCapacity: Integer; rFare: Real);
begin
  fRoute := sRoute;
  iCapacity := fCapacity;
  fFare := rFare;
end;

function TTrip.Book(iSeats: Integer) : Boolean;
begin
  if iSeats <= SeatsLeft then
    fBooked := iSeats;
  Result := True;
end;

4.4[G12] Write it: the constructor and two methods [7]

Use the TTrip interface above. Write the implementation of: the constructor (no seats are booked at the start); the mutator SetFare (accepts only a fare above 0); and Book (adds the seats and returns True only if enough seats are left, otherwise nothing changes and it returns False).

4.5[G12] Write it: an array of objects in the form [8]

The five trips below have already been created and stored in arrTrips[1..5] (array of TTrip), with the bookings shown:

RouteCapacityBookedFare (R)
1Bellville-CBD151524.50
2Parow-Century City12928.00
3Durbanville-Bellville151119.50
4Goodwood-CBD101022.00
5Kuils River-Bellville14617.00
Write the code to (a) show the total income of all five trips in lblTotal with 2 decimals; (b) count the trips that are full and show the number in lblFull; and (c) add the ToString of the trip with the highest income to memOut.

UNIT 52D arrays and recursion (Grade 12)

A 2D array is a table in memory: the first index chooses the row and the second chooses the column. Recursion solves a problem by calling itself on a smaller one. Both give the practical paper a short question every year.

By the end of this unit I can: (tick each box when you are sure)
One thing I want to ask my teacher:
THINK FIRST · no computer needed

5.1The taxi-rank grid

The number of people waiting at four taxi ranks was counted each hour from 06:00 to 09:00. Complete the totals by hand.
Rank06:0007:0008:0009:00Total
Bellville12253118
Parow8202722
Goodwood15303826
Durbanville5121610
Hour total
(a) Which hour was the busiest overall? (b) Add the four cells that run from the top-left corner to the bottom-right corner. (c) To total Goodwood's row, which number stays the same as you move from cell to cell, and which changes?
THINK FIRST · no computer needed

5.2Folding paper

A sheet of paper is folded in half again and again. Layers(0) = 1 (the flat sheet). Write the number of layers after 1, 2, 3 and 4 folds: ______, ______, ______, ______. Then complete: Layers(n) = ______ × Layers(______). What is Layers(6)? Which value is known without any further folding?
LEARN IT

2D arrays: which index stays fixed?

arrQ[r, c]: r is the row, c the column. Row total: fix r, loop c. Column total: fix c, loop r. Main diagonal: r and c are equal. Reset a total to 0 before the loop that builds it (inside the outer loop when there is one total per row or column). To remember where the best value is, keep the row or column number, not only the value. Build one string per row with the inner loop and add it to the memo after the inner loop ends.
Delphi
iRow3 := 0;                       // row total: row fixed, column changes
for c := 1 to 4 do
  iRow3 := iRow3 + arrQ[3, c];

for r := 1 to 4 do                // total of every row
begin
  iT := 0;
  for c := 1 to 4 do
    iT := iT + arrQ[r, c];
  memOut.Lines.Add(IntToStr(iT));
end;

iDiag := 0;                       // diagonal: one loop, r = c
for i := 1 to 4 do
  iDiag := iDiag + arrQ[i, i];
LEARN IT

Recursion: a function that calls itself

Every recursive routine needs a base case (an answer that needs no further call) and a recursive case that calls itself with a smaller problem, moving towards the base case. Without a base case the calls never stop (a stack overflow). To trace it, write down each call until the base case; then fill in the returned values from the bottom upwards. Anything written after the recursive call happens on the way back.
Delphi
function Factorial(n : Integer) : Integer;
begin
  if n <= 1 then
    Result := 1                        // base case
  else
    Result := n * Factorial(n - 1);    // recursive case
end;
// Factorial(4) = 4 * Factorial(3) = 4 * (3 * Factorial(2)) = 4 * 3 * 2 * 1 = 24

5.3[G10] Predict: nested loops [4]

Write what is added to memOut. (The inner loop builds one line; Trim removes the space at the end.)

Delphi
for i := 1 to 4 do
begin
  sLine := '';
  for j := 1 to i do
    sLine := sLine + IntToStr(i * j) + ' ';
  memOut.Lines.Add(Trim(sLine));
end;

5.4[G12] Busiest hour [4]

Use the taxi-rank grid in Think First (arrQ[rank, hour]). Write the values after each pass of the outer loop.

Delphi
iBest := 1;  iBestTot := 0;
for c := 1 to 4 do
begin
  iColTot := 0;
  for r := 1 to 4 do
    iColTot := iColTot + arrQ[r, c];
  if iColTot > iBestTot then
  begin
    iBestTot := iColTot;
    iBest := c;
  end;
end;
ciColTotiBestTotiBest
1
2
3
4

5.5[G12] Write it: the grid questions [6]

Use arrQ[1..4, 1..4] from Think First. Write code to: (a) store the total for Goodwood (row 3) in iRow3; (b) count in iQuiet the cells with a queue of fewer than 10; (c) store the sum of the main diagonal in iDiag.

5.6[G12] Trace a recursive function [5]

Trace Mix(5). List every call, say whether the base case is reached, and write the value each call returns (fill in from the bottom row upwards).

Delphi
function Mix(n : Integer) : Integer;
begin
  if n <= 1 then
    Result := 2
  else
    Result := 3 * Mix(n - 1) - n;
end;
Callnn <= 1 ?Value returned
Mix(5)5
Mix(4)4
Mix(3)3
Mix(2)2
Mix(1)1

5.7[G12] Predict: before and after the call [3]

Write the lines added to memOut by Echo(3). Notice what is printed on the way down and on the way back.

Delphi
procedure Echo(n : Integer);
begin
  if n > 0 then
  begin
    memOut.Lines.Add('in ' + IntToStr(n));
    Echo(n - 1);
    memOut.Lines.Add('out ' + IntToStr(n));
  end;
end;

5.8[G12] Write it: two recursive functions [6]

(a) Write function Gcd(a, b : Integer) : Integer: if b is 0 the answer is a, otherwise it is the Gcd of b and a mod b. (b) Write function Rev(s : string) : string that returns the text backwards (Table gives elbaT): an empty string is its own reverse; otherwise it is the reverse of all but the first character, followed by the first character.

UNIT 6Databases and SQL (Grades 11 and 12)

In Grade 11 you handled one table with Delphi code only. In Grade 12 you let SQL do the work, join two tables, and build the SQL inside Delphi. This unit uses one small database: the results of a school sports day.

By the end of this unit I can: (tick each box when you are sure)
One thing I want to ask my teacher:
THINK FIRST · no computer needed

6.1One table or two?

A teacher keeps every athlete in one big table, repeating the house and its captain on every row:
AthleteHouseHouse captain
Thabo MahlanguImpalaLerato Sithole
Ruan PretoriusImpalaLerato Sithole
Mpho SekhukhuneImpalaLerato Sithole
Aisha CassiemKuduRuan Visser
(a) Impala gets a new captain. How many rows must be changed, and what could go wrong? (b) How would you split the data into two tables? Name the table that holds the captain, and say which field links the two tables.
LEARN IT

The database used in this unit

tblHouse (primary key HouseID) and tblAthlete (primary key AthleteID; HouseID is the foreign key). Dates are Date/Time fields.
HouseIDHouseNameColourCaptain
1ImpalaGoldLerato Sithole
2KuduGreenRuan Visser
3ElandBlueNomsa Zulu
4SpringbokRedKiara Naidoo
IDNameGradeHouseIDEventPointsEventDate
1Thabo Mahlangu121100m82026/02/20
2Aisha Cassiem112100m62026/02/20
3Pieter Smit123Long jump92026/03/04
4Zinhle Dube104100m42026/02/20
5Ruan Pretorius111Relay72026/03/04
6Naledi Khumalo122Relay102026/03/11
7Cameron Adams103Long jump52026/03/04
8Lindiwe Ncube124Long jump82026/03/04
9Jaden Petersen113Relay62026/03/11
10Mpho Sekhukhune121Long jump32026/03/04
11Keegan Louw102Relay02026/03/11
12Amahle Zondi114100m72026/02/20
LEARN IT

Database code: Delphi tables, SQL and Delphi queries

Grade 11: a TADOTable is read with First, Eof, Next; a field is tblAthlete['Points']; Edit or Insert then Post changes the table. Delete removes the current record and moves to the next one by itself, so do not call Next after it. Never use Locate. Grade 12: SQL runs in a TADOQuery: Close, set SQL.Text, then Open for a SELECT or ExecSQL for INSERT, UPDATE and DELETE. Text from the user goes inside quotes, numbers are joined with IntToStr.
Delphi
tblAthlete.First;                          // G11: a TADOTable, no SQL
while not tblAthlete.Eof do
begin
  if tblAthlete['Points'] >= 8 then
  begin
    tblAthlete.Edit;                      // Edit ... Post to change a record
    tblAthlete['Points'] := tblAthlete['Points'] + 1;
    tblAthlete.Post;
  end;
  tblAthlete.Next;                        // never forget Next
end;
tblAthlete.Insert;                        // Insert ... Post adds a record
tblAthlete['Name'] := 'Sizwe Mkhize';
tblAthlete.Post;

qryAthlete.Close;                         // G12: a TADOQuery and SQL
qryAthlete.SQL.Text := 'SELECT Name FROM tblAthlete WHERE Grade = ' + IntToStr(sedGrade.Value);
qryAthlete.Open;                          // SELECT: Open
qryAthlete.SQL.Text := 'DELETE FROM tblAthlete WHERE Points = 0';
qryAthlete.ExecSQL;                       // INSERT, UPDATE, DELETE: ExecSQL
LEARN IT

SQL: clause order, joins and the traps

The computer works in this order: FROM (join the tables), WHERE (keep records), GROUP BY, HAVING (keep groups), SELECT, ORDER BY.
SQL
SELECT   Event, COUNT(*) AS Entries, AVG(Points) AS AvgPts
FROM     tblAthlete, tblHouse
WHERE    tblAthlete.HouseID = tblHouse.HouseID
         AND EventDate >= #2026/03/01# AND Name LIKE "A%"
GROUP BY Event
HAVING   COUNT(*) > 1
ORDER BY Entries DESC;

INSERT INTO tblHouse (HouseName, Colour) VALUES ("Oryx", "Purple");
UPDATE tblAthlete SET Points = Points + 1 WHERE Event = "Relay";
DELETE FROM tblAthlete WHERE Points = 0;

6.2[G11] Predict: looping through a table [3]

The table tblAthlete holds the records in the database above (in the order shown). Write what is added to memOut and what lblAvg shows.

Delphi
tblAthlete.First;
iCount := 0;
iTotal := 0;
while not tblAthlete.Eof do
begin
  if tblAthlete['Grade'] = 11 then
  begin
    Inc(iCount);
    iTotal := iTotal + tblAthlete['Points'];
    memOut.Lines.Add(tblAthlete['Name']);
  end;
  tblAthlete.Next;
end;
lblAvg.Caption := FloatToStrF(iTotal / iCount, ffFixed, 5, 1);

6.3[G11] Write it: change a table without SQL [8]

Use the TADOTable tblAthlete (no SQL). (a) Add 2 points to every Grade 12 athlete whose event is Relay. (b) Add a new record: name from edtName, grade 10, house 2, event 100m, 0 points. (c) Delete every athlete with 0 points.

6.4[G12] Result of a query: AND and OR [4]

A learner wrote the query below. Write the result in the table (as many rows as there are results; leave extra rows empty).

SQL
SELECT Name
FROM tblAthlete
WHERE Event = "100m" OR Event = "Relay" AND Points >= 7
ORDER BY Name;

Name

6.5[G12] Result of a query: join, GROUP BY and HAVING [4]

Write the result of this query on the two tables (it joins the tables, adds up each house's points and keeps only the houses with more than 18 points).

SQL
SELECT HouseName, COUNT(*) AS Entries, SUM(Points) AS Total
FROM tblHouse, tblAthlete
WHERE tblHouse.HouseID = tblAthlete.HouseID
GROUP BY HouseName
HAVING SUM(Points) > 18
ORDER BY SUM(Points) DESC;

HouseNameEntriesTotal

6.6[G12] Write it: six SQL statements [13]

Write the SQL for each: (a) the two athletes with the highest points (name and points); (b) the number of athletes and the average points for each event, with the headings Entries and AvgPoints; (c) the name and house name of every athlete whose EventDate is on or after 4 March 2026, ordered by house name and then name; (d) add athlete Sizwe Mkhize, Grade 10, house 2, event 100m, 5 points, date 18 March 2026; (e) add 2 points to every Relay athlete in house 3; (f) delete every athlete with 0 points.

6.7[G12] Debug: two faulty queries [4]

Both queries should work on the sports-day tables. Query 1 should list each house with the number of its athletes, for houses with more than 2 athletes. Query 2 should show the name and points of the 3 best athletes since 4 March 2026. Find four errors in total.

SQL
SELECT HouseName, COUNT(*) AS Entries
FROM tblHouse, tblAthlete
WHERE COUNT(*) > 2
GROUP BY HouseName;

SELECT Name, Points
FROM tblAthlete
WHERE EventDate > 2026/03/04
ORDER BY Points DESC
TOP 3;

6.8[G12] Write it: build the SQL in Delphi [9]

qryAthlete is a TADOQuery. (a) The user picks an event in cmbEvent and types a minimum in sedMin. List in memOut the name, house name and points of each athlete in that event with at least that many points, highest points first, as Name (House): Points, and show the number found in lblCount. (b) In btnBonus, add the number in sedBonus to the points of every athlete in the event chosen in cmbEvent.

PAPER 1 MINI-EXAMDelphi programming and SQL

Time: 120 minutes
Total: 78 marks
Mark: ______ / 78

No notes, no computer. Show all your working. Write Delphi code and SQL neatly, with correct indentation.

SECTION A — General programming: strings, loops, decisions and recursion [20]

A1 [6]

A school generates each learner's computer username from the full name typed in edtName (for example Thabo Molefe) and the birth year in sedYear. The username is the first letter of the first name, then the whole surname, both in small letters, followed by the last two digits of the year (with a leading zero if needed). For Thabo Molefe born in 2009 the username is tmolefe09; born in 2005 it would end in 05. Write code that shows the username in lblUser. The name always has exactly one space.

A2 [4]

Trace the code with iN = 6 at the start. Write the values after each pass of the loop.

Delphi
iSteps := 0;
while iN <> 1 do
begin
  if Odd(iN) then
    iN := 3 * iN + 1
  else
    iN := iN div 2;
  Inc(iSteps);
end;
PassiNiSteps
1
2
3
4
5
6
7
8

A3 [5]

A weather station's program reads temperatures with an InputBox until the user types the word stop (in capitals or small letters). Show the highest temperature in lblHigh and the average to one decimal in lblAvg. If no temperature was entered, show nothing. The word stop must not be treated as a temperature.

A4 [5]

The function CountSevens returns how many times the digit 7 appears in a whole number, using recursion: for 0 the answer is 0; otherwise it looks at the last digit (mod 10), adds 1 if it is a 7, and uses the function again on the number without its last digit (div 10). (a) Write the function. (b) State the value returned by CountSevens(70772) and the number of times the function is called altogether.

SECTION B — Arrays and text files (with a 2D array) [20]

B1 [5]

The text file tickets.txt lists matric-dance ticket sales: surname#grade#tickets on every line (at most 30 lines).

tickets.txt
Dlamini#12#4
Pieterse#11#2
Mokoena#12#6
Abrahams#10#1
Naidoo#12#3
Venter#11#5
Zulu#10#2
Write code that reads the file into the parallel arrays arrSurname, arrGrade and arrTickets (the grade and tickets as integers) and counts the lines in iCount.

B2 [3]

The user types a surname in edtFind. Search the arrays (use a linear search) and show Grade 12: 4 tickets (the learner's own grade and tickets) in lblFound, or Not found.

B3 [5]

Sort the three parallel arrays into descending order of tickets with a bubble sort, so that the learner with the most tickets is first.

B4 [3]

After the sort, write every learner with 4 or more tickets to a new text file big.txt, one per line, as Surname: tickets (for example Mokoena: 6).

B5 [4]

The sales of tickets by grade in four weeks are stored in arrSales[1..3, 1..4] (row = grade 10, 11, 12; column = week).

Week 1Week 2Week 3Week 4
Grade 101218915
Grade 1120142219
Grade 1225302835
Write code to (a) store the Grade 12 total in iG12; (b) find the week number with the highest total over all three grades and store it in iBestWeek.

SECTION C — Object-oriented programming [18]

C1 [3]

A library records every book that a learner has out. A book may be kept for 14 days; every extra day costs a fine of R2.50. The class TBookLoan is declared below.

Delphi
type
  TBookLoan = class
  private
    fTitle : string;
    fDays  : Integer;               // days the book has been out
    function DaysLate : Integer;
  public
    constructor Create(sTitle: string; iDays: Integer);
    function    GetTitle : string;
    procedure   SetDays(iNew: Integer);
    function    Fine : Real;
    function    ToString : string;
  end;
Write the type of method from the word bank. Word bank: constructor · accessor · mutator · auxiliary · ToString

MethodType
Create
SetDays
DaysLate

C2 [4]

Write the implementation of the constructor and of the mutator SetDays, which accepts a new number of days only if it is 0 or more.

C3 [4]

Write the private auxiliary function DaysLate (the days beyond 14, or 0 if the book is not late) and the function Fine, which uses DaysLate and returns the fine in rand.

C4 [3]

Write ToString, which returns text such as Long Walk to Freedom: 31 days, fine R42.50 (the fine always with 2 decimals).

C5 [4]

Five loans were created and stored in arrLoans[1..5] (array of TBookLoan):

TitleDays out
1Born a Crime14
2Spud9
3Long Walk to Freedom31
4Cry, the Beloved Country20
5Coconut15
Write code that (a) shows the total of all the fines in lblTotal with 2 decimals and (b) adds the ToString of every loan that has a fine above 0 to memOut.

SECTION D — Databases and SQL [20]

D1 [4]

A food bank keeps its donors and their donations in two tables:

TableFields
tblDonorDonorID (primary key), DonorName, Town
tblDonationDonationID (primary key), DonorID (foreign key), Item, Qty, DonationDate
DonationIDDonorIDItemQtyDonationDate
11Maize meal402026/05/04
22Canned beans242026/05/04
33Soap602026/05/11
41Canned beans362026/05/18
54Maize meal152026/05/18
62Soap122026/06/01
73Maize meal302026/06/01
81Soap252026/06/08
94Canned beans182026/06/08
103Canned beans482026/06/15
DonorID 1 is Bellville Rotary (Bellville), 2 Mrs Fourie (Durbanville), 3 Parow Pharmacy (Parow) and 4 Mr Naidoo (Goodwood).
Write the result of this query:
SQL
SELECT Item, Qty
FROM tblDonation
WHERE Qty >= 30 AND DonationDate < #2026/06/01#
ORDER BY Qty DESC;

ItemQty

D2 [5]

Write the result of this query (it uses both tables):

SQL
SELECT Town, SUM(Qty) AS Total
FROM tblDonor, tblDonation
WHERE tblDonor.DonorID = tblDonation.DonorID
GROUP BY Town
HAVING SUM(Qty) >= 60
ORDER BY SUM(Qty) DESC;

TownTotal

D3 [4]

Write a query that shows the donor name and the item of every donation made on or after 1 June 2026, in order of date.

D4 [3]

Write three statements: (a) add a donation of 20 Soap from donor 2 on 22 June 2026; (b) double the Qty of every donation from donor 4; (c) delete every donation made before 11 May 2026.

D5 [4]

The user types a donor's name in edtDonor. qryFood is a TADOQuery. Write code that lists in memOut the item and quantity of every donation of that donor, in order of date, as Soap: 60.

UNIT 7Hardware and software

Paper 2 tests Grades 10, 11 and 12 together, so this booklet revises all three years, topic by topic. The tag in each title shows the year in which the skill was first taught: [G10], [G11] or [G12]. Watch which tag you drop marks on. One writing rule for the whole booklet: every written answer is a sentence or a short paragraph, never a list of bullets, because a marker credits only as many bullet points as there are marks but reads a paragraph in full. This unit covers devices, memory and storage, performance, the operating system and the programs that translate code.

By the end of this unit I can: (tick each box when you are sure)
One thing I want to ask my teacher:
THINK FIRST · no computer needed

7.1[G10] Fast, small and costly

A computer can keep data in four places: cache, RAM, an SSD and an HDD. (a) Write them in order from fastest to slowest. (b) Write them in order from smallest to largest capacity. (c) In a sentence, say why we do not simply build a PC that has only cache.
LEARN IT

Memory, storage and the system unit

The CPU can only work with data it can reach quickly, so a computer uses a ladder of storage: small and fast at the top, big and slow at the bottom.
PartJobKeeps data without power?Remember
Cache (L1, L2, L3)Copies of recently used instructions and data, right next to the CPUNo (volatile)Fastest and smallest; more cache means the CPU waits less for RAM
RAMWorking memory for programs and data in use nowNo (volatile)Switch off and it is empty; more RAM lets more programs run
ROM / flash chipHolds the BIOS (or firmware), which runs the POST and then loads the OSYesRead-only does not mean “the hard drive”
Virtual memoryPart of the drive that the OS uses as extra RAM when RAM is fullOn the driveFar slower than RAM; too much swapping is thrashing
SSDFlash storage with no moving partsYesFast, silent, tough, but dearer per GB
HDDSpinning magnetic plattersYesCheap per GB, but slow, noisy and fragile
On the motherboard the CPU talks to the rest over buses: the data bus carries data and instructions, the address bus carries memory addresses and the control bus carries signals. A bus is shared; a point-to-point link joins exactly two parts (CPU to RAM). Expansion cards (graphics, sound, network) plug into PCIe slots. Input devices send data in (scanner, microphone), output devices present it (printer, projector), a touchscreen is both, and storage devices keep it.
LEARN IT

Performance and mobile hardware

FactorHow it changes performanceTypical symptom it fixes
CPU speed (GHz) and number of coresMore instructions per second; more cores handle more jobs at the same momentSlow calculation and video export
RAM amount and speedMore programs and data stay in fast memory, so less swappingFreezing with many programs open; drive light always on
Storage typeAn SSD loads the OS and programs far faster than an HDDLong start-up and slow program opening
GPU (graphics card)Draws graphics so the CPU does not have toGames and video editing stutter
NIC speedHow fast data enters and leaves the computer on the networkSlow file copying across a LAN
A smartphone puts the CPU, GPU, modem and often the memory on one chip, a system on a chip (SoC), which saves space and power and gives off less heat. It has a touchscreen, flash storage and built-in Bluetooth, Wi-Fi, 4G/5G, GPS and NFC. Its limits are the battery (faster processing drains it sooner), little room for cooling, a small screen and parts that cannot be upgraded.
LEARN IT

The operating system, utilities and translators

The operating system (OS) manages memory (including virtual memory), runs and switches between programs, handles files, talks to devices through drivers, controls users and security, and gives you the interface. OS types: stand-alone (Windows 11 on a PC), network/server, embedded (the router, an ATM) and mobile (Android). Utility software maintains the computer: antivirus, backup, disk clean-up, compression tools. Multitasking: one CPU switches so fast between programs that they seem to run together. Multithreading: one program is split into threads that progress together. Multiprocessing: two or more cores really work at the same instant.
CompilerInterpreter
TranslatesThe whole program, once, before it runsOne line at a time, while it runs
ResultA separate executable (.exe) that runs without the source codeNo separate file: the source code and interpreter are needed every time
Speed and errorsRuns fast; all syntax errors are listed before it will runRuns slower; stops at the line with the error
Licences: proprietary (bought, copies limited), open source (source code open to change and share), freeware (free, closed code) and shareware (free trial, then pay).

7.2[G10] Input, output, both or storage? [6]

Circle the group of each device.

1A barcode scanner at a spaza tillInput  Output  Both  Storage
2A receipt printerInput  Output  Both  Storage
3A touchscreen on a self-service kioskInput  Output  Both  Storage
4A memory card in a dashcamInput  Output  Both  Storage
5A projector in the school hallInput  Output  Both  Storage
6A microphoneInput  Output  Both  Storage

7.3[G10] Match the term [7]

Write the term from the word bank next to each description.
Word bank: BIOS · cache · driver · firmware · POST · ROM · utility

DescriptionTerm                                            
Very fast memory on or beside the CPU that holds recently used instructions
The start-up program on the motherboard that finds the operating system and loads it
The check of RAM, keyboard and storage that runs when the PC is switched on
Memory that keeps its contents when the power is off
Software stored permanently on a chip inside a device such as a router
A small program that lets the operating system control a particular printer
A small program that maintains the computer, such as a backup or disk clean-up tool

7.4[G11] Compare: compiler and interpreter [5]

Sipho writes a stock-control program in Delphi and sells it to 40 spaza shops. Differentiate between a compiler and an interpreter and say which of them produced the file that the shops run. Answer in a short paragraph.

7.5[G12] Pick the upgrade [5]

Write the one change that would help most in each case.
Word bank: faster NIC and switch · more RAM · SSD instead of HDD · scan for malware · graphics card (GPU)

SymptomBest fix                                            
A lab PC takes three minutes to start and every program is slow to open, yet only one program is running
Everything freezes and the drive light stays on once six browser tabs and a spreadsheet are open
A school's video-editing PC plays footage smoothly but the preview stutters while effects are drawn
Pop-up adverts appear and the PC has slowed down although nothing new was installed
Copying big files between lab PCs takes very long although the PCs themselves are fast

7.6[G12] Motivate a computer [5]

The school's media club edits football matches filmed in 4K. Motivate the specification of a computer for the club. Refer to the CPU, RAM, graphics and storage, and give a reason for each choice, in a paragraph.

7.7[G12] Phone versus desktop [4]

Explain why a smartphone uses a system on a chip (SoC) and why its battery limits how fast its processor may run.

UNIT 8Networks and the internet

From the earphones in your ear to the fibre line under the road, every network is built from the same few ideas: how far it reaches, how it is laid out, which devices join it, which rules (protocols) it follows and how it is kept private. This unit puts Grade 10 networks, Grade 11 protocols and topologies and Grade 12 remote access, SSL and web technologies on one page.

By the end of this unit I can: (tick each box when you are sure)
One thing I want to ask my teacher:
THINK FIRST · no computer needed

8.1[G11] The cable that was pulled out

A computer lab has ten PCs, each cabled to one central switch. (a) Thabo pulls the cable out of PC 4. What happens to the other nine PCs? (b) During load shedding the switch loses power. What happens to the lab? (c) The teacher says: “Add a second switch and a second link.” Which problem is she trying to solve?
LEARN IT

Network types, layouts and devices

TypeReachExample
PANA few metres around one personEarbuds, smartwatch and phone (Bluetooth)
HANOne homeRouter, smart TV, phones and a printer in a flat
LANOne building or campus, usually your own cablesThe school's labs and offices
WANCities, countries; uses lines leased from othersA bank's branches; the Internet is the biggest WAN
TopologyLayoutStrengthWeakness
StarEvery device joined to a central switchA cable fault affects one device; easy to add devicesIf the switch fails, everyone fails
BusAll devices share one backbone cableCheap and simpleA break in the backbone stops all; slows down as devices are added
RingEach device joined to two neighbours in a loopOrderly, few collisionsOne break can stop the whole ring
MeshDevices linked to several othersVery reliable: data finds another routeMany cables, so expensive
A NIC connects a device to the network. A switch joins the devices of one LAN and sends data only to the device it is meant for. A router joins different networks (your LAN and the Internet) and chooses the route using IP addresses. A wireless access point lets Wi-Fi devices join the wired network. A firewall filters traffic by rules; a modem converts between the line signal and the computer's data. In a client-server network a powerful server holds shared files, users and security and clients ask it for services: easy to manage and secure, but costly, and the server is a single point of failure. In a peer-to-peer network every computer is equal and shares directly: cheap and simple, but no central control and weak security. A thin client does most of its processing on the server; a thick client does it locally.
LEARN IT

Connections and protocols

ConnectionStrengthWeakness
FibreFastest, very stable, low delayNeeds a cable to the building
ADSL (copper phone line)Widely availableSlower; speed drops with distance
4G / 5GNo cable needed; 5G has very low delayExpensive capped data; signal varies
SatelliteWorks almost anywhereHigh delay (latency); costly
Wi-Fi / Bluetooth / NFCWireless inside a building / about 10 m / a few cm (tap to pay)Short range; Wi-Fi is easier to attack
ProtocolJob
HTTP / HTTPSWeb pages: HTTP as plain text, HTTPS encrypted with SSL/TLS
SMTPSends e-mail to and between mail servers
POP3Downloads e-mail to one device to read offline
IMAPKeeps e-mail on the server, so every device sees the same mailbox
FTPMoves large files between a computer and a server
VoIPVoice and video calls as packets over the Internet
Bandwidth is how much data fits through per second; latency is the delay. Speeds are in megabits (Mb) per second but files are in megabytes: 1 byte = 8 bits, so divide by 8 to compare. Time = file size in megabits ÷ speed in Mbps.
LEARN IT

Remote access, SSL and the web

A VPN builds an encrypted tunnel across the public Internet, so a person at home reaches the private network as if she were in the office and anyone who intercepts the data sees only scrambled text. SSL/TLS secures a browser-to-server connection (HTTPS and a padlock). The server shows its digital certificate, signed by a trusted authority, proving the site is genuine. The browser locks a secret session key with the server's public key; only the server's private key can unlock it, and both then encrypt the data with the session key. A static web page is the same for everyone; a dynamic page is built for you from a database.
TechnologyWhere it runsJob
HTMLBrowserContent and structure of the page
CSSBrowserColours, fonts and layout
JavaScriptBrowser (client-side)Reacts at once, for example checks a form before it is sent
PHPWeb server (server-side)Builds pages and talks to the database
AJAXBrowser asks server in the backgroundUpdates part of a page without reloading it
CookieStored on your deviceLets a site remember you (login, basket) and lets advertisers follow you
A keyword search matches the typed words, a semantic search works out the meaning and intention, and a mediated search looks only in a controlled collection (a library database). SEO improves a site’s rank by using the words people really search for, loading fast, working on phones and earning links from other sites.

8.2[G10] PAN, HAN, LAN or WAN? [5]

Circle the network type.

1Wireless earbuds linked to a phonePAN  HAN  LAN  WAN
2The smart TV, phones and router in one flatPAN  HAN  LAN  WAN
3The labs and offices of one school, joined by a switchPAN  HAN  LAN  WAN
4A bank’s link between its Cape Town and Durban officesPAN  HAN  LAN  WAN
5The InternetPAN  HAN  LAN  WAN

8.3[G10] Match the protocol [7]

Write the protocol from the word bank next to each job.
Word bank: FTP · HTTP · HTTPS · IMAP · POP3 · SMTP · VoIP

JobProtocol                                            
Sends an e-mail from your device to the mail server
Downloads your e-mail so you can read it offline on one device
Lets your phone and laptop show the same mailbox because messages stay on the server
Moves a large file between a computer and a server
Carries web pages as plain, unencrypted text
Carries web pages encrypted with SSL/TLS
Carries a voice call as small packets over the Internet

8.4[G11] How long is the download? [4]

A school downloads a 750 MB update (1 byte = 8 bits, so the file is 6 000 megabits). Complete the time for each connection, assuming the full speed is used.

ConnectionSpeed (Mbps)Time in secondsTime in minutes
Fibre100
ADSL20
4G10
Satellite2

8.5[G11] Draw the office network [5]

A taxi association office has 6 PCs, a printer, a file server and a manager who uses a tablet over Wi-Fi. A fibre line arrives from the ISP. Draw a star network showing every device, the devices that connect them and where the firewall sits. Label everything.

8.6[G12] Name the web technology [7]

Write the term from the word bank.
Word bank: AJAX · cookie · CSS · HTML · JavaScript · PHP · SEO

DescriptionTerm                                            
Describes the content and structure of a page: headings, paragraphs and links
Controls the colours, fonts and layout of a page
Runs in the browser and checks a form before it is sent
Runs on the web server, builds the page and talks to the database
Fetches new data in the background so only part of the page refreshes
A small file stored on your device so a site can remember you
Using the words people search for and loading fast so that a website ranks higher in search results

8.7[G12] Explain: SSL and the padlock [5]

Lindiwe buys airtime stock on a wholesaler’s website. The address starts with https and shows a padlock. Explain how the digital certificate and the public and private keys protect her card number.

8.8[G12] Motivate: fibre or a 4G router? [5]

A township internet cafe wants fast video calls for customers. Fibre is available and so is a 4G router. Motivate which should be the main link and which the backup, and say how load shedding should be handled. Answer in a paragraph.

UNIT 9Data and databases

A database is only as good as the data in it and the design under it. This unit revises how data becomes information, how we keep it correct, how tables are linked and designed on paper (normalisation), and how big organisations store and mine data.

By the end of this unit I can: (tick each box when you are sure)
One thing I want to ask my teacher:
THINK FIRST · no computer needed

9.1[G10] Data or information?

The hall thermometer is read every hour: 27, 31, 29, 35 (°C). (a) Which of these is data and which is information: “27, 31, 29, 35” or “The hall averaged 30.5 °C and was above 30 °C in the afternoon”? (b) What had to be done to turn one into the other? (c) The 31 is typed as 13 by mistake. What average would be reported, and what do we call this problem?
LEARN IT

Data quality, validation and collection

Data is raw facts without meaning; information is data that has been processed and put in context. A DBMS stores data and controls access, security, backups and multi-user use. GIGO: wrong data in means wrong information out. Validation is done by the program and checks that data is reasonable; verification checks that it is the same as the source (typing it twice, proofreading against the form). Validation cannot see a mark of 89 typed instead of 98.
CheckTestsExample
PresenceSomething was enteredSurname may not be empty
RangeBetween a minimum and a maximumMark 0 to 40
LengthNumber of charactersCell number has 10 digits
TypeKind of dataAge holds digits only
FormatPatternE-mail has @ and a dot after it
ListOne of the allowed valuesProvince chosen from nine
Check digitLast digit is calculated from the others, so a typing slip is noticedBarcodes, ISBNs, ID numbers
Collecting data: web forms, RFID tags read by radio (e-toll, stock), sensors, cookies, transaction tracking (every card swipe) and mobile apps (location). Metadata is data about data, such as the date, size and GPS position stored in a photo file.
LEARN IT

Keys, relationships and integrity

A primary key (PK) identifies each record: never empty, never repeated. A foreign key (FK) is a field that holds another table’s primary key and so creates the link; it may repeat and may be empty. A composite key uses two or more fields together.
RelationshipMeaningHow it is built
One-to-one (1:1)One record matches one recordThe same key in both tables
One-to-many (1:M)One record matches manyPut the PK of the ‘one’ table into the ‘many’ table as an FK
Many-to-many (M:M)Many match manyCannot be stored directly: add a link table that holds both PKs as FKs, giving two 1:M relationships
Referential integrity: every foreign key must match an existing primary key. It stops you adding a record that points at nothing (an orphan) and stops you deleting a record that others still use. Logical integrity keeps data correct and consistent (validation, referential integrity, record locking, which stops two users editing the same record at once); physical integrity protects it from damage (UPS, RAID, backups).
LEARN IT

Normalisation, anomalies and big data stores

Repeating the same fact in many rows (redundancy) causes three anomalies: insertion (you cannot record one fact without another), deletion (deleting one fact wipes out another) and modification (a change must be made in many rows, and missing one makes the data disagree with itself). Normalisation removes them by splitting a table. 1NF: one value per cell, no repeating columns, and a primary key. 2NF: in 1NF, and every other field depends on the whole composite key (move a field that depends on part of the key to its own table). 3NF: in 2NF, and no non-key field depends on another non-key field (move that pair out).
DatabaseData warehouse
PurposeDay-to-day transactionsAnalysis and reports over many years
DataCurrentHistorical, collected from many databases, cleaned first
Used byStaff and programs that insert, update and deleteAnalysts and management, who mostly read
Data mining searches very large data sets for hidden patterns, such as which products are bought together. A centralised database sits on one server (simple, but one point of failure); a distributed one is spread across several servers or sites (faster for distant users, but copies must be kept in step).

9.2[G11] Choose the check [6]

Write the validation check from the word bank.
Word bank: format · length · list · presence · range · type

RuleCheck                                            
The surname box may not be left empty
A test mark is out of 40, so it must be 0 to 40
A South African cell number must have exactly 10 digits
The age box may contain only digits
An e-mail address must contain an @ with a dot after it
The province must be picked from the nine allowed names

9.3[G11] Work out the check digit [7]

A product code has 4 digits plus a check digit. Multiply the digits by 3, 1, 3, 1 in turn and add. The check digit is the number needed to reach the next multiple of 10 (0 if the sum already is one). Example: code 4276 gives 3×4 + 2 + 3×7 + 6 = 41, so the check digit is 9 and the full code is 42769. Complete the first three rows. For the last two, work out the correct check digit and say whether the code is valid; leave the last column of the first three blank.

CodeWeighted sumCorrect check digitValid?
5083
7219
4650
72195
46508

9.4[G11] Read the ERD [5]

A taxi association stores its trips in the database below. Answer from the diagram.tblTaxiPKTaxiIDRegSeatstblTripPKTripIDFKTaxiIDFKRouteIDTripDatePassengerstblRoutePKRouteIDRouteNameFare1M1M

QuestionAnswer                                                                
The primary key of tblTrip
The two foreign keys in tblTrip
The relationship between tblTaxi and tblTrip (one-to-many?)
The many-to-many relationship that tblTrip resolves
Explain one thing that referential integrity stops in tblTrip

9.5[G11] Draw the ERD: donors and events [5]

A school records donors and fundraising events. A donor can give to many events and an event receives gifts from many donors. Draw an ERD with tblDonor, tblEvent and a link table tblGift. Write the fields, mark every PK and FK and put 1 or M at the right ends.

9.6[G12] One value per cell (1NF) [6]

The table below is not in 1NF because the Club column holds several values. Rewrite it in 1NF: give each club its own row. Then the primary key must be LearnerNo and Club together.

LearnerNoNameClub
1021Aphiwe DlaminiChess, Debating
1034Ruan BothaChoir
1047Sana PatelChess, Choir, Robotics

LearnerNoNameClub (one per row)
1021Aphiwe Dlamini
1021Aphiwe Dlamini
1034Ruan Botha
1047Sana Patel
1047Sana Patel
1047Sana Patel

9.7[G12] Whose field is it? [6]

The stock-order table below has the composite primary key OrderNo + ItemCode. For each other field say what it depends on and which problem (if any) it causes.

OrderNoItemCodeItemNameItemPriceQtyOrderDateSupplierIDSupplierName
801B12BreadR18.504002 MarS1Bellville Cash and Carry
801M07Maize mealR52.001202 MarS1Bellville Cash and Carry
802B12BreadR18.502509 MarS2Cape Wholesalers
802D03Milk 2 LR34.901809 MarS2Cape Wholesalers
803M07Maize mealR52.001016 MarS1Bellville Cash and Carry

FieldDepends onProblem
Qty
ItemName
ItemPrice
OrderDate
SupplierID
SupplierName

9.8[G12] Write the 3NF tables [7]

Split the stock-order table into 3NF. Write each table with its fields and mark the primary keys (PK) and foreign keys (FK).

9.9[G12] Which anomaly? [3]

Circle the anomaly shown in each case. Use the stock-order table above.

1A new supplier, Karoo Foods, cannot be stored until someone orders from it.Insertion  Deletion  Modification
2Order 802 is cancelled and its rows deleted; Cape Wholesalers and the price of milk vanish with it.Insertion  Deletion  Modification
3The bread price rises, but only one of its 2 rows is changed, so the table shows two prices.Insertion  Deletion  Modification

UNIT 10Number systems and data representation

Everything on a computer, from your name to a video of the match, is stored as patterns of 0s and 1s. This unit revises counting in binary and hexadecimal, how characters and pictures are stored, how big files are, and what compression gives up.

By the end of this unit I can: (tick each box when you are sure)
One thing I want to ask my teacher:
THINK FIRST · no computer needed

10.1[G10] Eight switches

A spaza owner has a row of light switches. With 1 switch there are 2 patterns (off or on). How many different patterns can 2 switches make? And 3? Spot the rule, then work out how many patterns 8 switches make and the largest number they can show if each switch is worth 1, 2, 4, 8, 16, 32, 64 and 128 when it is on.
LEARN IT

Counting like a computer

Place values in binary double each step: 128  64  32  16  8  4  2  1. Binary to decimal: add the place values that have a 1 (00101101 = 32 + 8 + 4 + 1 = 45). Decimal to binary: divide by 2 again and again and read the remainders from the bottom up, or subtract place values from the left. Hexadecimal (base 16) uses 0 to 9 and A (10) to F (15), and one hex digit is exactly 4 bits, so split a byte into two nibbles: 1010 1101 = A D = AD. To convert hex to decimal use 16s: AD = 10×16 + 13 = 173. n bits give 2n patterns.
Text and storage
ASCII7-bit code (128 characters), usually stored in a byte; English letters, digits and symbols. A = 65, a = 97, 0 = 48, space = 32.
UnicodeUses more bits per character (UTF-8, UTF-16, UTF-32) so it can hold every script (isiZulu, Chinese, Arabic) and emoji; the first 128 codes are the same as ASCII.
Units1 byte = 8 bits; 1 KB = 1 024 bytes; 1 MB = 1 024 KB; 1 GB = 1 024 MB; 1 TB = 1 024 GB. Multiply to go down a unit, divide to go up.
LEARN IT

Pictures, files and compression

A true-colour (24-bit) picture needs 3 bytes per pixel, so size in bytes = width × height × 3. Divide by 1 024 for KB and again for MB. A compression ratio of 20:1 means the compressed file is one twentieth of the original; saving (%) = (original − compressed) ÷ original × 100. Lossless compression (ZIP, PNG) lets you rebuild the original exactly, so use it for documents, logos and medical images. Lossy compression (JPEG, MP3, MPEG-4) throws away detail people hardly notice, so the file is much smaller but the original cannot be rebuilt; more compression means lower quality.

10.2[G10] Decimal to binary and hex [6]

Write each number as an 8-bit binary number and as hexadecimal.

Decimal8-bit binaryHexadecimal
37
90
173

10.3[G10] Back to decimal [4]

Convert each number to decimal. Show your working in the margin.

NumberDecimal
11010110 (binary)
01101001 (binary)
7C (hex)
B3 (hex)

10.4[G10] ASCII [7]

Use A = 65, a = 97 and 0 = 48 (the codes run in order). Complete the table; in the last row decode the four bytes to a word.

Character or bytesASCII decimalBinary or word
T
x
7
01010100 01000001 01011000 01001001

10.5[G11] Storage sums [5]

Use 1 KB = 1 024 bytes, 1 MB = 1 024 KB and 1 GB = 1 024 MB.

QuestionAnswer
(a) Convert 3.5 GB to MB
(b) How many 4 MB photos fit on a 2 GB flash drive?
(c) Convert 6 144 KB to MB
(d) How many bytes are in 8 KB?
(e) A 500 GB drive holds 380 GB of data. What percentage of the drive is free?

10.6[G11] Picture size and saving [6]

A true-colour photo is 1 280 × 720 pixels (3 bytes per pixel). Work out its size and its size after JPEG compression at 20:1.

Working
pixels := width * height
bytes  := pixels * 3
KB     := bytes / 1024
MB     := KB / 1024
JPEG   := bytes / 20
saving := (bytes - JPEG) / bytes * 100
StepWorkingAnswer
11 280 × 720
2pixels × 3
3bytes ÷ 1 024
4KB ÷ 1 024 (2 decimals)
5bytes ÷ 20
6saving as a percentage

10.7[G11] Motivate: pictures for the school website [5]

The school website will show 40 action photos of sport and the school badge (flat colours). Motivate the compression you would use for each, and explain why in a paragraph.

UNIT 11Security, crime and society

Technology brings risks and changes how we live and work. This unit revises the malware and attacks that threaten a system, the safeguards that stop them, cybercrime and the law, and the social effects of the connected world, with paragraph practice for the long questions.

By the end of this unit I can: (tick each box when you are sure)
One thing I want to ask my teacher:
THINK FIRST · no computer needed

11.1[G10] The office PC audit

Mrs Naidoo, the school secretary, has a PC with her password on a sticky note, learners’ marks on it that were never copied anywhere, a flash drive that goes home with her every day, and no screen lock when she walks away. Write four different things that could go wrong, and next to each the fix.
LEARN IT

Malware, attacks and safeguards

MalwareHow it works
VirusAttaches to a file and spreads when a person opens that file
WormSpreads by itself across a network, no user action needed
TrojanLooks like useful software; does harm once you run it
RootkitHides deep in the OS and gives an attacker hidden control
RansomwareEncrypts your files and demands payment to unlock them
Spyware / adwareSecretly records what you do / shows unwanted adverts
BotnetMany infected computers (zombies) controlled in secret, often to send spam or attack a site
AttackHow it works
PhishingA fake e-mail or SMS tricks you into giving your details; you click the link
PharmingSends you to a fake website even if you typed the right address
SpoofingForges the sender’s address or identity
DDoSFloods a server with traffic from many computers so real users cannot get in
SQL injectionMalicious SQL typed into a web form to read or change the database
Social engineeringTricks a person, not a machine, into revealing information
Safeguards: antivirus and updates, a firewall, strong passwords with MFA, access rights (least privilege), encryption, input validation (against SQL injection), user training, a UPS and surge protection for load shedding, and backups. The 3-2-1 rule: three copies, on two kinds of media, one of them off-site or offline (so ransomware or a fire cannot reach it).
LEARN IT

Cybercrime, criminals and the law

Criminals: a black-hat hacker breaks in for harm or gain (a white-hat hacker does it with permission to find weaknesses); a cracker breaks software protection; a script kiddie uses tools made by others; an insider misuses the access he already has. Other cybercrimes: identity theft, online fraud, cyberbullying, piracy, bandwidth theft, piggybacking on someone’s Wi-Fi and cyber-extortion. Effects: a person loses money, privacy and peace of mind; a business loses money, customers’ trust, trade secrets and time while systems are down, and may be fined. South African law: the Cybercrimes Act makes hacking, ransomware, fraud and malicious messages crimes; POPIA says an organisation may collect personal information only for a stated reason and with consent, must keep it accurate and secure, may keep it no longer than needed, and must report a breach; the ECT Act covers electronic transactions.
LEARN IT

Technology and society

Big Data is data too large, too fast or too varied for ordinary tools: volume, velocity, variety. The Internet of Things is physical objects with sensors that send and receive data automatically. 4IR merges the physical, digital and biological worlds (AI, robots, IoT, Big Data): routine jobs may disappear, new ones appear and workers must retrain. AI and machine learning let computers learn from data to decide or predict; the risks are bias in the data, lost jobs and decisions nobody can explain. Virtual reality (VR) puts you inside a computer-made world with a headset; augmented reality (AR) adds computer images to the real world you still see. Cloud computing rents storage and software over the Internet: pay only for what you use, reach your files anywhere, backups and updates handled for you; but you depend on the connection (and data costs and load shedding), your data sits on someone else’s servers and privacy is a worry. A blockchain is a chain of records, each holding the hash of the block before, copied on many computers, so an old record cannot be changed without notice. The digital divide separates people who have devices, data and skills from those who do not (cost, rural areas, skills). Green computing saves energy and cuts e-waste: power-saving settings, switching off, recycling, longer-lasting devices, cloud sharing. Your digital footprint is the trail of data you leave: active (posts, forms) or passive (cookies, location logs).

11.2[G11] Name the malware [8]

Write the type of malware from the word bank.
Word bank: adware · botnet · ransomware · rootkit · spyware · Trojan · virus · worm

DescriptionMalware                                            
Spreads across the school network by itself, with nobody opening anything
Looks like a free game, but gives a criminal access once it is run
Locks every file on the office PC and demands R5 000 for the key
Records every key you press, including passwords
Shows pop-up adverts you never asked for
Attaches itself to a document and spreads when the document is opened
Hides deep inside the OS so that antivirus does not notice it
A group of infected PCs, secretly controlled, used to flood a website

11.3[G11] Name the attack [6]

Write the attack from the word bank.
Word bank: DDoS · pharming · phishing · social engineering · spoofing · SQL injection

What happenedAttack                                            
A fake bank e-mail asks the customer to click a link and type her PIN
The customer types the bank’s correct address but lands on a copy of the site
A criminal types code into the login box that makes the database show every user
Thousands of computers request an online shop’s page at the same moment, so it crashes
A caller pretends to be from IT and asks the clerk for her password
A message appears to come from the principal’s e-mail address but does not

11.4[G10] Threat and safeguard [6]

Write the safeguard that best deals with each threat.
Word bank: access rights · antivirus · backup kept off-site · encryption · firewall · UPS

ThreatSafeguard                                            
A power cut during load shedding switches the server off in the middle of saving
A thief steals a laptop that holds learners’ personal details
A flood destroys the office, the PC and the backup disk beside it
An attacker outside the school tries to connect to the LAN
A learner opens marks that only teachers should see
A downloaded game contains a virus

11.5[G11] Plan the backup [5]

A spaza owner keeps all her sales and stock records on one laptop at the shop. Explain the 3-2-1 backup rule and why one copy must be kept off-site or offline, using a theft or a ransomware attack as your example.

11.6[G12] Cybercrime: the fake SMS [7]

A fake SMS tells taxi drivers that their licences are suspended and that they must click a link and pay a fine. Identify the cybercrime, explain how it works, discuss two effects on a driver and give two safeguards. Write a paragraph.

11.7[G12] POPIA [4]

The school keeps learners’ ID numbers, addresses and marks. Explain two things that POPIA requires the school to do with this information.

11.8[G12] Match the technology [6]

Write the technology from the word bank.
Word bank: AI and machine learning · augmented reality · blockchain · cloud computing · Internet of Things · virtual reality

DescriptionTechnology                                            
Rents storage and software over the Internet and bills only for what is used
A headset puts the user inside a computer-made world
A phone camera shows a car’s service history on top of the real car
Computers learn from past data to recognise faces or predict faults
A shared chain of records, each linked to the one before, copied on many computers
Objects with sensors, such as a prepaid meter, that send data automatically

11.9[G11] Discuss: the digital divide [4]

Explain what the digital divide is, give two reasons for it in South Africa and say one way to reduce it.

11.10[G10] Green computing [3]

Explain two ways in which a school can practise green computing and why each helps the environment.

UNIT 12Exam answering skills

Marks are lost in the exam room for avoidable reasons: a command word ignored, a mark allocation not counted, an answer that names things but never explains them. This unit trains the habits that protect marks before you sit the mini-exam.

By the end of this unit I can: (tick each box when you are sure)
One thing I want to ask my teacher:
LEARN IT

Read, count, plan, write

Read the whole question and underline the command word. Count the marks: usually one separate, correct point per mark, so [3] means three points. Plan the points in the margin. Write so that every point has the shape point → because → so/for example, using the names in the scenario (the spaza shop, the taxi association, the school). Check that you made as many points as there are marks, and never leave a question blank. A point that is named but not explained usually earns half or nothing.
Command wordWhat to do
Name / State / List / IdentifyGive the answer only: a word or short phrase for each mark.
Define / DescribeSay what it is or what it does, in a sentence.
ExplainSay what and why or how: a point and its reason for each mark.
Differentiate / CompareShow how two things differ with both things in every sentence.
DiscussGive both sides (advantage and disadvantage, benefit and risk) and explain each.
Motivate / Justify / RecommendChoose, then give reasons; the word because must appear.
CalculateFormula, working and answer with its unit.
LEARN IT

A model paragraph, mark by mark

Discuss one advantage and one disadvantage of paying taxi fares with a card instead of cash. [4]
Sentence of the answerMarkWhy it earns the mark
Card payments are an advantage because the driver does not have to carry or count cash,1Advantage named
so he is less likely to be robbed and the fare is recorded automatically.1Advantage explained
A disadvantage is that the system needs a working network connection and electricity,1Disadvantage named
so during load shedding or a signal failure passengers cannot pay and the driver loses income.1Disadvantage explained with a result
Notice that each pair of sentences is a point and its reason, in the scenario’s words. The same four ideas as bullets (“less cash – recorded – needs network – load shedding”) show no reasoning, and a marker may stop reading after the marks available.

12.1[G12] Plan, then write [4]

Discuss one advantage and one disadvantage of a municipality using an AI chatbot to answer residents’ questions about accounts. [4]
Write your plan in the margin first (a few words for each point), then your paragraph underneath.

12.2[G12] Mark it, then fix it [3]

Explain why shops should keep the software on their tills up to date. [3]
Learner’s answer: “Updates are important. Software must be updated so it is up to date. It is good for the shop.”
The marking guideline gives one mark each for: (1) updates repair security weaknesses; (2) criminals use known weaknesses to infect or break in; (3) updates also fix faults and add features, so the tills run reliably. (a) How many marks does the learner earn? Why? (b) Rewrite the answer so that it earns all three.

12.3[G12] Time per mark [6]

The NSC Paper 2 has 150 marks and lasts 180 minutes, so each mark gets minutes and a 6-mark question about minutes. If you keep 10 minutes at the end for checking, you have minutes for the questions, which is minutes per mark. The mini-exam in this booklet has marks in 120 minutes, so you have about minutes per mark.

PAPER 2 MINI-EXAMTheory, Grades 10 to 12

Time: 120 minutes
Total: 77 marks
Mark: ______ / 77

No notes, no computer. Answer in full sentences or short paragraphs, never bullet points. Read each question twice and count the marks.

SECTION A — Short questions [21]

A1[G10] Circle the correct word [5]

Circle the correct answer in each case.

1The BIOS is stored inRAM  ROM
2Which has no moving parts?HDD  SSD
3Which translator converts the whole program before it runs?Compiler  Interpreter
4Which malware spreads across a network by itself?Virus  Worm
5Which e-mail protocol keeps the messages on the server?POP3  IMAP

A2[G10] Number systems [4]

Answer in the table.

QuestionAnswer
(a) Write decimal 59 as an 8-bit binary number
(b) Convert binary 10110100 to decimal
(c) Convert decimal 203 to hexadecimal
(d) Convert hexadecimal 3D to decimal

A3[G11] Which validation check? [4]

Write the check from the word bank.
Word bank: check digit · length check · list check · range check

RuleCheck                                            
A learner number must have exactly 6 digits
A learner’s age must be from 5 to 19
The grade is chosen from a drop-down showing 8, 9, 10, 11 and 12
The last digit of a product code is worked out from the other digits

A4[G11] Picture size [4]

A true-colour photo is 640 × 480 pixels at 3 bytes per pixel (1 KB = 1 024 bytes, 1 MB = 1 024 KB).

QuestionAnswer
(a) Number of pixels
(b) File size in bytes
(c) File size in KB
(d) Size in KB after JPEG compression at 10:1

A5[G12] Name the term [4]

Write the term from the word bank.
Word bank: botnet · DDoS attack · metadata · record locking · SoC

DescriptionTerm                                            
One chip that holds the CPU, graphics, modem and memory of a phone
Data that describes other data, such as the date and GPS position stored in a photo
Stops two users from editing the same record at the same moment
Infected computers secretly controlled by a criminal

SECTION B — Hardware, software and networks [16]

B1[G11] Slow library PCs [4]

The twelve PCs in the Siyakhula Community Library freeze when four programs are open, and the hard-drive light stays on. Explain what virtual memory is, why it causes the freezing and name one upgrade that would solve the problem.

B2[G10] Which protocol? [4]

Write the protocol from the word bank.
Word bank: FTP · HTTPS · IMAP · POP3 · SMTP

JobProtocol                                            
Sends an e-mail from the librarian’s PC to the mail server
Lets her phone and PC show the same mailbox
Carries the library’s online payment page with the data encrypted
Uploads a large file of new books to the supplier’s server

B3[G10] Why a server? [4]

The library has 12 PCs for the public. The librarian wants a client-server network and not a peer-to-peer network. Explain two reasons for her choice.

B4[G12] Working from home [4]

The librarian wants to open the library’s catalogue server from home. Explain how a VPN protects the data on the way, and give one remaining risk of remote access.

SECTION C — Data and databases [23]

C1[G11] Draw the ERD [5]

A clinic keeps a record of every visit. A patient can have many visits, each visit is with one doctor, and a doctor sees many visits. Draw an ERD with tblPatient, tblDoctor and tblVisit. Show the fields, mark each PK and FK and put 1 or M at the correct ends.

C2[G12] Whose field is it? [4]

The clinic’s old table has the composite key PatientID + VisitDate. For each field below, say what it depends on and which problem (if any) it causes.

PatientIDVisitDatePatientNameDoctorIDDoctorNameFee
220105 AugNomsa ZunguD1Dr PillayR280.00
220119 AugNomsa ZunguD2Dr SmitR350.00
221405 AugKabelo MosiaD2Dr SmitR320.00
223012 AugAnele CeleD2Dr SmitR320.00

FieldDepends onProblem
PatientName
DoctorID
DoctorName
Fee

C3[G12] Which anomaly? [3]

Circle the anomaly shown, using the clinic table in the question above.

1Dr Smit’s name is corrected in one of her three rows only, so it is spelled two ways.Insertion  Deletion  Modification
2A new doctor cannot be saved until a patient has a visit with her.Insertion  Deletion  Modification
3Anele Cele’s only visit is deleted and her name disappears from the database.Insertion  Deletion  Modification

C4[G12] Normalise to 3NF [6]

Write the clinic table in 3NF. Show each table with its fields and mark the primary keys (PK) and foreign keys (FK).

C5[G12] Warehouse and mining [5]

A group of 30 clinics keeps a separate database at each clinic. Management wants to study ten years of visits to see in which months flu visits peak. Explain what store they should build and how it differs from the clinics’ databases, and name the process of finding the patterns.

SECTION D — Security, crime and society [17]

D1[G12] Cybercrime: the municipal breach [6]

Hackers broke into a municipality’s billing database and published residents’ ID numbers, addresses and account details. Discuss the effects of the breach on the residents and on the municipality, and give two safeguards the municipality should have used. Answer in a paragraph.

D2[G11] Discuss: IoT street lights [4]

A municipality fits IoT sensors to its street lights. Discuss one benefit and one risk of the system.

D3[G12] Cloud for a small office [4]

A small municipal office with no IT staff considers moving its documents to the cloud. Explain one advantage and one disadvantage of this decision.

D4[G11] The digital divide [3]

The municipality moves all services online. Explain what the digital divide is and how this decision could widen it.

UNIT 13The final stretch

Revision only works when it is planned. Use this page to decide how you will spend the days before each paper, and go back to your self-audit to see how far you have come.

By the end of this unit I can: (tick each box when you are sure)
One thing I want to ask my teacher:

13.1My exam-week plan

Plan the last days before each paper. Write when you will do your final run-through, which topics you will go over once more, what you will pack for the exam room, and what you will do the evening before to be rested.