Skip to content

Information Technology Grade 12 P1 2026 Memo (Eng)

MemorandumInformation TechnologyGrade 12202627 pagesPublisher: Hlayiso

Grade 12 Information Technology Paper 1 memorandum from the NSC November Mock Exam 2026 (English), 27 pages. Read online or download the free PDF.

Free to read online, no sign-up needed

Loading document…

Loading document…

NSC November Mock Exam 2026

Document textSearch extracted text and jump to a page.
hlayiso mock exams Practice Series: Grade 12 NSC Preparation WWW.HLAYISO.COM NATIONAL SENIOR CERTIFICATE GRADE 12 INFORMATION TECHNOLOGY P1 MOCK EXAMINATION 2026 MARKING GUIDELINES MARKS: 150 These marking guidelines consist of 27 pages. Copyright reserved Please turn over
Information Technology/P1 2 Hlayiso/Mock 2026 NSC – Marking Guidelines GENERAL INFORMATION: • These marking guidelines are to be used as the basis for the marking session. Markers should discuss the guidelines before marking to ensure that they are consistently interpreted and applied. • Learners who provide an alternative correct solution to the one given in the marking guidelines must be given full credit for the relevant solution, unless the specific instructions in the paper were not followed or the requirements of the question were not met. • Annexures A, B, C and D contain the marking grid for each question. • Annexures E, F, G and H contain examples of solutions for QUESTION 1 to QUESTION 4 in programming code. The complete model-solution projects are supplied in the folder memo_p1_solutions. • Copies of Annexures A, B, C and D and the summary of the learner’s marks should be made for each learner and completed during the marking session. • Code that is not executed (e.g. because of syntax errors in another part of the program) must still be marked, but marks are only awarded for statements that are logically correct. Copyright reserved Please turn over
Information Technology/P1 3 Hlayiso/Mock 2026 NSC – Marking Guidelines ANNEXURE A QUESTION 1: MARKING GRID – GENERAL PROGRAMMING SKILLS CENTRE NUMBER: EXAMINATION NUMBER: QUESTION DESCRIPTION MAX. LEARNER’S MARKS MARKS 1.1.1 Button [1.1.1 - Panel] 4 pnlQ1_1.Caption := 'Water is life!' ✓ pnlQ1_1.Color := clAqua ✓ pnlQ1_1.Font.Color := clNavy ✓ pnlQ1_1.Font.Size := 18 ✓ 1.1.2 Button [1.1.2 - Time] 4 Hours: SECONDS DIV 3600 ✓ Minutes: (SECONDS MOD 3600) DIV 60 ✓ Seconds: SECONDS MOD 60 ✓ Display in lblQ1_1_2 with ’h’, ’min’ and ’s’ labels and values converted to string ✓ Also ACCEPT: Minutes: (SECONDS DIV 60) MOD 60. NO marks for hard-coded answers (e.g. '2 h 3 min 5 s'). 1.2 Button [1.2 - Invest] 8 Extract P, r and n from the three edit boxes ✓ converted to numeric values (StrToFloat / StrToInt) ✓ Calculate the final amount: rA := rP *✓ Power(✓ 1 + rR / 1200✓ , 12 * iYears)✓ Display in lblQ1_2 with the text ’Final amount: ’ ✓ in currency format with a rand sign, 2 decimal places ✓ FormatFloat('R 0.00', rA) / FloatToStrF(rA, ffCurrency, 10, 2) NOTE: Brackets must be correct in the calculation. Also ACCEPT: a loop that multiplies by (1 + r/1200) 12*n times (2 marks for the Power part). Copyright reserved Please turn over
Information Technology/P1 4 Hlayiso/Mock 2026 NSC – Marking Guidelines QUESTION DESCRIPTION MAX. LEARNER’S MARKS MARKS 1.3 Button [1.3 - Dam levels] 10 if NOT FileExists('Dams.txt') ✓ Display a suitable message and Exit ✓ AssignFile(tFile, 'Dams.txt') and Reset(tFile) ✓ Loop while NOT Eof(tFile) ✓ Readln(tFile, sLine) ✓ Extract name of dam: Copy(sLine, 1, Pos(';', sLine) - 1) ✓ Extract percentage after ’;’ and convert to real ✓ Display name, ’ - ’, percentage to 1 decimal place and ’%’ in redQ1_3 ✓ If percentage < 50: add ’ (LOW)’ to the line and increment counter ✓ After the loop: display counter with the label ’Number of dams below 50%: ’ (counter initialised to 0) ✓ Also ACCEPT: Delete to extract the parts; FormatFloat('0.0', rLevel). 1.4 Button [1.4 - Fare] 6 Extract number of trips from spnQ1_4.Value ✓ Use rgpQ1_4.ItemIndex (case / if) to determine the fare ✓ with correct fares 25, 15 and 12.50 ✓ Total := fare * trips ✓ if iTrips >= 10 then rTotal := rTotal * 0.9 ✓ Display in lblQ1_4 with ’Total fare: ’, currency format with 2 decimals ✓ Also ACCEPT: rTotal - rTotal * 0.1; testing the item text instead of ItemIndex. Copyright reserved Please turn over
Information Technology/P1 5 Hlayiso/Mock 2026 NSC – Marking Guidelines QUESTION DESCRIPTION MAX. LEARNER’S MARKS MARKS 1.5 Button [1.5 - Hashtag] 8 Initialise hashtag string to empty ✓ Loop through every character of sPhrase ✓ Test if character is NOT a space ✓ Test if first character OR previous character is a space ✓ Add UpCase(character) ✓ Else add LowerCase(character) ✓ Add ’#’ to the beginning of the hashtag ✓ Display hashtag in memQ1_5 ✓ Also ACCEPT: converting the whole phrase to lower case first; using a Boolean flag for a new word; removing spaces first and then capitalising. TOTAL SECTION A: 40 Copyright reserved Please turn over
Information Technology/P1 6 Hlayiso/Mock 2026 NSC – Marking Guidelines ANNEXURE B QUESTION 2: MARKING GRID – DATABASE PROGRAMMING CENTRE NUMBER: EXAMINATION NUMBER: QUESTION DESCRIPTION MAX. LEARNER’S MARKS MARKS 2.1 SQL statements 2.1.1 Button [2.1.1 - Not sterilised] 3 SELECT * ✓ FROM tblAnimals ✓ WHERE Sterilised = False ✓ Also ACCEPT: = 0, = No, NOT Sterilised, <> True 2.1.2 Button [2.1.2 - Arrivals in 2026] 4 SELECT AnimalName, Species, DateArrived FROM tblAnimals ✓ WHERE Year(DateArrived) = 2026 ✓✓ ORDER BY DateArrived DESC ✓ Also ACCEPT: DateArrived BETWEEN #2026/01/01# AND #2026/12/31#; DateArrived >= #2026/01/01# (the data contains no later dates); DateArrived LIKE "2026*" 2.1.3 Button [2.1.3 - Large dog discount] 4 UPDATE tblAnimals ✓ SET AdoptionFee = AdoptionFee - 150 ✓ WHERE Species = "Dog" ✓ AND Weight > 40 ✓ 2.1.4 Button [2.1.4 - Average weight] 4 SELECT Species, ✓ AVG(Weight) ✓ ROUND( ... , 1) AS AvgWeight ✓ FROM tblAnimals GROUP BY Species ✓ Also ACCEPT: FORMAT(AVG(Weight), "0.0") Copyright reserved Please turn over
Information Technology/P1 7 Hlayiso/Mock 2026 NSC – Marking Guidelines QUESTION DESCRIPTION MAX. LEARNER’S MARKS MARKS 2.1.5 Button [2.1.5 - Animals per shelter] 7 SELECT ShelterName, ✓ COUNT(*) AS NumAnimals ✓ FROM tblShelters, tblAnimals ✓ WHERE tblShelters.ShelterID = tblAnimals.ShelterID ✓ AND Province = ✓ "' + sProvince + '" ✓ GROUP BY ShelterName ✓ Also ACCEPT: INNER JOIN ... ON; COUNT(AnimalID); single quotes with QuotedStr(sProvince). Subtotal: 22 2.2 Database manipulation 2.2.1 Button [2.2.1 - Add animal] 6 tblAnimals.Append / tblAnimals.Insert ✓ tblAnimals['AnimalName'] := 'Juju'; Species and Breed assigned ✓ Weight, AdoptionFee, Sterilised and ShelterID assigned correct values ✓ tblAnimals['DateArrived'] := Date ✓ Correct syntax to refer to the fields, e.g. tblAnimals['Field'] or FieldByName('Field').Value ✓ tblAnimals.Post ✓ Also ACCEPT: Now for the date. NO mark for assigning a value to AnimalID. Copyright reserved Please turn over
Information Technology/P1 8 Hlayiso/Mock 2026 NSC – Marking Guidelines QUESTION DESCRIPTION MAX. LEARNER’S MARKS MARKS 2.2.2 Button [2.2.2 - Capacity report] 12 tblShelters.First and tblShelters.Next in correct positions** ✓ Loop while NOT tblShelters.Eof ✓ Initialise counter inside the outer loop ✓ tblAnimals.First and tblAnimals.Next in correct positions** ✓ Loop while NOT tblAnimals.Eof ✓ Test tblAnimals['ShelterID'] = tblShelters['ShelterID'] ✓ Increment counter ✓ Calculate percentage: counter / tblShelters['Capacity'] * 100 ✓ Display ShelterName and counter with labels in redQ2_2_2 ✓ Percentage formatted to 1 decimal place followed by ’%’ ✓ Test if counter > Capacity ✓ Add ’ *** OVER CAPACITY ***’ to the line ✓ NOTE **: The First and Next statements of each loop must both be in the correct position for the mark. Subtotal: 18 TOTAL SECTION B: 40 Copyright reserved Please turn over
Information Technology/P1 9 Hlayiso/Mock 2026 NSC – Marking Guidelines ANNEXURE C QUESTION 3: MARKING GRID – OBJECT-ORIENTATED PROGRAMMING CENTRE NUMBER: EXAMINATION NUMBER: QUESTION DESCRIPTION MAX. LEARNER’S MARKS MARKS 3.1.1 Constructor Create 3 Set fMeterNo and fOwner to correct parameters ✓ Set fTariff and fSubsidised to correct parameters ✓ fUnits := 0 ✓ 3.1.2 Function getUnits 2 Function heading with Real return type ✓ Result := fUnits ✓ 3.1.3 Function isValidMeterNo 5 Function heading with Boolean return type (declared in class) ✓ Test Length(fMeterNo) = 11 ✓ Loop through the characters of fMeterNo ✓ Test if character is NOT a digit (NOT (c IN ['0'..'9'])) ✓ Return False if any test fails, otherwise True ✓ Also ACCEPT: TryStrToInt64; counting digits and comparing the count to 11; ord values 48 to 57. 3.1.4 Procedure buyElectricity 4 Procedure heading with Real parameter ✓ Call unitsForAmount(rAmount) ✓ if fSubsidised then units multiplied by 1.1 ✓ fUnits := fUnits + units ✓ 3.1.5 Function toString 5 Function heading with String return type ✓ If/else to determine ’Subsidised’ or ’Not subsidised’ ✓ Labels: ’Meter number: ’, ’Owner: ’, ’Tariff: R’, ’ per kWh’, ’Units available: ’, ’ kWh’, brackets and line breaks (#13) ✓ Tariff to 2 decimal places and units to 1 decimal place, converted to string ✓ All attributes included and the string returned ✓ Subtotal: Object class 19 Copyright reserved Please turn over
Information Technology/P1 10 Hlayiso/Mock 2026 NSC – Marking Guidelines QUESTION DESCRIPTION MAX. LEARNER’S MARKS MARKS 3.2.1 Button [3.2.1 - Instantiate object] 8 Extract item: rgpQ3_2_1.Items[rgpQ3_2_1.ItemIndex] ✓ Extract the part after ’R’ using string handling (Pos, Copy/Delete) ✓ Convert to real ✓ bSubsidised := chkQ3_2_1.Checked ✓ objMeter :=✓ TPrepaidMeter.Create✓(sMeterNo, sOwner, rTariff, bSubsidised) ✓ Display objMeter.toString in redQ3 ✓ Alternative for the tariff: case/if on ItemIndex with hard-coded values (max 2 of the first 3 marks). 3.2.2 Button [3.2.2 - Validate meter number] 4 if objMeter.isValidMeterNo then ✓ Display ’Valid meter number’ in redQ3 ✓ Else display ’Invalid meter number - purchases are not allowed’ ✓ btnQ3_2_3.Enabled := False ✓ 3.2.3 Button [3.2.3 - Buy electricity] 9 Extract amount from spnQ3_2_3.Value ✓ if iAmount < 20 then ShowMessage(...) ✓ Else call objMeter.buyElectricity(iAmount) ✓ Loop 20 times ✓ Generate random digit Random(10) ✓ Convert to string and add to token ✓ Add a space after every 4th digit (i MOD 4 = 0) but not after the last digit ✓ Display ’Token: ’ and the token in redQ3 ✓ Display objMeter.toString in redQ3 ✓ Also ACCEPT: RandomRange(0, 10); generating five groups of 4 digits with nested loops. Subtotal: Form class 21 TOTAL SECTION C: 40 Copyright reserved Please turn over
Information Technology/P1 11 Hlayiso/Mock 2026 NSC – Marking Guidelines ANNEXURE D QUESTION 4: MARKING GRID – PROBLEM SOLVING CENTRE NUMBER: EXAMINATION NUMBER: QUESTION DESCRIPTION MAX. LEARNER’S MARKS MARKS 4.1 Button [4.1 - Row summary] 9 Outer loop through the rows (1 to 8) ✓ Initialise row counter inside the outer loop ✓ Inner loop through the columns (1 to 12) ✓ Test arrSeats[r, c] = 'X' and increment row counter ✓ Display row letter (ROW_LETTERS[r] / Chr(64 + r)) and row counter ✓ Add row counter to the total number of booked seats ✓ Income: rows 1 to 3 at R180 per seat, otherwise R120 per seat, accumulated ✓ Occupancy: total / 96 * 100 (or ROWS * COLS), displayed to 1 decimal place with ’%’ ✓ Display income in currency format ✓ 4.2 Button [4.2 - Group booking] 12 Extract number of seats required from spnQ4_2.Value ✓ Outer loop through rows that stops when a position is found (flag) ✓ Initialise the counter of consecutive available seats for each row ✓ Inner loop through the columns ✓ If arrSeats[r, c] = '.' increment counter ✓ Else reset counter to 0 ✓ If counter = seats required: set flag and store the row ✓ Calculate first seat: column – seats required + 1 ✓ If found: loop from first seat to last seat ✓ Change the seats in that row to ’X’ ✓ Display row letter, first seat and last seat with labels and call display2D ✓ Else display a suitable message ✓ Alternative: test every starting position with an inner loop over the required number of seats (4 marks for the search part). Copyright reserved Please turn over
Information Technology/P1 12 Hlayiso/Mock 2026 NSC – Marking Guidelines QUESTION DESCRIPTION MAX. LEARNER’S MARKS MARKS 4.3 Button [4.3 - Sort shows] 9 Outer loop (1 to 5) ✓ Inner loop (outer + 1 to 6) ✓ Compare arrTickets[j] > arrTickets[i] (descending) ✓ Swap arrTickets elements using a temporary variable ✓✓ Swap arrShows elements using a temporary variable ✓✓ Loop through the sorted arrays ✓ Display show name and tickets converted to string in memQ4 ✓ Also ACCEPT: a bubble sort or selection sort. A sort that does not keep the arrays parallel: max 6 marks. TOTAL SECTION D: 30 SUMMARY OF LEARNER’S MARKS: CENTRE NUMBER: EXAMINATION NUMBER: SECTION A SECTION B SECTION C SECTION D QUESTION 1 QUESTION 2 QUESTION 3 QUESTION 4 GRAND TOTAL MAX. MARKS 40 40 40 30 150 LEARNER’S MARKS Copyright reserved Please turn over
Information Technology/P1 13 Hlayiso/Mock 2026 NSC – Marking Guidelines ANNEXURE E: SOLUTION FOR QUESTION 1 // Examination number: MODEL SOLUTION unit Question1_U; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ComCtrls, ExtCtrls, Spin, Math; type TfrmQuestion1 = class(TForm) grpQ1_1: TGroupBox; btnQ1_1_1: TButton; pnlQ1_1: TPanel; btnQ1_1_2: TButton; lblQ1_1_2: TLabel; grpQ1_2: TGroupBox; lblP: TLabel; lblR: TLabel; lblN: TLabel; edtQ1_2_P: TEdit; edtQ1_2_R: TEdit; edtQ1_2_N: TEdit; btnQ1_2: TButton; lblQ1_2: TLabel; grpQ1_3: TGroupBox; btnQ1_3: TButton; redQ1_3: TRichEdit; grpQ1_4: TGroupBox; rgpQ1_4: TRadioGroup; lblTrips: TLabel; spnQ1_4: TSpinEdit; btnQ1_4: TButton; lblQ1_4: TLabel; grpQ1_5: TGroupBox; lblPhrase: TLabel; edtQ1_5: TEdit; btnQ1_5: TButton; memQ1_5: TMemo; procedure FormCreate(Sender: TObject); procedure btnQ1_1_1Click(Sender: TObject); procedure btnQ1_1_2Click(Sender: TObject); procedure btnQ1_2Click(Sender: TObject); procedure btnQ1_3Click(Sender: TObject); procedure btnQ1_4Click(Sender: TObject); procedure btnQ1_5Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var frmQuestion1: TfrmQuestion1; implementation Copyright reserved Please turn over
Information Technology/P1 14 Hlayiso/Mock 2026 NSC – Marking Guidelines {$R *.dfm} // =========================================================================== // Provided code // =========================================================================== procedure TfrmQuestion1.FormCreate(Sender: TObject); begin FormatSettings.DecimalSeparator := '.'; Randomize; end; // =========================================================================== // Question 1.1.1 4 marks // =========================================================================== procedure TfrmQuestion1.btnQ1_1_1Click(Sender: TObject); begin pnlQ1_1.Caption := 'Water is life!'; pnlQ1_1.Color := clAqua; pnlQ1_1.Font.Color := clNavy; pnlQ1_1.Font.Size := 18; end; // =========================================================================== // Question 1.1.2 4 marks // =========================================================================== procedure TfrmQuestion1.btnQ1_1_2Click(Sender: TObject); const SECONDS = 7385; var iHours, iMinutes, iSeconds: Integer; begin iHours := SECONDS DIV 3600; iMinutes := (SECONDS MOD 3600) DIV 60; iSeconds := SECONDS MOD 60; lblQ1_1_2.Caption := IntToStr(iHours) + ' h ' + IntToStr(iMinutes) + ' min ' + IntToStr(iSeconds) + ' s'; end; // =========================================================================== // Question 1.2 8 marks // =========================================================================== procedure TfrmQuestion1.btnQ1_2Click(Sender: TObject); var rP, rR, rA: Real; iYears: Integer; begin rP := StrToFloat(edtQ1_2_P.Text); rR := StrToFloat(edtQ1_2_R.Text); iYears := StrToInt(edtQ1_2_N.Text); rA := rP * Power(1 + rR / 1200, 12 * iYears); lblQ1_2.Caption := 'Final amount: ' + FormatFloat('R 0.00', rA); end; // =========================================================================== // Question 1.3 10 marks // =========================================================================== procedure TfrmQuestion1.btnQ1_3Click(Sender: TObject); Copyright reserved Please turn over
Information Technology/P1 15 Hlayiso/Mock 2026 NSC – Marking Guidelines var tFile: TextFile; sLine, sDam, sOut: String; rLevel: Real; iPos, iLow: Integer; begin redQ1_3.Clear; if NOT FileExists('Dams.txt') then begin ShowMessage('The file Dams.txt does not exist'); Exit; end; AssignFile(tFile, 'Dams.txt'); Reset(tFile); iLow := 0; while NOT Eof(tFile) do begin Readln(tFile, sLine); iPos := Pos(';', sLine); sDam := Copy(sLine, 1, iPos - 1); rLevel := StrToFloat(Copy(sLine, iPos + 1, Length(sLine) - iPos)); sOut := sDam + ' - ' + FloatToStrF(rLevel, ffFixed, 6, 1) + '%'; if rLevel < 50 then begin sOut := sOut + ' (LOW)'; Inc(iLow); end; redQ1_3.Lines.Add(sOut); end; CloseFile(tFile); redQ1_3.Lines.Add(''); redQ1_3.Lines.Add('Number of dams below 50%: ' + IntToStr(iLow)); end; // =========================================================================== // Question 1.4 6 marks // =========================================================================== procedure TfrmQuestion1.btnQ1_4Click(Sender: TObject); var iTrips: Integer; rPrice, rTotal: Real; begin iTrips := spnQ1_4.Value; rPrice := 0; case rgpQ1_4.ItemIndex of 0: rPrice := 25.00; 1: rPrice := 15.00; 2: rPrice := 12.50; end; rTotal := rPrice * iTrips; if iTrips >= 10 then rTotal := rTotal * 0.9; lblQ1_4.Caption := 'Total fare: ' + FormatFloat('R 0.00', rTotal); end; // =========================================================================== // Question 1.5 8 marks // =========================================================================== Copyright reserved Please turn over
Information Technology/P1 16 Hlayiso/Mock 2026 NSC – Marking Guidelines procedure TfrmQuestion1.btnQ1_5Click(Sender: TObject); var sPhrase: String; sHashtag: String; i: Integer; begin // Provided code sPhrase := edtQ1_5.Text; sHashtag := ''; for i := 1 to Length(sPhrase) do begin if sPhrase[i] <> ' ' then begin if (i = 1) OR (sPhrase[i - 1] = ' ') then sHashtag := sHashtag + UpCase(sPhrase[i]) else sHashtag := sHashtag + LowerCase(sPhrase[i]); end; end; sHashtag := '#' + sHashtag; memQ1_5.Lines.Add(sHashtag); end; end. Copyright reserved Please turn over
Information Technology/P1 17 Hlayiso/Mock 2026 NSC – Marking Guidelines ANNEXURE F: SOLUTION FOR QUESTION 2 NOTE: Only the event handlers of the form unit are shown. The provided unit ConnectDB_U.pas is unchanged. var frmQuestion2: TfrmQuestion2; dbCONN: TConnection; tblShelters, tblAnimals: TADOTable; implementation {$R *.dfm} // =========================================================================== // Provided code - do not change // =========================================================================== procedure TfrmQuestion2.FormCreate(Sender: TObject); begin FormatSettings.DecimalSeparator := '.'; dbCONN := TConnection.Create; dbCONN.dbConnect; tblShelters := dbCONN.tblShelters; tblAnimals := dbCONN.tblAnimals; dbgShelters.DataSource := dbCONN.dsrShelters; dbgAnimals.DataSource := dbCONN.dsrAnimals; dbgSQL.DataSource := dbCONN.dsrSQL; pgcQ2.ActivePageIndex := 0; end; procedure TfrmQuestion2.FormClose(Sender: TObject; var Action: TCloseAction); begin dbCONN.dbDisconnect; end; procedure TfrmQuestion2.btnRestoreClick(Sender: TObject); begin dbCONN.restoreDatabase; tblShelters := dbCONN.tblShelters; tblAnimals := dbCONN.tblAnimals; end; procedure TfrmQuestion2.btnCloseClick(Sender: TObject); begin Close; end; // =========================================================================== // QUESTION 2.1: SQL statements // =========================================================================== // Question 2.1.1 3 marks procedure TfrmQuestion2.btnQ2_1_1Click(Sender: TObject); var sSQL1: String; begin sSQL1 := ''; sSQL1 := 'SELECT * FROM tblAnimals WHERE Sterilised = False'; Copyright reserved Please turn over
Information Technology/P1 18 Hlayiso/Mock 2026 NSC – Marking Guidelines // Provided code - do not change dbCONN.runSQL(sSQL1); end; // Question 2.1.2 4 marks procedure TfrmQuestion2.btnQ2_1_2Click(Sender: TObject); var sSQL2: String; begin sSQL2 := ''; sSQL2 := 'SELECT AnimalName, Species, DateArrived FROM tblAnimals ' + 'WHERE Year(DateArrived) = 2026 ORDER BY DateArrived DESC'; // Provided code - do not change dbCONN.runSQL(sSQL2); end; // Question 2.1.3 4 marks procedure TfrmQuestion2.btnQ2_1_3Click(Sender: TObject); var sSQL3: String; begin sSQL3 := ''; sSQL3 := 'UPDATE tblAnimals SET AdoptionFee = AdoptionFee - 150 ' + 'WHERE Species = "Dog" AND Weight > 40'; // Provided code - do not change dbCONN.executeSQL(sSQL3, 'tblAnimals'); end; // Question 2.1.4 4 marks procedure TfrmQuestion2.btnQ2_1_4Click(Sender: TObject); var sSQL4: String; begin sSQL4 := ''; sSQL4 := 'SELECT Species, ROUND(AVG(Weight), 1) AS AvgWeight ' + 'FROM tblAnimals GROUP BY Species'; // Provided code - do not change dbCONN.runSQL(sSQL4); end; // Question 2.1.5 7 marks procedure TfrmQuestion2.btnQ2_1_5Click(Sender: TObject); var sSQL5, sProvince: String; begin // Provided code sProvince := cmbQ2_1_5.Text; sSQL5 := ''; sSQL5 := 'SELECT ShelterName, COUNT(*) AS NumAnimals ' + 'FROM tblShelters, tblAnimals ' + 'WHERE tblShelters.ShelterID = tblAnimals.ShelterID ' + 'AND Province = "' + sProvince + '" ' + 'GROUP BY ShelterName'; // Provided code - do not change dbCONN.runSQL(sSQL5); end; // =========================================================================== Copyright reserved Please turn over
Information Technology/P1 19 Hlayiso/Mock 2026 NSC – Marking Guidelines // QUESTION 2.2: Delphi code // =========================================================================== // Question 2.2.1 6 marks procedure TfrmQuestion2.btnQ2_2_1Click(Sender: TObject); begin tblAnimals.Append; tblAnimals['AnimalName'] := 'Juju'; tblAnimals['Species'] := 'Cat'; tblAnimals['Breed'] := 'Tortoiseshell'; tblAnimals['DateArrived'] := Date; tblAnimals['Weight'] := 3.2; tblAnimals['AdoptionFee'] := 650; tblAnimals['Sterilised'] := False; tblAnimals['ShelterID'] := 8; tblAnimals.Post; ShowMessage('Juju has been added'); end; // Question 2.2.2 12 marks procedure TfrmQuestion2.btnQ2_2_2Click(Sender: TObject); var iCount: Integer; rPercent: Real; sLine: String; begin redQ2_2_2.Clear; tblShelters.First; while NOT tblShelters.Eof do begin iCount := 0; tblAnimals.First; while NOT tblAnimals.Eof do begin if tblAnimals['ShelterID'] = tblShelters['ShelterID'] then Inc(iCount); tblAnimals.Next; end; rPercent := iCount / tblShelters['Capacity'] * 100; sLine := tblShelters['ShelterName'] + ': ' + IntToStr(iCount) + ' animals (' + FloatToStrF(rPercent, ffFixed, 6, 1) + '%)'; if iCount > tblShelters['Capacity'] then sLine := sLine + ' *** OVER CAPACITY ***'; redQ2_2_2.Lines.Add(sLine); tblShelters.Next; end; end; end. Copyright reserved Please turn over
Information Technology/P1 20 Hlayiso/Mock 2026 NSC – Marking Guidelines ANNEXURE G: SOLUTION FOR QUESTION 3 Object class: Meter_U.pas // Examination number: MODEL SOLUTION unit Meter_U; interface uses SysUtils; type TPrepaidMeter = class private fMeterNo: String; fOwner: String; fTariff: Real; fSubsidised: Boolean; fUnits: Real; public constructor Create(sMeterNo, sOwner: String; rTariff: Real; bSubsidised: Boolean); procedure setTariff(rTariff: Real); function unitsForAmount(rAmount: Real): Real; function getUnits: Real; function isValidMeterNo: Boolean; procedure buyElectricity(rAmount: Real); function toString: String; override; end; implementation { TPrepaidMeter } // =========================================================================== // Question 3.1.1 3 marks // =========================================================================== constructor TPrepaidMeter.Create(sMeterNo, sOwner: String; rTariff: Real; bSubsidised: Boolean); begin fMeterNo := sMeterNo; fOwner := sOwner; fTariff := rTariff; fSubsidised := bSubsidised; fUnits := 0; end; // =========================================================================== // Provided code // =========================================================================== procedure TPrepaidMeter.setTariff(rTariff: Real); begin fTariff := rTariff; end; // Returns the number of units (kWh) that can be bought for rAmount rand function TPrepaidMeter.unitsForAmount(rAmount: Real): Real; begin Copyright reserved Please turn over
Information Technology/P1 21 Hlayiso/Mock 2026 NSC – Marking Guidelines Result := rAmount / fTariff; end; // =========================================================================== // Question 3.1.2 2 marks // =========================================================================== function TPrepaidMeter.getUnits: Real; begin Result := fUnits; end; // =========================================================================== // Question 3.1.3 5 marks // =========================================================================== function TPrepaidMeter.isValidMeterNo: Boolean; var i: Integer; begin Result := True; if Length(fMeterNo) <> 11 then Result := False else for i := 1 to Length(fMeterNo) do if NOT (fMeterNo[i] IN ['0' .. '9']) then Result := False; end; // =========================================================================== // Question 3.1.4 4 marks // =========================================================================== procedure TPrepaidMeter.buyElectricity(rAmount: Real); var rNewUnits: Real; begin rNewUnits := unitsForAmount(rAmount); if fSubsidised then rNewUnits := rNewUnits * 1.1; fUnits := fUnits + rNewUnits; end; // =========================================================================== // Question 3.1.5 5 marks // =========================================================================== function TPrepaidMeter.toString: String; var sType: String; begin if fSubsidised then sType := 'Subsidised' else sType := 'Not subsidised'; Result := 'Meter number: ' + fMeterNo + #13 + 'Owner: ' + fOwner + ' (' + sType + ')' + #13 + 'Tariff: R' + FloatToStrF(fTariff, ffFixed, 6, 2) + ' per kWh' + #13 + 'Units available: ' + FloatToStrF(fUnits, ffFixed, 8, 1) + ' kWh'; end; end. Copyright reserved Please turn over
Information Technology/P1 22 Hlayiso/Mock 2026 NSC – Marking Guidelines Form class: Question3_U.pas var frmQuestion3: TfrmQuestion3; objMeter: TPrepaidMeter; implementation {$R *.dfm} // Provided code procedure TfrmQuestion3.FormCreate(Sender: TObject); begin FormatSettings.DecimalSeparator := '.'; Randomize; end; // =========================================================================== // Question 3.2.1 8 marks // =========================================================================== procedure TfrmQuestion3.btnQ3_2_1Click(Sender: TObject); var sMeterNo, sOwner: String; sItem: String; rTariff: Real; bSubsidised: Boolean; begin // Provided code redQ3.Clear; sMeterNo := edtQ3_2_1_Meter.Text; sOwner := edtQ3_2_1_Owner.Text; sItem := rgpQ3_2_1.Items[rgpQ3_2_1.ItemIndex]; Delete(sItem, 1, Pos('R', sItem)); rTariff := StrToFloat(sItem); bSubsidised := chkQ3_2_1.Checked; objMeter := TPrepaidMeter.Create(sMeterNo, sOwner, rTariff, bSubsidised); redQ3.Lines.Add(objMeter.toString); end; // =========================================================================== // Question 3.2.2 4 marks // =========================================================================== procedure TfrmQuestion3.btnQ3_2_2Click(Sender: TObject); begin if objMeter.isValidMeterNo then redQ3.Lines.Add('Valid meter number') else begin redQ3.Lines.Add('Invalid meter number - purchases are not allowed'); btnQ3_2_3.Enabled := False; end; end; // =========================================================================== // Question 3.2.3 9 marks // =========================================================================== procedure TfrmQuestion3.btnQ3_2_3Click(Sender: TObject); var iAmount, i: Integer; Copyright reserved Please turn over
Information Technology/P1 23 Hlayiso/Mock 2026 NSC – Marking Guidelines sToken: String; begin iAmount := spnQ3_2_3.Value; if iAmount < 20 then ShowMessage('The minimum purchase amount is R20') else begin objMeter.buyElectricity(iAmount); sToken := ''; for i := 1 to 20 do begin sToken := sToken + IntToStr(Random(10)); if (i MOD 4 = 0) AND (i < 20) then sToken := sToken + ' '; end; redQ3.Lines.Add(''); redQ3.Lines.Add('Token: ' + sToken); redQ3.Lines.Add(objMeter.toString); end; end; end. Copyright reserved Please turn over
Information Technology/P1 24 Hlayiso/Mock 2026 NSC – Marking Guidelines ANNEXURE H: SOLUTION FOR QUESTION 4 const ROWS = 8; COLS = 12; // Seat plan: 'X' = booked seat, '.' = available seat SEAT_PLAN: array [1 .. ROWS] of String = ( 'XXXXXX.XXXXX', 'XX..XXXX.XXX', 'XXX.XXX..XXX', 'X..XX...XXXX', 'XX.....XXXX.', 'X....XX..XXX', '............', '..XX........'); ROW_LETTERS = 'ABCDEFGH'; var frmQuestion4: TfrmQuestion4; arrSeats: array [1 .. ROWS, 1 .. COLS] of Char; arrShows: array [1 .. 6] of String = ('Kasi Dreams', 'Umoya', 'The Last Taxi', 'Jozi Nights', 'Mama Africa', 'Rhythm of the Drum'); arrTickets: array [1 .. 6] of Integer = (1240, 3875, 2190, 2964, 845, 3102); implementation {$R *.dfm} // =========================================================================== // Provided code // =========================================================================== procedure TfrmQuestion4.loadSeats; var r, c: Integer; begin for r := 1 to ROWS do for c := 1 to COLS do arrSeats[r, c] := SEAT_PLAN[r][c]; end; procedure TfrmQuestion4.display2D; var r, c: Integer; sLine: String; begin redQ4.Clear; sLine := ' '; for c := 1 to COLS do sLine := sLine + Format('%3d', [c]); redQ4.Lines.Add(sLine); for r := 1 to ROWS do begin sLine := ROW_LETTERS[r] + ' '; for c := 1 to COLS do sLine := sLine + ' ' + arrSeats[r, c]; redQ4.Lines.Add(sLine); end; end; Copyright reserved Please turn over
Information Technology/P1 25 Hlayiso/Mock 2026 NSC – Marking Guidelines procedure TfrmQuestion4.FormCreate(Sender: TObject); begin loadSeats; display2D; end; procedure TfrmQuestion4.btnResetClick(Sender: TObject); begin loadSeats; display2D; memQ4.Clear; end; // =========================================================================== // Question 4.1 9 marks // =========================================================================== procedure TfrmQuestion4.btnQ4_1Click(Sender: TObject); var r, c, iRowCount, iTotal: Integer; rIncome: Real; begin memQ4.Clear; memQ4.Lines.Add('Row' + #9 + 'Booked'); iTotal := 0; rIncome := 0; for r := 1 to ROWS do begin iRowCount := 0; for c := 1 to COLS do if arrSeats[r, c] = 'X' then Inc(iRowCount); memQ4.Lines.Add(ROW_LETTERS[r] + #9 + IntToStr(iRowCount)); iTotal := iTotal + iRowCount; if r <= 3 then rIncome := rIncome + iRowCount * 180 else rIncome := rIncome + iRowCount * 120; end; memQ4.Lines.Add(''); memQ4.Lines.Add('Occupancy: ' + FloatToStrF(iTotal / (ROWS * COLS) * 100, ffFixed, 6, 1) + '%'); memQ4.Lines.Add('Income: ' + FormatFloat('R 0.00', rIncome)); end; // =========================================================================== // Question 4.2 12 marks // =========================================================================== procedure TfrmQuestion4.btnQ4_2Click(Sender: TObject); var iNeeded, r, c, iRun, iRow, iStart: Integer; bFound: Boolean; begin memQ4.Clear; iNeeded := spnQ4_2.Value; bFound := False; iRow := 0; iStart := 0; Copyright reserved Please turn over
Information Technology/P1 26 Hlayiso/Mock 2026 NSC – Marking Guidelines r := 1; while (r <= ROWS) AND NOT bFound do begin iRun := 0; c := 1; while (c <= COLS) AND NOT bFound do begin if arrSeats[r, c] = '.' then Inc(iRun) else iRun := 0; if iRun = iNeeded then begin bFound := True; iRow := r; iStart := c - iNeeded + 1; end; Inc(c); end; Inc(r); end; if bFound then begin for c := iStart to iStart + iNeeded - 1 do arrSeats[iRow, c] := 'X'; memQ4.Lines.Add('Booked: row ' + ROW_LETTERS[iRow] + ', seats ' + IntToStr(iStart) + ' to ' + IntToStr(iStart + iNeeded - 1)); display2D; end else memQ4.Lines.Add('No row has ' + IntToStr(iNeeded) + ' available seats next to each other'); end; // =========================================================================== // Question 4.3 9 marks // =========================================================================== procedure TfrmQuestion4.btnQ4_3Click(Sender: TObject); var i, j, iTemp: Integer; sTemp: String; begin memQ4.Clear; memQ4.Lines.Add('Show' + #9 + #9 + 'Tickets sold'); for i := 1 to 5 do for j := i + 1 to 6 do if arrTickets[j] > arrTickets[i] then begin iTemp := arrTickets[i]; arrTickets[i] := arrTickets[j]; arrTickets[j] := iTemp; sTemp := arrShows[i]; arrShows[i] := arrShows[j]; arrShows[j] := sTemp; end; for i := 1 to 6 do memQ4.Lines.Add(arrShows[i] + #9 + #9 + IntToStr(arrTickets[i])); Copyright reserved Please turn over
Information Technology/P1 27 Hlayiso/Mock 2026 NSC – Marking Guidelines end; end. Copyright reserved

Study this subject

More from Grade 12 Information Technology

View all