Skip to content

Information Technology Grade 11 P1 November Mock 2026 Memo

MemorandumInformation TechnologyGrade 11202624 pagesPublisher: Hlayiso

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

Free to read online, no sign-up needed

Loading document…

Loading document…

November Mock Exam 2026

Document textSearch extracted text and jump to a page.
hlayiso mock exams Practice Series: Grade 11 Exam Preparation WWW.HLAYISO.COM NATIONAL SENIOR CERTIFICATE GRADE 11 INFORMATION TECHNOLOGY P1 NOVEMBER EXAMINATION 2026 (MOCK) MARKING GUIDELINES MARKS: 150 These marking guidelines consist of 24 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. • Built-in routines that the instructions prohibit (e.g. Locate, Filter, Sort, RecordCount, CharInSet) earn NO marks for the part of the question in which they are used. 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 Button [1.1 - Format panel] 4 pnlQ1_1.Caption := 'Run Jozi 2026' ✓ pnlQ1_1.Color := clYellow ✓ pnlQ1_1.Font.Size := 16 ✓ pnlQ1_1.Font.Style := [fsBold] ✓ 1.2 Button [1.2 - Pace] 8 Extract the distance from edtQ1_2_Dist and convert to real (StrToFloat) ✓ Total seconds: spnQ1_2_Min.Value * 60 + spnQ1_2_Sec.Value ✓ Pace: Round(iTotalSec / rDistance) ✓ Minutes: iPace DIV 60 ✓ Seconds: iPace MOD 60 ✓ Display pace in lblQ1_2_Pace in the correct format ✓ Speed: rDistance / (iTotalSec / 3600) ✓ Display speed in lblQ1_2_Speed with the text, formatted to 2 decimal places ✓ Also ACCEPT: rDistance / iTotalSec * 3600; FloatToStrF(rSpeed, ffFixed, 8, 2). 1.3 Button [1.3 - Entry fee] 8 Use rgpQ1_3.ItemIndex (case/if) to determine the fee ✓ with the correct fees 80, 120 and 220 ✓ If no item selected (ItemIndex = -1): message and Exit ✓ Extract the age from spnQ1_3_Age.Value ✓ if iAge >= 65 then ✓ display ’Entry fee: FREE’ in lblQ1_3 ✓ else if chkQ1_3.Checked then rFee := rFee * 0.85 ✓ Display the fee with ’Entry fee: ’ in currency format (R and 2 decimals) ✓ Also ACCEPT: FloatToStrF(rFee, ffCurrency, 8, 2); rFee - rFee * 0.15; testing the item text instead of ItemIndex. Copyright reserved Please turn over
Information Technology/P1 4 Hlayiso/Mock 2026 NSC – Marking Guidelines QUESTION DESCRIPTION MAX. LEARNER’S MARKS MARKS 1.4 Button [1.4 - Race number] 11 Extract the full name and the date of birth from the edit boxes ✓ Find the position of the space: Pos(' ', sName) ✓ If no space (= 0): display the message and Exit ✓ First letter of the first name: sName[1] ✓ Extract the surname: Copy(sName, iSpace + 1, ...) ✓ First three letters of the surname: Copy(sSurname, 1, 3) ✓ Convert the letters to upper case (UpperCase) ✓ Last two digits of the year: Copy(sDOB, 3, 2) ✓ Use Random to generate a number ✓ in the range 100 to 999: Random(900) + 100 ✓ Join all parts with ’-’ and display in lblQ1_4 with ’Race number: ’ ✓ Also ACCEPT: RandomRange(100, 1000); Delete to separate the names. 1.5 Button [1.5 - Water tables] 9 Extract the distance from edtQ1_5 and convert to real ✓ Initialise counter to 0 and position to GAP (2.5) ✓ Conditional loop (while / repeat) ✓ with the correct condition: rPosition < rDistance ✓ Increment the counter ✓ Display ’Water table ’, number of the table ✓ and the position formatted to 1 decimal place with ’ km’ ✓ Increase the position by GAP ✓ After the loop: display ’Number of water tables: ’ and the counter ✓ NOTE: Hard-coded positions or number of tables: NO marks for the loop. TOTAL QUESTION 1: 40 Copyright reserved Please turn over
Information Technology/P1 5 Hlayiso/Mock 2026 NSC – Marking Guidelines ANNEXURE B QUESTION 2: MARKING GRID – ARRAYS AND TEXT FILES CENTRE NUMBER: EXAMINATION NUMBER: QUESTION DESCRIPTION MAX. LEARNER’S MARKS MARKS 2.1 Button [2.1 - Load data] 12 if NOT FileExists('Recycling.txt') ✓ display a suitable message and Exit ✓ AssignFile(tFile, 'Recycling.txt') ✓ Reset(tFile) ✓ iCount := 0 ✓ while NOT Eof(tFile) do ✓ Readln(tFile, sLine) ✓ Inc(iCount) ✓ arrNames[iCount] := Copy(sLine, 1, Pos(';', sLine) - 1) ✓ Delete the name and extract the class into arrClasses[iCount] ✓ Extract the kilograms, convert to real and store in arrKg[iCount] ✓ CloseFile(tFile) and display ’Number of learners: ’ and iCount in lblQ2_1 ✓ 2.2 Button [2.2 - Display] 7 Initialise total to 0 ✓ for i := 1 to iCount do ✓ Display name, class and kilograms separated by tabs (#9) ✓ Kilograms formatted to 1 decimal place ✓ Add arrKg[i] to the total ✓ After the loop: display the total, formatted to 1 decimal place, with text ✓ Display the average rTotal / iCount, formatted to 1 decimal place, with text ✓ Copyright reserved Please turn over
Information Technology/P1 6 Hlayiso/Mock 2026 NSC – Marking Guidelines QUESTION DESCRIPTION MAX. LEARNER’S MARKS MARKS 2.3 Button [2.3 - Class report] 8 if cmbQ2_3.ItemIndex = -1: message and Exit ✓ Get the class: cmbQ2_3.Items[cmbQ2_3.ItemIndex] ✓ Initialise counter, total and maximum ✓ Loop through the arrays and test arrClasses[i] = sClass ✓ Increment counter and add arrKg[i] to the total ✓ if arrKg[i] > rMax then ✓ store arrKg[i] as new maximum and arrNames[i] ✓ Display the class, number of learners, total and top recycler with labels ✓ Also ACCEPT: cmbQ2_3.Text; storing the index of the maximum. 2.4 Button [2.4 - Top five] 8 Outer loop: for i := 1 to iCount - 1 ✓ Inner loop: for j := i + 1 to iCount ✓ if arrKg[j] > arrKg[i] then (descending) ✓ Swap arrKg using a temporary variable ✓ Swap arrNames ✓ Swap arrClasses ✓ Loop from 1 to 5 to display ✓ position, name, class in brackets and kilograms (1 decimal) ✓ Also ACCEPT: bubble sort. A sort that does not keep all three arrays parallel: max 5 marks. 2.5 Button [2.5 - Certificates] 5 AssignFile(tCert, 'Certificates.txt') and Rewrite(tCert) ✓ Loop through the arrays and test arrKg[i] >= 15 ✓ Writeln(tCert, ...) in the correct format ✓ Increment counter ✓ CloseFile(tCert) and display the number of certificates in a message ✓ TOTAL QUESTION 2: 40 Copyright reserved Please turn over
Information Technology/P1 7 Hlayiso/Mock 2026 NSC – Marking Guidelines ANNEXURE C QUESTION 3: MARKING GRID – DATABASE PROGRAMMING CENTRE NUMBER: EXAMINATION NUMBER: QUESTION DESCRIPTION MAX. LEARNER’S MARKS MARKS 3.1 Button [3.1 - Province trails] 7 Initialise counter to 0 ✓ tblTrails.First and tblTrails.Next in the correct positions ** ✓ while NOT tblTrails.Eof do ✓ if tblTrails['Province'] = sProvince then ✓ Display TrailName and Distance formatted to 1 decimal place ✓ Increment counter ✓ After the loop: if counter = 0, display ’No trails found’, else display the number of trails ✓ Also ACCEPT: tblTrails.FieldByName('Province').AsString. 3.2 Button [3.2 - Statistics] 9 Initialise maximum, total rating and counters ✓ Loop through the table (First, while NOT Eof, Next) ** ✓ if tblTrails['Distance'] > rMaxDist then ✓ store distance as new maximum and store TrailName ✓ if tblTrails['DogFriendly'] = True then Inc(iDogs) ✓ Add Rating to the total rating ✓ Count the number of trails ✓ Display the longest trail (1 decimal) and the number of dog-friendly trails ✓ Display the average rating rTotal / iTrails, formatted to 2 decimal places ✓ NOTE: Using RecordCount for the number of trails: NO mark for counting. Copyright reserved Please turn over
Information Technology/P1 8 Hlayiso/Mock 2026 NSC – Marking Guidelines QUESTION DESCRIPTION MAX. LEARNER’S MARKS MARKS 3.3 Button [3.3 - Fee increase] 7 Loop through the table (First, while NOT Eof, Next) ** ✓ if tblTrails['Difficulty'] = 'Hard' then ✓ tblTrails.Edit ✓ tblTrails['EntryFee'] := tblTrails['EntryFee'] * 1.1 ✓ tblTrails.Post ✓ Display TrailName and new fee in currency format ✓ Count the updates and display the number after the loop ✓ Also ACCEPT: + tblTrails['EntryFee'] * 0.1. 3.4 Button [3.4 - Add trail] 9 Test: name empty OR cmbQ3_4.ItemIndex = -1 OR rgpQ3_4.ItemIndex = -1 ✓ display a suitable message and Exit ✓ tblTrails.Insert / tblTrails.Append ✓ TrailName from the edit box and Province from cmbQ3_4.Items[ItemIndex] ✓ Distance := StrToFloat(edtQ3_4_Dist.Text) ✓ Difficulty := rgpQ3_4.Items[rgpQ3_4.ItemIndex] ✓ DogFriendly := chkQ3_4.Checked ✓ EntryFee := spnQ3_4.Value and Rating := 0 ✓ tblTrails.Post and display a confirmation message ✓ NOTE: NO mark if a value is assigned to TrailID. Copyright reserved Please turn over
Information Technology/P1 9 Hlayiso/Mock 2026 NSC – Marking Guidelines QUESTION DESCRIPTION MAX. LEARNER’S MARKS MARKS 3.5 Button [3.5 - Remove trail] 8 sTrail := InputBox(...) ✓ bFound := False and tblTrails.First ✓ while (NOT tblTrails.Eof) AND (NOT bFound) do ✓ Compare UpperCase(tblTrails['TrailName']) with UpperCase(sTrail) ✓ If equal bFound := True, else tblTrails.Next ✓ If found: MessageDlg(..., mtConfirmation, [mbYes, mbNo], 0) = mrYes ✓ tblTrails.Delete and display a message ✓ Else display ’Trail not found’ ✓ Also ACCEPT: LowerCase; a for/while loop with Exit/Break when found. TOTAL QUESTION 3: 40 NOTE **: The First and Next statements of a loop must both be in the correct position for the mark. Copyright reserved Please turn over
Information Technology/P1 10 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 - ID details] 11 Test Length(sID) = 13 ✓ Loop through every character of sID ✓ Test whether the character is NOT a digit (< '0' or > '9') ✓ If not valid: display a suitable message and Exit ✓ Extract the year: StrToInt(Copy(sID, 1, 2)) ✓ if iYear > 26 then add 1900, else add 2000 ✓ Month: StrToInt(Copy(sID, 3, 2)) used as index of arrMonths ✓ Day: Copy(sID, 5, 2) and display the ID number and the date of birth in the correct format ✓ Gender: StrToInt(Copy(sID, 7, 4)) >= 5000 ✓ display ’Male’ or ’Female’ ✓ Citizenship: sID[11] = '0': display ’South African citizen’, else ’Permanent resident’ ✓ Also ACCEPT: day displayed with a leading zero (e.g. 09); TryStrToInt64 for the digit test; StrToInt(sID[7]) >= 5 for the gender. Copyright reserved Please turn over
Information Technology/P1 11 Hlayiso/Mock 2026 NSC – Marking Guidelines QUESTION DESCRIPTION MAX. LEARNER’S MARKS MARKS 4.2 Function calcCheckDigit 10 Function heading with a String parameter that returns an Integer ✓ Initialise total to 0 and loop from 1 to 12 ✓ Convert the character to a digit: StrToInt(sID[i]) ✓ if i MOD 2 = 0 then (even position) ✓ multiply by 2 and subtract 9 if the result is greater than 9 ✓ Add the value to the total ✓ Result := (10 - iTotal MOD 10) MOD 10 ✓ Button [4.2 - Check digit] Call calcCheckDigit(sID) ✓ Compare with the last digit: StrToInt(sID[13]) ✓ Display the correct message, including the correct check digit if incorrect ✓ Also ACCEPT: Ord(sID[i]) - 48; iDigit DIV 10 + iDigit MOD 10 instead of subtracting 9; separate loops for odd and even positions. 4.3 Button [4.3 - Lucky draw] 9 Loop until SIX numbers are stored ✓ Random(49) + 1 ✓ Check the new number against ALL numbers already stored (duplicate test) ✓ If not a duplicate: increment counter and store in arrDraw ✓ Sort: nested loops ✓ if arrDraw[j] < arrDraw[i] then (ascending) ✓ swap using a temporary variable ✓ Build a string of the numbers in a loop ✓ Display the numbers on ONE line in memQ4 ✓ Also ACCEPT: a Boolean array [1..49] to mark numbers already drawn; RandomRange(1, 50). TOTAL QUESTION 4: 30 Copyright reserved Please turn over
Information Technology/P1 12 Hlayiso/Mock 2026 NSC – Marking Guidelines SUMMARY OF LEARNER’S MARKS: CENTRE NUMBER: EXAMINATION NUMBER: 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 implementation {$R *.dfm} // =========================================================================== // Provided code // =========================================================================== procedure TfrmQuestion1.FormCreate(Sender: TObject); begin FormatSettings.DecimalSeparator := '.'; Randomize; end; // =========================================================================== // Question 1.1 4 marks // =========================================================================== procedure TfrmQuestion1.btnQ1_1Click(Sender: TObject); begin pnlQ1_1.Caption := 'Run Jozi 2026'; pnlQ1_1.Color := clYellow; pnlQ1_1.Font.Size := 16; pnlQ1_1.Font.Style := [fsBold]; end; // =========================================================================== // Question 1.2 8 marks // =========================================================================== procedure TfrmQuestion1.btnQ1_2Click(Sender: TObject); var rDistance, rSpeed: Real; iTotalSec, iPace: Integer; begin rDistance := StrToFloat(edtQ1_2_Dist.Text); iTotalSec := spnQ1_2_Min.Value * 60 + spnQ1_2_Sec.Value; iPace := Round(iTotalSec / rDistance); lblQ1_2_Pace.Caption := 'Pace: ' + IntToStr(iPace DIV 60) + ' min ' + IntToStr(iPace MOD 60) + ' s per km'; rSpeed := rDistance / (iTotalSec / 3600); lblQ1_2_Speed.Caption := 'Average speed: ' + FormatFloat('0.00', rSpeed) + ' km/h'; end; // =========================================================================== // Question 1.3 8 marks // =========================================================================== procedure TfrmQuestion1.btnQ1_3Click(Sender: TObject); var rFee: Real; iAge: Integer; begin iAge := spnQ1_3_Age.Value; case rgpQ1_3.ItemIndex of 0: rFee := 80; 1: rFee := 120; 2: rFee := 220; else Copyright reserved Please turn over
Information Technology/P1 14 Hlayiso/Mock 2026 NSC – Marking Guidelines begin ShowMessage('Select a race'); Exit; end; end; if iAge >= 65 then lblQ1_3.Caption := 'Entry fee: FREE' else begin if chkQ1_3.Checked then rFee := rFee * 0.85; lblQ1_3.Caption := 'Entry fee: ' + FormatFloat('R 0.00', rFee); end; end; // =========================================================================== // Question 1.4 11 marks // =========================================================================== procedure TfrmQuestion1.btnQ1_4Click(Sender: TObject); var sName, sDOB, sFirst, sSurname, sRaceNo: String; iSpace: Integer; begin sName := Trim(edtQ1_4_Name.Text); sDOB := edtQ1_4_DOB.Text; iSpace := Pos(' ', sName); if iSpace = 0 then begin ShowMessage('Enter a first name and a surname'); Exit; end; sFirst := Copy(sName, 1, iSpace - 1); sSurname := Copy(sName, iSpace + 1, Length(sName) - iSpace); sRaceNo := UpperCase(sFirst[1] + Copy(sSurname, 1, 3)); sRaceNo := sRaceNo + Copy(sDOB, 3, 2) + '-' + IntToStr(Random(900) + 100); lblQ1_4.Caption := 'Race number: ' + sRaceNo; end; // =========================================================================== // Question 1.5 9 marks // =========================================================================== procedure TfrmQuestion1.btnQ1_5Click(Sender: TObject); const GAP = 2.5; var rDistance, rPosition: Real; iCount: Integer; begin memQ1_5.Clear; rDistance := StrToFloat(edtQ1_5.Text); iCount := 0; rPosition := GAP; while rPosition < rDistance do begin Inc(iCount); memQ1_5.Lines.Add('Water table ' + IntToStr(iCount) + ': ' + FormatFloat('0.0', rPosition) + ' km'); Copyright reserved Please turn over
Information Technology/P1 15 Hlayiso/Mock 2026 NSC – Marking Guidelines rPosition := rPosition + GAP; end; memQ1_5.Lines.Add(''); memQ1_5.Lines.Add('Number of water tables: ' + IntToStr(iCount)); end; end. Copyright reserved Please turn over
Information Technology/P1 16 Hlayiso/Mock 2026 NSC – Marking Guidelines ANNEXURE F: SOLUTION FOR QUESTION 2 var frmQuestion2: TfrmQuestion2; // Provided global arrays and counter arrNames: array [1 .. 50] of String; arrClasses: array [1 .. 50] of String; arrKg: array [1 .. 50] of Real; iCount: Integer; implementation {$R *.dfm} // =========================================================================== // Provided code // =========================================================================== procedure TfrmQuestion2.FormCreate(Sender: TObject); begin FormatSettings.DecimalSeparator := '.'; iCount := 0; redQ2.Paragraph.TabCount := 2; redQ2.Paragraph.Tab[0] := 160; redQ2.Paragraph.Tab[1] := 220; end; // =========================================================================== // Question 2.1 12 marks // =========================================================================== procedure TfrmQuestion2.btnQ2_1Click(Sender: TObject); var tFile: TextFile; sLine: String; iPos: Integer; begin if NOT FileExists('Recycling.txt') then begin ShowMessage('The file Recycling.txt does not exist'); Exit; end; AssignFile(tFile, 'Recycling.txt'); Reset(tFile); iCount := 0; while NOT Eof(tFile) do begin Readln(tFile, sLine); Inc(iCount); iPos := Pos(';', sLine); arrNames[iCount] := Copy(sLine, 1, iPos - 1); Delete(sLine, 1, iPos); iPos := Pos(';', sLine); arrClasses[iCount] := Copy(sLine, 1, iPos - 1); Delete(sLine, 1, iPos); arrKg[iCount] := StrToFloat(sLine); end; CloseFile(tFile); lblQ2_1.Caption := 'Number of learners: ' + IntToStr(iCount); end; Copyright reserved Please turn over
Information Technology/P1 17 Hlayiso/Mock 2026 NSC – Marking Guidelines // =========================================================================== // Question 2.2 7 marks // =========================================================================== procedure TfrmQuestion2.btnQ2_2Click(Sender: TObject); var i: Integer; rTotal: Real; begin redQ2.Clear; redQ2.Lines.Add('Name' + #9 + 'Class' + #9 + 'Kg'); rTotal := 0; for i := 1 to iCount do begin redQ2.Lines.Add(arrNames[i] + #9 + arrClasses[i] + #9 + FormatFloat('0.0', arrKg[i])); rTotal := rTotal + arrKg[i]; end; redQ2.Lines.Add(''); redQ2.Lines.Add('Total collected: ' + FormatFloat('0.0', rTotal) + ' kg'); redQ2.Lines.Add('Average per learner: ' + FormatFloat('0.0', rTotal / iCount) + ' kg'); end; // =========================================================================== // Question 2.3 8 marks // =========================================================================== procedure TfrmQuestion2.btnQ2_3Click(Sender: TObject); var sClass, sTop: String; i, iLearners: Integer; rTotal, rMax: Real; begin redQ2.Clear; if cmbQ2_3.ItemIndex = -1 then begin ShowMessage('Select a class'); Exit; end; sClass := cmbQ2_3.Items[cmbQ2_3.ItemIndex]; iLearners := 0; rTotal := 0; rMax := -1; sTop := ''; for i := 1 to iCount do if arrClasses[i] = sClass then begin Inc(iLearners); rTotal := rTotal + arrKg[i]; if arrKg[i] > rMax then begin rMax := arrKg[i]; sTop := arrNames[i]; end; end; redQ2.Lines.Add('Class ' + sClass); redQ2.Lines.Add('Number of learners: ' + IntToStr(iLearners)); redQ2.Lines.Add('Total collected: ' + FormatFloat('0.0', rTotal) + ' kg'); Copyright reserved Please turn over
Information Technology/P1 18 Hlayiso/Mock 2026 NSC – Marking Guidelines redQ2.Lines.Add('Top recycler: ' + sTop + ' (' + FormatFloat('0.0', rMax) + ' kg)'); end; // =========================================================================== // Question 2.4 8 marks // =========================================================================== procedure TfrmQuestion2.btnQ2_4Click(Sender: TObject); var i, j: Integer; sTemp: String; rTemp: Real; begin redQ2.Clear; redQ2.Lines.Add('TOP FIVE RECYCLERS'); for i := 1 to iCount - 1 do for j := i + 1 to iCount do if arrKg[j] > arrKg[i] then begin rTemp := arrKg[i]; arrKg[i] := arrKg[j]; arrKg[j] := rTemp; sTemp := arrNames[i]; arrNames[i] := arrNames[j]; arrNames[j] := sTemp; sTemp := arrClasses[i]; arrClasses[i] := arrClasses[j]; arrClasses[j] := sTemp; end; for i := 1 to 5 do redQ2.Lines.Add(IntToStr(i) + '. ' + arrNames[i] + ' (' + arrClasses[i] + ') - ' + FormatFloat('0.0', arrKg[i]) + ' kg'); end; // =========================================================================== // Question 2.5 5 marks // =========================================================================== procedure TfrmQuestion2.btnQ2_5Click(Sender: TObject); var tCert: TextFile; i, iNum: Integer; begin AssignFile(tCert, 'Certificates.txt'); Rewrite(tCert); iNum := 0; for i := 1 to iCount do if arrKg[i] >= 15 then begin Writeln(tCert, arrNames[i] + ' (' + arrClasses[i] + ') - ' + FormatFloat('0.0', arrKg[i]) + ' kg'); Inc(iNum); end; CloseFile(tCert); ShowMessage(IntToStr(iNum) + ' certificates have been written to the file'); end; end. Copyright reserved Please turn over
Information Technology/P1 19 Hlayiso/Mock 2026 NSC – Marking Guidelines ANNEXURE G: SOLUTION FOR QUESTION 3 NOTE: Only the event handlers of the form unit are shown. The provided unit dbConnection_U.pas and the provided event handlers are unchanged. // =========================================================================== // Question 3.1 7 marks // =========================================================================== procedure TfrmQuestion3.btnQ3_1Click(Sender: TObject); var sProvince: String; iNum: Integer; begin redQ3.Clear; if cmbQ3_1.ItemIndex = -1 then begin ShowMessage('Select a province'); Exit; end; sProvince := cmbQ3_1.Items[cmbQ3_1.ItemIndex]; redQ3.Lines.Add('Trails in ' + sProvince + ':'); iNum := 0; tblTrails.First; while NOT tblTrails.Eof do begin if tblTrails['Province'] = sProvince then begin redQ3.Lines.Add(tblTrails['TrailName'] + ' - ' + FormatFloat('0.0', tblTrails['Distance']) + ' km'); Inc(iNum); end; tblTrails.Next; end; if iNum = 0 then redQ3.Lines.Add('No trails found') else redQ3.Lines.Add('Number of trails: ' + IntToStr(iNum)); end; // =========================================================================== // Question 3.2 9 marks // =========================================================================== procedure TfrmQuestion3.btnQ3_2Click(Sender: TObject); var sLongest: String; rMaxDist, rTotalRating: Real; iDogs, iTrails: Integer; begin redQ3.Clear; rMaxDist := 0; sLongest := ''; rTotalRating := 0; iDogs := 0; iTrails := 0; tblTrails.First; while NOT tblTrails.Eof do begin if tblTrails['Distance'] > rMaxDist then Copyright reserved Please turn over
Information Technology/P1 20 Hlayiso/Mock 2026 NSC – Marking Guidelines begin rMaxDist := tblTrails['Distance']; sLongest := tblTrails['TrailName']; end; if tblTrails['DogFriendly'] = True then Inc(iDogs); rTotalRating := rTotalRating + tblTrails['Rating']; Inc(iTrails); tblTrails.Next; end; redQ3.Lines.Add('Longest trail: ' + sLongest + ' (' + FormatFloat('0.0', rMaxDist) + ' km)'); redQ3.Lines.Add('Dog-friendly trails: ' + IntToStr(iDogs)); redQ3.Lines.Add('Average rating: ' + FormatFloat('0.00', rTotalRating / iTrails)); end; // =========================================================================== // Question 3.3 7 marks // =========================================================================== procedure TfrmQuestion3.btnQ3_3Click(Sender: TObject); var iUpdated: Integer; begin redQ3.Clear; iUpdated := 0; tblTrails.First; while NOT tblTrails.Eof do begin if tblTrails['Difficulty'] = 'Hard' then begin tblTrails.Edit; tblTrails['EntryFee'] := tblTrails['EntryFee'] * 1.1; tblTrails.Post; redQ3.Lines.Add(tblTrails['TrailName'] + ': ' + FormatFloat('R 0.00', tblTrails['EntryFee'])); Inc(iUpdated); end; tblTrails.Next; end; redQ3.Lines.Add(IntToStr(iUpdated) + ' entry fees updated'); end; // =========================================================================== // Question 3.4 9 marks // =========================================================================== procedure TfrmQuestion3.btnQ3_4Click(Sender: TObject); var sName: String; begin sName := edtQ3_4_Name.Text; if (sName = '') OR (cmbQ3_4.ItemIndex = -1) OR (rgpQ3_4.ItemIndex = -1) then begin ShowMessage('Enter a trail name and select a province and a difficulty'); Exit; end; tblTrails.Last; tblTrails.Insert; Copyright reserved Please turn over
Information Technology/P1 21 Hlayiso/Mock 2026 NSC – Marking Guidelines tblTrails['TrailName'] := sName; tblTrails['Province'] := cmbQ3_4.Items[cmbQ3_4.ItemIndex]; tblTrails['Distance'] := StrToFloat(edtQ3_4_Dist.Text); tblTrails['Difficulty'] := rgpQ3_4.Items[rgpQ3_4.ItemIndex]; tblTrails['DogFriendly'] := chkQ3_4.Checked; tblTrails['EntryFee'] := spnQ3_4.Value; tblTrails['Rating'] := 0; tblTrails.Post; ShowMessage(sName + ' has been added'); end; // =========================================================================== // Question 3.5 8 marks // =========================================================================== procedure TfrmQuestion3.btnQ3_5Click(Sender: TObject); var sTrail: String; bFound: Boolean; begin sTrail := InputBox('Remove trail', 'Enter the name of the trail', ''); bFound := False; tblTrails.First; while (NOT tblTrails.Eof) AND (NOT bFound) do begin if UpperCase(tblTrails['TrailName']) = UpperCase(sTrail) then bFound := True else tblTrails.Next; end; if bFound then begin if MessageDlg('Are you sure you want to remove ' + tblTrails['TrailName'] + '?', mtConfirmation, [mbYes, mbNo], 0) = mrYes then begin tblTrails.Delete; ShowMessage('The trail has been removed'); end; end else ShowMessage('Trail not found'); end; end. Copyright reserved Please turn over
Information Technology/P1 22 Hlayiso/Mock 2026 NSC – Marking Guidelines ANNEXURE H: SOLUTION FOR QUESTION 4 const arrMonths: array [1 .. 12] of String = ('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'); var frmQuestion4: TfrmQuestion4; arrDraw: array [1 .. 6] of Integer; implementation {$R *.dfm} // =========================================================================== // Provided code // =========================================================================== procedure TfrmQuestion4.FormCreate(Sender: TObject); begin Randomize; end; // =========================================================================== // Question 4.1 11 marks // =========================================================================== procedure TfrmQuestion4.btnQ4_1Click(Sender: TObject); var sID: String; i, iYear, iMonth: Integer; bValid: Boolean; begin memQ4.Clear; sID := edtQ4_ID.Text; bValid := Length(sID) = 13; for i := 1 to Length(sID) do if (sID[i] < '0') OR (sID[i] > '9') then bValid := False; if NOT bValid then begin ShowMessage('Invalid ID number - it must consist of 13 digits'); Exit; end; iYear := StrToInt(Copy(sID, 1, 2)); if iYear > 26 then iYear := iYear + 1900 else iYear := iYear + 2000; iMonth := StrToInt(Copy(sID, 3, 2)); memQ4.Lines.Add('ID number: ' + sID); memQ4.Lines.Add('Date of birth: ' + IntToStr(StrToInt(Copy(sID, 5, 2))) + ' ' + arrMonths[iMonth] + ' ' + IntToStr(iYear)); if StrToInt(Copy(sID, 7, 4)) >= 5000 then memQ4.Lines.Add('Gender: Male') else memQ4.Lines.Add('Gender: Female'); if sID[11] = '0' then memQ4.Lines.Add('Citizenship: South African citizen') Copyright reserved Please turn over
Information Technology/P1 23 Hlayiso/Mock 2026 NSC – Marking Guidelines else memQ4.Lines.Add('Citizenship: Permanent resident'); end; // =========================================================================== // Question 4.2 10 marks // =========================================================================== function calcCheckDigit(sID: String): Integer; var i, iDigit, iTotal: Integer; begin iTotal := 0; for i := 1 to 12 do begin iDigit := StrToInt(sID[i]); if i MOD 2 = 0 then begin iDigit := iDigit * 2; if iDigit > 9 then iDigit := iDigit - 9; end; iTotal := iTotal + iDigit; end; Result := (10 - iTotal MOD 10) MOD 10; end; procedure TfrmQuestion4.btnQ4_2Click(Sender: TObject); var sID: String; iCheck: Integer; begin sID := edtQ4_ID.Text; iCheck := calcCheckDigit(sID); if iCheck = StrToInt(sID[13]) then memQ4.Lines.Add('The check digit is correct') else memQ4.Lines.Add('The check digit is incorrect - it should be ' + IntToStr(iCheck)); end; // =========================================================================== // Question 4.3 9 marks // =========================================================================== procedure TfrmQuestion4.btnQ4_3Click(Sender: TObject); var i, j, iNum, iTemp: Integer; bDuplicate: Boolean; sLine: String; begin memQ4.Clear; i := 0; while i < 6 do begin iNum := Random(49) + 1; bDuplicate := False; for j := 1 to i do if arrDraw[j] = iNum then bDuplicate := True; Copyright reserved Please turn over
Information Technology/P1 24 Hlayiso/Mock 2026 NSC – Marking Guidelines if NOT bDuplicate then begin Inc(i); arrDraw[i] := iNum; end; end; for i := 1 to 5 do for j := i + 1 to 6 do if arrDraw[j] < arrDraw[i] then begin iTemp := arrDraw[i]; arrDraw[i] := arrDraw[j]; arrDraw[j] := iTemp; end; sLine := ''; for i := 1 to 6 do sLine := sLine + IntToStr(arrDraw[i]) + ' '; memQ4.Lines.Add('Lucky draw numbers:'); memQ4.Lines.Add(sLine); end; end. Copyright reserved

Study this subject

More from Grade 11 Information Technology

View all