Skip to content

Information Technology Grade 10 P1 November Mock 2026 Memo

MemorandumInformation TechnologyGrade 10202620 pagesPublisher: Hlayiso

Grade 10 Information Technology Paper 1 memorandum from the November Mock Exam 2026 (English), 20 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 10 Exam Preparation WWW.HLAYISO.COM NATIONAL SENIOR CERTIFICATE GRADE 10 INFORMATION TECHNOLOGY P1 NOVEMBER EXAMINATION 2026 (MOCK) MARKING GUIDELINES MARKS: 120 These marking guidelines consist of 20 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. • Where a value is displayed in the wrong component or with a minor formatting difference (e.g. a missing space), award the mark for the calculation but not for the display. • Built-in routines that do the work the question asks for (e.g. Ceil, CharInSet) earn NO marks for that part of the question. 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] 5 pnlQ1_1.Caption := 'Jozi Science Expo 2026' ✓ pnlQ1_1.Color := clAqua ✓ pnlQ1_1.Font.Color := clNavy ✓ pnlQ1_1.Font.Size := 14 ✓ pnlQ1_1.Font.Style := [fsBold] ✓ 1.2 Button [1.2 - Ticket cost] 8 Extract the number of adults and learners: spnQ1_2_Adults.Value, spnQ1_2_Learners.Value ✓ Number of people: iAdults + iLearners ✓ Cost: iAdults * ADULT_PRICE ✓+ iLearners * LEARNER_PRICE ✓ if iPeople >= 10 then ✓ rCost := rCost * 0.9 ✓ Display ’Amount due: ’ and the cost in currency format (R and 2 decimals) in lblQ1_2 ✓ ’ (group discount)’ added ONLY when the discount was applied ✓ Also ACCEPT: rCost - rCost * 0.1; FloatToStrF(rCost, ffCurrency, 8, 2); hard-coded prices 50 and 25. 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 - Buses] 7 Extract the number of visitors and convert to integer (StrToInt) ✓ iBuses := iVisitors DIV SEATS ✓ if iVisitors MOD SEATS > 0 then ✓ Inc(iBuses) ✓ Empty seats: iBuses * SEATS - iVisitors ✓ Display ’Number of buses: ’ and the number of buses in lblQ1_3_Buses ✓ Display ’Empty seats: ’ and the number of empty seats in lblQ1_3_Seats ✓ Also ACCEPT: iEmpty := SEATS - iVisitors MOD SEATS with a test for MOD = 0. NOTE: Ceil or Round(iVisitors/65 + 0.5): NO marks for the DIV/MOD lines (max 5). 1.4 Button [1.4 - Project award] 8 Add the values of the three spin edits ✓ Divide by 3 using real division (/) and store in a real variable ✓ Display ’Average score: ’ and the average formatted to 1 decimal place in lblQ1_4_Avg ✓ if rAverage >= 80 then ’Gold’ ✓ else if rAverage >= 65 then ’Silver’ ✓ else if rAverage >= 50 then ’Bronze’ ✓ else ’Certificate of participation’ ✓ Display ’Award: ’ and the award in lblQ1_4_Award ✓ Also ACCEPT: separate IF statements with correct ranges, e.g. (rAverage >= 65) AND (rAverage < 80). NOTE: Using DIV (integer division) for the average: lose the mark for the division. 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 - Lucky draw] 7 InputBox(...) to obtain the number of tickets ✓ converted to integer (StrToInt) ✓ Random(iTickets) ✓+ 1 ✓ Convert the number to a string and use a loop: while Length(sTicket) < 4 do ✓ sTicket := '0' + sTicket ✓ Display ’Winning ticket: T’ and the four-digit ticket number in lblQ1_5 ✓ Also ACCEPT: RandomRange(1, iTickets + 1); repeat loop; a for-loop from 1 to 4 - Length(sTicket). NOTE: Format('%.4d', ...) or FormatFloat('0000', ...): NO marks for the loop (max 5). TOTAL QUESTION 1: 35 Copyright reserved Please turn over
Information Technology/P1 6 Hlayiso/Mock 2026 NSC – Marking Guidelines ANNEXURE B QUESTION 2: MARKING GRID – SELECTION AND STRING MANIPULATION CENTRE NUMBER: EXAMINATION NUMBER: QUESTION DESCRIPTION MAX. LEARNER’S MARKS MARKS 2.1 Button [2.1 - Username] 8 if cmbQ2_1.ItemIndex = -1: display a message and Exit ✓ Find the position of the space: Pos(' ', sName) ✓ First letter of the first name: sName[1] ✓ Extract the surname: Copy(sName, iSpace + 1, ...) ✓ First six letters of the surname: Copy(sSurname, 1, 6) ✓ Get the grade number from the selected item, e.g. Copy(sGrade, 7, 2) ✓ Convert the username to lower case (LowerCase) ✓ Display ’Username: ’ and the username in lblQ2_1 ✓ Also ACCEPT: Delete(sGrade, 1, 6); IntToStr(cmbQ2_1.ItemIndex + 8); an IF statement to limit the surname to six letters. 2.2 Button [2.2 - Password strength] 12 Extract the password and initialise FOUR counters to 0 ✓ for i := 1 to Length(sPassword) do ✓ if sPassword[i] in ['A'..'Z'] then Inc(iUpper) ✓ else if sPassword[i] in ['a'..'z'] then Inc(iLower) ✓ else if sPassword[i] in ['0'..'9'] then Inc(iDigits) ✓ else Inc(iSpecial) ✓ Score: one point if Length(sPassword) >= 8 ✓ One point for each counter greater than 0 (four tests) ✓✓ Score 5: ’Strong’ ✓ Score 3 or 4: ’Medium’, otherwise ’Weak’ ✓ Display the length, four counts, score and strength in memQ2_2 with labels ✓ Also ACCEPT: comparisons such as (c >= 'A') AND (c <= 'Z'); Ord values; a CASE statement for the strength. NOTE: CharInSet, IsUpper-type functions: NO marks for the relevant tests. Copyright reserved Please turn over
Information Technology/P1 7 Hlayiso/Mock 2026 NSC – Marking Guidelines QUESTION DESCRIPTION MAX. LEARNER’S MARKS MARKS 2.3 Button [2.3 - Hide e-mail] 10 Loop through the characters of the e-mail address ✓ count the number of ’@’ characters ✓ Position of ’@’: Pos('@', sEmail) ✓ Extract the domain: Copy(sEmail, iAt + 1, ...) ✓ if (iAtCount <> 1) OR (Pos('.', sDomain) = 0) then ✓ display ’Invalid e-mail address’ and Exit ✓ Start the hidden string with the first character: sLocal[1] ✓ for i := 2 to Length(sLocal) - 1 do add '*' ✓ Add the last character, '@' and the domain ✓ Display ’Hidden: ’ and the hidden e-mail address in lblQ2_3 ✓ Also ACCEPT: replacing the characters in the original string (sEmail[i] := '*') for positions 2 to iAt - 2. TOTAL QUESTION 2: 30 Copyright reserved Please turn over
Information Technology/P1 8 Hlayiso/Mock 2026 NSC – Marking Guidelines ANNEXURE C QUESTION 3: MARKING GRID – LOOPS CENTRE NUMBER: EXAMINATION NUMBER: QUESTION DESCRIPTION MAX. LEARNER’S MARKS MARKS 3.1 Button [3.1 - Savings plan] 8 Extract the number of weeks: spnQ3_1.Value ✓ Initialise the total to 0 ✓ for iWeek := 1 to iWeeks do ✓ Deposit: FIRST_DEPOSIT + (iWeek - 1) * INCREASE ✓ Add the deposit to the total ✓ Display week, deposit and total separated by tabs (#9) ✓ Amounts in currency format with 2 decimal places ✓ After the loop: ’Total saved after ’, weeks, ’ weeks: ’ and the total ✓ Also ACCEPT: rDeposit := rDeposit + INCREASE inside the loop (deposit initialised before the loop); iWeek * 10. 3.2 Button [3.2 - Reach target] 7 Extract the target and convert to real (StrToFloat) ✓ Initialise the total, the number of weeks and the deposit ✓ while rTotal < rTarget do ✓ Increment the number of weeks ✓ Add the deposit to the total ✓ Increase the deposit by INCREASE ✓ Display the number of weeks and the amount saved (currency) with text ✓ Also ACCEPT: a repeat ... until rTotal >= rTarget loop. NOTE: A for-loop with a fixed number of iterations: NO marks for the loop. Copyright reserved Please turn over
Information Technology/P1 9 Hlayiso/Mock 2026 NSC – Marking Guidelines QUESTION DESCRIPTION MAX. LEARNER’S MARKS MARKS 3.3 Button [3.3 - Guess the number] 9 iNumber := Random(50) + 1 ✓ Initialise the counter (0) and the flag (False) ✓ Conditional loop (repeat/while) ✓ InputBox and StrToInt to obtain the guess ✓ Increment the counter ✓ if iGuess = iNumber then bFound := True ✓ ’Too high’ if the guess is higher, ’Too low’ if it is lower ✓ until bFound OR (iCount = MAX_GUESSES) ✓ After the loop: display the correct message for each outcome in lblQ3_3 ✓ Also ACCEPT: while (NOT bFound) AND (iCount < MAX_GUESSES) do; testing iGuess = iNumber after the loop instead of a flag. 3.4 Button [3.4 - Prime numbers] 6 for iNum := spnQ3_4_From.Value to spnQ3_4_To.Value do ✓ Inner loop through √ the possible divisors (2 to iNum - 1, iNum DIV 2 or iNum) ✓ if iNum MOD iDiv = 0 then not prime ✓ Numbers less than 2 are not prime ✓ If prime: add the number to the output line and increment the counter ✓ Display the primes on ONE line, and the count on the next line ✓ Also ACCEPT: counting the factors of each number (prime if exactly 2 factors). TOTAL QUESTION 3: 30 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 - Units] 9 Extract the amount and convert to real ✓ if rAmount < 20: display the message and Exit ✓ if rAmount <= 100 then ✓ rUnits := rAmount / 2 ✓ else if rAmount <= 850 then ✓ rUnits := 50 + (rAmount - 100) / 2.5 ✓ else rUnits := 350 ✓ + (rAmount - 850) / 3 ✓ Display the amount (currency) and the units (1 decimal) with text in memQ4 ✓ Also ACCEPT: a loop that ’buys’ one unit at a time at the correct block price; calculating R850 as 100 + 300 * 2.5. Test values: R60 → 30.0 kWh; R500 → 210.0 kWh; R850 → 350.0 kWh; R1 000 → 400.0 kWh. 4.2 Button [4.2 - Token] 8 First digit: Random(9) + 1 (cannot be 0) ✓ Loop for the remaining 19 digits (20 digits in total) ✓ Random(10) ✓ Convert to string and join to the token ✓ Add a hyphen after every 4th digit: (i - 1) MOD 4 = 0 ✓✓ No hyphen at the start or at the end of the token ✓ Display ’Token: ’ and the token in memQ4 ✓ Also ACCEPT: a nested loop (5 groups x 4 digits) with a hyphen between groups; if i MOD 4 = 0 (i < 20) after adding the digit. Copyright reserved Please turn over
Information Technology/P1 11 Hlayiso/Mock 2026 NSC – Marking Guidelines QUESTION DESCRIPTION MAX. LEARNER’S MARKS MARKS 4.3 Button [4.3 - Daily usage] 8 Loop until all readings have been processed (e.g. comma added to the end, while sReadings <> '') ✓ Pos(',', ...), Copy and Delete to extract each reading ✓ Convert to integer; the first reading is stored as the previous reading ✓ Usage = reading − previous reading; previous := reading ✓ Display ’Day ’, day number, ’: ’, usage, ’ kWh’ ✓ Determine the highest usage and the day on which it occurred ✓ Average = total usage / number of days ✓ Display the highest usage with its day, and the average to 1 decimal place ✓ Expected output for the given readings: 12, 17, 12, 19, 8, 15, 16 kWh; highest: Day 4 (19 kWh); average: 14.1 kWh. Also ACCEPT: (last reading - first reading) / number of days for the average. TOTAL QUESTION 4: 25 SUMMARY OF LEARNER’S MARKS: CENTRE NUMBER: EXAMINATION NUMBER: QUESTION 1 QUESTION 2 QUESTION 3 QUESTION 4 GRAND TOTAL MAX. MARKS 35 30 30 25 120 LEARNER’S MARKS Copyright reserved Please turn over
Information Technology/P1 12 Hlayiso/Mock 2026 NSC – Marking Guidelines ANNEXURE E: SOLUTION FOR QUESTION 1 // =========================================================================== // Provided code // =========================================================================== procedure TfrmQuestion1.FormCreate(Sender: TObject); begin FormatSettings.DecimalSeparator := '.'; Randomize; end; // =========================================================================== // Question 1.1 5 marks // =========================================================================== procedure TfrmQuestion1.btnQ1_1Click(Sender: TObject); begin pnlQ1_1.Caption := 'Jozi Science Expo 2026'; pnlQ1_1.Color := clAqua; pnlQ1_1.Font.Color := clNavy; pnlQ1_1.Font.Size := 14; pnlQ1_1.Font.Style := [fsBold]; end; // =========================================================================== // Question 1.2 8 marks // =========================================================================== procedure TfrmQuestion1.btnQ1_2Click(Sender: TObject); const ADULT_PRICE = 50; LEARNER_PRICE = 25; var iAdults, iLearners, iPeople: Integer; rCost: Real; begin iAdults := spnQ1_2_Adults.Value; iLearners := spnQ1_2_Learners.Value; iPeople := iAdults + iLearners; rCost := iAdults * ADULT_PRICE + iLearners * LEARNER_PRICE; if iPeople >= 10 then begin rCost := rCost * 0.9; lblQ1_2.Caption := 'Amount due: ' + FormatFloat('R 0.00', rCost) + ' (group discount)'; end else lblQ1_2.Caption := 'Amount due: ' + FormatFloat('R 0.00', rCost); end; // =========================================================================== // Question 1.3 7 marks // =========================================================================== procedure TfrmQuestion1.btnQ1_3Click(Sender: TObject); const SEATS = 65; var iVisitors, iBuses, iEmpty: Integer; begin iVisitors := StrToInt(edtQ1_3.Text); Copyright reserved Please turn over
Information Technology/P1 13 Hlayiso/Mock 2026 NSC – Marking Guidelines iBuses := iVisitors DIV SEATS; if iVisitors MOD SEATS > 0 then Inc(iBuses); iEmpty := iBuses * SEATS - iVisitors; lblQ1_3_Buses.Caption := 'Number of buses: ' + IntToStr(iBuses); lblQ1_3_Seats.Caption := 'Empty seats: ' + IntToStr(iEmpty); end; // =========================================================================== // Question 1.4 8 marks // =========================================================================== procedure TfrmQuestion1.btnQ1_4Click(Sender: TObject); var rAverage: Real; sAward: String; begin rAverage := (spnQ1_4_J1.Value + spnQ1_4_J2.Value + spnQ1_4_J3.Value) / 3; lblQ1_4_Avg.Caption := 'Average score: ' + FormatFloat('0.0', rAverage); if rAverage >= 80 then sAward := 'Gold' else if rAverage >= 65 then sAward := 'Silver' else if rAverage >= 50 then sAward := 'Bronze' else sAward := 'Certificate of participation'; lblQ1_4_Award.Caption := 'Award: ' + sAward; end; // =========================================================================== // Question 1.5 7 marks // =========================================================================== procedure TfrmQuestion1.btnQ1_5Click(Sender: TObject); var iTickets, iWinner: Integer; sTicket: String; begin iTickets := StrToInt(InputBox('Lucky draw', 'Number of tickets sold:', '')); iWinner := Random(iTickets) + 1; sTicket := IntToStr(iWinner); while Length(sTicket) < 4 do sTicket := '0' + sTicket; lblQ1_5.Caption := 'Winning ticket: T' + sTicket; end; end. Copyright reserved Please turn over
Information Technology/P1 14 Hlayiso/Mock 2026 NSC – Marking Guidelines ANNEXURE F: SOLUTION FOR QUESTION 2 // =========================================================================== // Provided code // =========================================================================== procedure TfrmQuestion2.FormCreate(Sender: TObject); begin memQ2_2.Clear; end; // =========================================================================== // Question 2.1 8 marks // =========================================================================== procedure TfrmQuestion2.btnQ2_1Click(Sender: TObject); var sName, sFirst, sSurname, sGrade, sUsername: String; iSpace: Integer; begin if cmbQ2_1.ItemIndex = -1 then begin ShowMessage('Select a grade'); Exit; end; sName := edtQ2_1_Name.Text; iSpace := Pos(' ', sName); sFirst := Copy(sName, 1, iSpace - 1); sSurname := Copy(sName, iSpace + 1, Length(sName) - iSpace); sGrade := cmbQ2_1.Items[cmbQ2_1.ItemIndex]; sGrade := Copy(sGrade, 7, 2); sUsername := sFirst[1] + Copy(sSurname, 1, 6) + sGrade; sUsername := LowerCase(sUsername); lblQ2_1.Caption := 'Username: ' + sUsername; end; // =========================================================================== // Question 2.2 12 marks // =========================================================================== procedure TfrmQuestion2.btnQ2_2Click(Sender: TObject); var sPassword, sStrength: String; i, iUpper, iLower, iDigits, iSpecial, iScore: Integer; begin memQ2_2.Clear; sPassword := edtQ2_2.Text; iUpper := 0; iLower := 0; iDigits := 0; iSpecial := 0; for i := 1 to Length(sPassword) do begin if sPassword[i] in ['A' .. 'Z'] then Inc(iUpper) else if sPassword[i] in ['a' .. 'z'] then Inc(iLower) else if sPassword[i] in ['0' .. '9'] then Inc(iDigits) else Inc(iSpecial); Copyright reserved Please turn over
Information Technology/P1 15 Hlayiso/Mock 2026 NSC – Marking Guidelines end; iScore := 0; if Length(sPassword) >= 8 then Inc(iScore); if iUpper > 0 then Inc(iScore); if iLower > 0 then Inc(iScore); if iDigits > 0 then Inc(iScore); if iSpecial > 0 then Inc(iScore); case iScore of 5: sStrength := 'Strong'; 3, 4: sStrength := 'Medium'; else sStrength := 'Weak'; end; memQ2_2.Lines.Add('Length: ' + IntToStr(Length(sPassword))); memQ2_2.Lines.Add('Uppercase letters: ' + IntToStr(iUpper)); memQ2_2.Lines.Add('Lowercase letters: ' + IntToStr(iLower)); memQ2_2.Lines.Add('Digits: ' + IntToStr(iDigits)); memQ2_2.Lines.Add('Special characters: ' + IntToStr(iSpecial)); memQ2_2.Lines.Add('Score: ' + IntToStr(iScore) + ' out of 5'); memQ2_2.Lines.Add('Strength: ' + sStrength); end; // =========================================================================== // Question 2.3 10 marks // =========================================================================== procedure TfrmQuestion2.btnQ2_3Click(Sender: TObject); var sEmail, sLocal, sDomain, sHidden: String; i, iAtCount, iAt: Integer; begin sEmail := edtQ2_3.Text; iAtCount := 0; for i := 1 to Length(sEmail) do if sEmail[i] = '@' then Inc(iAtCount); iAt := Pos('@', sEmail); sDomain := Copy(sEmail, iAt + 1, Length(sEmail) - iAt); if (iAtCount <> 1) OR (Pos('.', sDomain) = 0) then begin ShowMessage('Invalid e-mail address'); Exit; end; sLocal := Copy(sEmail, 1, iAt - 1); sHidden := sLocal[1]; for i := 2 to Length(sLocal) - 1 do sHidden := sHidden + '*'; sHidden := sHidden + sLocal[Length(sLocal)] + '@' + sDomain; lblQ2_3.Caption := 'Hidden: ' + sHidden; end; end. Copyright reserved Please turn over
Information Technology/P1 16 Hlayiso/Mock 2026 NSC – Marking Guidelines ANNEXURE G: SOLUTION FOR QUESTION 3 const FIRST_DEPOSIT = 10; // deposit in week 1 (rand) INCREASE = 10; // amount by which the deposit increases every week var frmQuestion3: TfrmQuestion3; implementation {$R *.dfm} // =========================================================================== // Provided code // =========================================================================== procedure TfrmQuestion3.FormCreate(Sender: TObject); begin FormatSettings.DecimalSeparator := '.'; Randomize; end; // =========================================================================== // Question 3.1 8 marks // =========================================================================== procedure TfrmQuestion3.btnQ3_1Click(Sender: TObject); var iWeeks, iWeek: Integer; rDeposit, rTotal: Real; begin memQ3.Clear; memQ3.Lines.Add('Week' + #9 + 'Deposit' + #9 + 'Total'); iWeeks := spnQ3_1.Value; rTotal := 0; for iWeek := 1 to iWeeks do begin rDeposit := FIRST_DEPOSIT + (iWeek - 1) * INCREASE; rTotal := rTotal + rDeposit; memQ3.Lines.Add(IntToStr(iWeek) + #9 + FormatFloat('R 0.00', rDeposit) + #9 + FormatFloat('R 0.00', rTotal)); end; memQ3.Lines.Add(''); memQ3.Lines.Add('Total saved after ' + IntToStr(iWeeks) + ' weeks: ' + FormatFloat('R 0.00', rTotal)); end; // =========================================================================== // Question 3.2 7 marks // =========================================================================== procedure TfrmQuestion3.btnQ3_2Click(Sender: TObject); var rTarget, rTotal, rDeposit: Real; iWeeks: Integer; begin memQ3.Clear; rTarget := StrToFloat(edtQ3_2.Text); rTotal := 0; iWeeks := 0; Copyright reserved Please turn over
Information Technology/P1 17 Hlayiso/Mock 2026 NSC – Marking Guidelines rDeposit := FIRST_DEPOSIT; while rTotal < rTarget do begin Inc(iWeeks); rTotal := rTotal + rDeposit; rDeposit := rDeposit + INCREASE; end; memQ3.Lines.Add('Weeks needed: ' + IntToStr(iWeeks)); memQ3.Lines.Add('Amount saved: ' + FormatFloat('R 0.00', rTotal)); end; // =========================================================================== // Question 3.3 9 marks // =========================================================================== procedure TfrmQuestion3.btnQ3_3Click(Sender: TObject); const MAX_GUESSES = 6; var iNumber, iGuess, iCount: Integer; bFound: Boolean; begin iNumber := Random(50) + 1; iCount := 0; bFound := False; repeat iGuess := StrToInt(InputBox('Guess the number', 'Enter a number from 1 to 50:', '')); Inc(iCount); if iGuess = iNumber then bFound := True else if iGuess > iNumber then ShowMessage('Too high') else ShowMessage('Too low'); until bFound OR (iCount = MAX_GUESSES); if bFound then lblQ3_3.Caption := 'Correct! You needed ' + IntToStr(iCount) + ' guesses' else lblQ3_3.Caption := 'Out of guesses - the number was ' + IntToStr(iNumber); end; // =========================================================================== // Question 3.4 6 marks // =========================================================================== procedure TfrmQuestion3.btnQ3_4Click(Sender: TObject); var iNum, iDiv, iCount: Integer; bPrime: Boolean; sLine: String; begin memQ3.Clear; iCount := 0; sLine := ''; for iNum := spnQ3_4_From.Value to spnQ3_4_To.Value do begin bPrime := iNum > 1; iDiv := 2; while bPrime AND (iDiv <= iNum DIV 2) do Copyright reserved Please turn over
Information Technology/P1 18 Hlayiso/Mock 2026 NSC – Marking Guidelines begin if iNum MOD iDiv = 0 then bPrime := False; Inc(iDiv); end; if bPrime then begin sLine := sLine + IntToStr(iNum) + ' '; Inc(iCount); end; end; memQ3.Lines.Add(sLine); memQ3.Lines.Add('Number of prime numbers: ' + IntToStr(iCount)); end; end. Copyright reserved Please turn over
Information Technology/P1 19 Hlayiso/Mock 2026 NSC – Marking Guidelines ANNEXURE H: SOLUTION FOR QUESTION 4 // =========================================================================== // Provided code // =========================================================================== procedure TfrmQuestion4.FormCreate(Sender: TObject); begin FormatSettings.DecimalSeparator := '.'; Randomize; end; // =========================================================================== // Question 4.1 9 marks // =========================================================================== procedure TfrmQuestion4.btnQ4_1Click(Sender: TObject); var rAmount, rUnits: Real; begin memQ4.Clear; rAmount := StrToFloat(edtQ4_1.Text); if rAmount < 20 then begin ShowMessage('The minimum purchase is R20'); Exit; end; if rAmount <= 100 then rUnits := rAmount / 2.00 else if rAmount <= 850 then rUnits := 50 + (rAmount - 100) / 2.50 else rUnits := 350 + (rAmount - 850) / 3.00; memQ4.Lines.Add('Amount paid: ' + FormatFloat('R 0.00', rAmount)); memQ4.Lines.Add('Units purchased: ' + FormatFloat('0.0', rUnits) + ' kWh'); end; // =========================================================================== // Question 4.2 8 marks // =========================================================================== procedure TfrmQuestion4.btnQ4_2Click(Sender: TObject); var i: Integer; sToken: String; begin memQ4.Clear; sToken := IntToStr(Random(9) + 1); for i := 2 to 20 do begin if (i - 1) MOD 4 = 0 then sToken := sToken + '-'; sToken := sToken + IntToStr(Random(10)); end; memQ4.Lines.Add('Token: ' + sToken); end; // =========================================================================== // Question 4.3 8 marks // =========================================================================== procedure TfrmQuestion4.btnQ4_3Click(Sender: TObject); Copyright reserved Please turn over
Information Technology/P1 20 Hlayiso/Mock 2026 NSC – Marking Guidelines var sReadings: String; iComma, iPrev, iReading, iUsage, iDay, iTotal, iMax, iMaxDay: Integer; begin memQ4.Clear; sReadings := edtQ4_3.Text + ','; iComma := Pos(',', sReadings); iPrev := StrToInt(Copy(sReadings, 1, iComma - 1)); Delete(sReadings, 1, iComma); iDay := 0; iTotal := 0; iMax := -1; iMaxDay := 0; while sReadings <> '' do begin iComma := Pos(',', sReadings); iReading := StrToInt(Copy(sReadings, 1, iComma - 1)); Delete(sReadings, 1, iComma); Inc(iDay); iUsage := iReading - iPrev; memQ4.Lines.Add('Day ' + IntToStr(iDay) + ': ' + IntToStr(iUsage) + ' kWh'); iTotal := iTotal + iUsage; if iUsage > iMax then begin iMax := iUsage; iMaxDay := iDay; end; iPrev := iReading; end; memQ4.Lines.Add(''); memQ4.Lines.Add('Highest usage: Day ' + IntToStr(iMaxDay) + ' (' + IntToStr(iMax) + ' kWh)'); memQ4.Lines.Add('Average daily usage: ' + FormatFloat('0.0', iTotal / iDay) + ' kWh'); end; end. Copyright reserved

Study this subject

More from Grade 10 Information Technology

View all