# Information Technology Grade 11 P1 2018 Memo

> Grade 11 Information Technology Paper 1 memorandum from the KwaZulu Natal June 2018, 10 pages. Read online or download the free PDF.

- Page: https://www.hlayiso.com/library/grade-11-information-technology-2018-kwazulu-natal-june-memorandum-paper-1/b951b166-4106-4ed8-8005-8e8b28025d2c
- Updated: 2026-10-29
- Subject: Information Technology
- Grade: Grade 11
- Document type: Memorandum
- Year: 2018
- Exam period: KwaZulu Natal June
- Paper: 1
- Curriculum: CAPS
- Pages: 10

Breadcrumbs: [Home](https://www.hlayiso.com/) › [Library](https://www.hlayiso.com/library) › [Grade 11](https://www.hlayiso.com/library/grade-11) › [Information Technology](https://www.hlayiso.com/library/grade-11/information-technology) › [Information Technology Grade 11 P1 2018 Memo](https://www.hlayiso.com/library/grade-11-information-technology-2018-kwazulu-natal-june-memorandum-paper-1/b951b166-4106-4ed8-8005-8e8b28025d2c)

## About this document

Information Technology · Grade 11 · KwaZulu Natal June · 2018. Memorandum, 10 pages. Read online or download the PDF.

Read it free online on the page above; download the PDF from there.

## Document text

Text extracted from the PDF. Layout, diagrams and tables may not survive extraction.

### Page 1

GRADE 11 JUNE PAPER 1 2018 – POSSIBLE SOLUTIONS
QUESTION ONE
implementation
var
  category,Race : String;
  entryFee : Real;
  age : Integer;

//Q 1.1
procedure TForm1.btnQ11Click(Sender: TObject);
var
   dob : String;
   year : Integer;
begin
   dob := edtDOB.Text;
   year := StrToInt(Copy(dob,7,4)); 
   age := 2018 - year; 
   category := 'Senior'; 
   if age <= 16 then
     category := 'Junior'; 
   edtCategory.Text := category;                                           (8)
end;

//Q1.2
procedure TForm1.btnQ12Click(Sender: TObject);
var discount : Real;
begin
   discount := 0;
   if chbxClub.Checked then
      discount := discount + 0.08; 
   if chbxCharity.Checked then
      discount := discount + 0.025; 
   if category = 'Junior' then
     begin
        if cmbRace.ItemIndex > 1 then
          begin
             ShowMessage('This Entrant Is Not Eligible For This Race'); 
             cmbRace.ItemIndex := 0;
          end
        else
            begin
              entryFee := 45; 
              race := cmbRace.Text;
            end;
     end
   else
       begin
          if cmbRace.ItemIndex < 2 then
          begin
             ShowMessage('This Entrant Is Not Eligible For This Race'); 
             cmbRace.ItemIndex := 0;

### Page 2

end
          else
             begin
               entryFee := 75; 
               race := cmbRace.Text;
             end;
         end;
       entryFee := entryFee - (discount * entryFee); 
       edtEntryFee.Text := FloatToStrF(entryFee,ffCurrency,8,2);                            (12)
end;

//Q1.3
procedure TForm1.btnQ13Click(Sender: TObject);
var
   fName, entryNo,gender,iSN : String;
   p,numVowels,x,randNum : Integer;
begin
    fName := UpperCase(edtFullName.Text); 
    p := Pos(' ',fName); 
    gender := 'Female'; 
    if rbtnMale.Checked then
       gender := 'Male'; 
    numVowels := 0; 
    for x := 1 to Length(fName) do
      if fName[x] IN ['A','E','I','O','U'] then
         Inc(numVowels); 
    randNum := RandomRange(1000,5000); 
    entryNo := fName[1] + fName[p+1] + IntToStr(age) + gender[1] + IntToStr(numVowels) +
IntToStr(randNum); 
    iSN := fName[1] + '. ' + Copy(fName,p+1); 
    redOutput.Lines.Add(entryNo + #9 + iSN + #9 + gender + #9 + category + #9 + Race + #9 +
FloatToStrF(entryFee,ffCurrency,8,2)); 
end;                                                                                                 (15)
                                                                                                     [35]

QUESTION TWO
implementation

### Page 3

var
    id,gend,fName : String;
//2.1.1
Function TForm1.isValidID(id : STRING):boolean; 
var
   valid : Boolean;
   x,sumOdd,even,sumEven,checkDigit,total : Integer;
   sEven : String;
begin
   sEven := '';
   sumOdd := 0;             
   SumEven := 0;
   valid := False; 
   for x := 1 to 12 do
     begin
        if x MOD 2 = 1 then
           sumOdd := sumOdd + StrToInt(id[x]) 
        else
            sEven := sEven + id[x]; 
     end;
   even := StrToInt(sEven) * 2; 
   sEven := IntToStr(even); 
   for x := 1 to Length(sEven) do
     sumEven := sumEven + StrToInt(sEven[x]); 
   total := sumOdd + sumEven; 
   checkDigit := 10 - (total MOD 10); 
   if checkDigit = StrToInt(id[13]) then
     valid := True; 
   Result := valid; 
end;                                                             (16)

//2.1.2
Function TForm1.isValidGender(id,gender : STRING) : Integer; 
var
   valid : Integer;
   gen : String;
begin
     gen := 'Female'; 
    if strToInt(id[7]) > 4 then
      gen := 'Male'; 
    valid := 0; 
    if gen = gender then
      valid := 1; 
    Result := valid; 
end;                                                             (8)

//2.1.3
Function TForm1.isValidName(fName : STRING) : Boolean;

### Page 4

VAR
  x : Integer;
  valid : Boolean;
begin
   valid := true; 
   x := 1; 
   while ((X <= Length(fName)) AND (valid)) do
     begin
        if NOT(fName[x] IN ['a'..'z','A'..'Z','-',' ']) then
           valid := False; 
        Inc(x); 
     end;
   Result := valid; 
end;                                                                (8)

//2.1.4
Procedure TForm1.resetForm;
begin
    edtIDNo.Clear;
    edtFullName.Clear;
    rbtnMale.Checked := False;    
    rbtnFemale.Checked := False;
    btnValidateGender.Enabled := False;
    btnValidateName.Enabled := False;
    btnSave.Enabled := False;         
    btnDiscard.Enabled := False;
    edtIDNo.SetFocus; 
end;                                                                (3)

//2.2.1
procedure TForm1.btnValidateIDClick(Sender: TObject);
begin
    id := edtIDNo.Text; 
    if isValidID(id) then
      begin
         btnValidateGender.Enabled := True; 
         ShowMessage('Id Number Is Valid');
      end
    else
       begin
         ShowMessage('Invalid Id Number! Please Try Again...'); 
         edtIDNo.Clear;
         edtIDNo.SetFocus;
       end;
end;                                                                (4)

//2.2.2
procedure TForm1.btnValidateGenderClick(Sender: TObject);
begin

### Page 5

id := edtIDNo.Text; 
   gend := 'Male'; 
   if rbtnFemale.Checked then
     gend := 'Female'; 
   if isValidGender(id,gend) = 1 then
     begin
        btnValidateName.Enabled := True;
        ShowMessage('Selected Gender Is Valid'); 
     end
   else
     begin
        ShowMessage('Id Number And Gender Do Not Match! Please Enter New ID Number OR Select Different
Gender'); 
        rbtnFemale.Checked := False;
        rbtnMale.Checked := False;     
     end;
end;                                                                                         (9)

//2.2.3
procedure TForm1.btnValidateNameClick(Sender: TObject);
begin
    fName := edtFullName.Text; 
    if isValidName(fName) then
      begin
         btnSave.Enabled := True; 
         btnDiscard.Enabled := True; 
         ShowMessage('Name Input Is Valid');
      end
    else
        begin
          ShowMessage('Invalid Name! Please Try Again...');   
          edtFullName.Clear;
          edtFullName.SetFocus;
        end;
end;                                                                                          (5)

//2.2.4
procedure TForm1.btnSaveClick(Sender: TObject);
var
   t : TextFile; 

### Page 6

line : String;
begin
   AssignFile(t,'Registered.txt'); 
   Append(t); 
   line := id + '#' + fName + '#' + gend; 
   Writeln(t,line); 
   ShowMessage('Details of Entrant Saved To File'); 
   CloseFile(t); 
   resetForm; 
end;                                                    (8)

//2.2.5
procedure TForm1.btnDiscardClick(Sender: TObject);
begin
     resetForm; 
end;                                                    (1)
                                                        [62]

QUESTION THREE
//3.1
procedure TForm1.btnGenerateClick(Sender: TObject);
var
   x : Integer;
begin

### Page 7

for x := 1 to numEntrants do
     case race[x] of
       5 : time[x] := RandomRange(20,60); 
       10 : time[x] := RandomRange(61,90); 
       20 : time[x] := RandomRange(250,350); 
       50 : time[x] := RandomRange(390,500); 
     end;
end;                                                                         (6)

//3.2
procedure TForm1.btnDisplayAllClick(Sender: TObject);
var
  x,hh,mm : Integer;
  disp,fTime : String;
begin
   redOutput.Clear;
   disp := 'Gender' + #9 + 'Race' + #9 + 'Finishing Time'; 
   redOutput.Lines.Add(disp); 
   for x := 1 to numEntrants do
     begin
        hh := time[x] DIV 60; 
        mm := time[x] MOD 60; 
        fTime := IntToStr(hh) + ':' + IntToStr(mm); 
        disp := gender[x] + #9 + IntToStr(race[x]) + ' KM' + #9 + fTime; 
        redOutput.Lines.Add(disp); 
     end;
end;                                                                         (8)

//3.3.1
procedure TForm1.btnFastestClick(Sender: TObject);
var
   selGen : char;
   selRace,x,fastest : Integer;
begin
    redOutput.Clear;
    selGen := 'F';
    if cmbGender.ItemIndex = 1 then
      selGen := 'M'; 
    case cmbRaceType.ItemIndex of
      0 : selRace := 5;
      1 : selRace := 10; 
      2 : selRace := 20;
      3 : selRace := 50;
    end;
    fastest := 0; 
    x := 1; 
    while fastest = 0 do
      begin
          if (gender[x] = selGen) AND (race[x] = selRace) then
            fastest := time[x]; 

### Page 8

inc(x); 
     end;
   for x := 1 to numEntrants do
     if (gender[x] = selGen) AND (race[x] = selRace) then
       if time[x] < fastest then
         fastest := time[x]; 
   redOutput.Lines.Add('The fastest time for ' + selGen + ' in the '+ IntToStr(selRace)+ 'KM is ' +
IntToStr(fastest) + ' Minutes'); 
end;                                                                                                    (16)

//3.3.2
procedure TForm1.btnAverageTimeClick(Sender: TObject);
var
   x,sum,count,selRace : Integer;
   selGen : Char;
   avg : real;
begin
    selGen := 'F';
    if cmbGender.ItemIndex = 1 then
      selGen := 'M';
    case cmbRaceType.ItemIndex of
      0 : selRace := 5;                  
      1 : selRace := 10;
      2 : selRace := 20;
      3 : selRace := 50;
    end;
    count := 0;
    sum := 0;
    for x := 1 to numEntrants do
      if (gender[x] = selGen) AND (race[x] = selRace) then
        begin
           sum := sum + time[x]; 
           inc(count); 
        end;
     avg := sum/count; 
     redOutput.Clear;
     redOutput.Lines.Add('The Average Time For ' + selGen + ' in the ' + IntToStr(selRace) + 'KM is ' +
FloatToStrF(avg,ffFixed,8,2) + ' Minutes'); 
end;                                                                                                    (8)

//3.3.3
procedure TForm1.btnDisplaySelectedClick(Sender: TObject);
var
  x,hh,mm,selRace : Integer;
  disp,fTime : String;
  selGen : Char;
begin

### Page 9

selGen := 'F';
   if cmbGender.ItemIndex = 1 then
     selGen := 'M';
   case cmbRaceType.ItemIndex of
     0 : selRace := 5;                   
     1 : selRace := 10;
     2 : selRace := 20;
     3 : selRace := 50;
   end;
   redOutput.Clear;
  disp := 'Gender' + #9 + 'Race' + #9 + 'Finishing Time';
  redOutput.Lines.Add(disp);
  for x := 1 to numEntrants do
    begin
         if (gender[x] = selGen) AND (race[x] = selRace) then
           begin
             hh := time[x] DIV 60;
             mm := time[x] MOD 60;
             fTime := IntToStr(hh) + ':' + IntToStr(mm);                        
             disp := gender[x] + #9 + IntToStr(race[x]) + ' KM' + #9 + fTime;
             redOutput.Lines.Add(disp);
           end;
    end;
end;                                                                                (4)

//3.4
procedure TForm1.btnSortClick(Sender: TObject);
var
   x,y,temp : Integer;
   tGen : Char;
begin
    for x := 1 to numEntrants - 1 do
     for y := x+1 to numEntrants do
       if race[x] > race[y] then
         begin
            temp := race[x];
            race[x] := race[y];  
            race[y] := temp;

          temp := time[x];
          time[x] := time[y];   
          time[y] := temp;

           tGen := gender[x];
           gender[x] := gender[y]; 
           gender[y] := tGen;
       end;
   for x := 1 to numEntrants - 1 do
    for y := x+1 to numEntrants do        
     if race[x] = race[y] then
       if time[x] > time[y] then

### Page 10

begin
          temp := time[x];
          time[x] := time[y];   
          time[y] := temp;

          tGen := gender[x];
          gender[x] := gender[y];   
          gender[y] := tGen;
       end;
end;                                    (11)
                                        [53]

## Related documents

- [IT JUNE P1 QP ONLY](https://www.hlayiso.com/library/it-june-p1-qp-only/743bb597-d018-40b6-acc4-eadcac3b347a) — Information Technology · QP · 2018
- [IT P1 MEMO AFR GR11 NOV 2018](https://www.hlayiso.com/library/it-p1-memo-afr-gr11-nov-2018/3a8ef4dc-f861-4f69-a3a6-14d9a854b5ac) — Information Technology · Memo · 2018 · Afr
- [IT P1 MEMO GR11 NOV 2018](https://www.hlayiso.com/library/it-p1-memo-gr11-nov-2018/2dc78f09-34ed-496f-bafe-607a640e7c71) — Information Technology · Memo · 2018
- [IT JUNE-P1-and-MEMO-1](https://www.hlayiso.com/library/it-june-p1-and-memo-1/0b17b8f6-fad4-47c1-bfc5-ce9d5b3c1302) — Information Technology · Memo · 2017
- [IT 2015-JUNE-P1-and-MEMO](https://www.hlayiso.com/library/it-2015-june-p1-and-memo/6a35f7de-a1b3-4043-8e1f-8e1fd4ec5d1b) — Information Technology · Memo · 2015
- [IT P1 QP NOV 2018 AFR](https://www.hlayiso.com/library/it-p1-qp-nov-2018-afr/e1a2de08-fa87-4035-a20e-9a4592bc210d) — Information Technology · QP · 2018 · Afr

## More from Grade 11 Information Technology

- [Gr 11 Info Tech ATP 2023-24](https://www.hlayiso.com/library/gr-11-info-tech-atp-2023-24/67fc595c-646e-4c38-9951-fe5fe3a113a7) — ATP
- [IT P1 QP GR11 NOV 2022 AFR](https://www.hlayiso.com/library/it-p1-qp-gr11-nov-2022-afr/e4251ebe-2f65-4c6f-992b-f7208b36300a) — QP · 2022 · Afr
- [IT P1 QP GR11 NOV 2022 English](https://www.hlayiso.com/library/it-p1-qp-gr11-nov-2022-english/3db564bd-1d04-48ab-aedd-fae2d9f9939f) — QP · 2022 · Eng
- [IT P2 GR11 QP NOV2022 Afrikaans](https://www.hlayiso.com/library/it-p2-gr11-qp-nov2022-afrikaans/00d1cb8c-b0d9-41ea-9060-a94b73039d3a) — QP · 2022 · Afr
- [IT P2 GR11 QP NOV2022 English](https://www.hlayiso.com/library/it-p2-gr11-qp-nov2022-english/1c12dccc-2a5b-4b41-a80c-5bd8b30f6151) — QP · 2022 · Eng
- [IT P1 QP GR11 NOV 2022 AFR](https://www.hlayiso.com/library/grade-11-information-technology-2022-exemplar-november-exam-question-paper-paper-1-afrikaans/a17870ba-8fac-4013-9eda-0831f367fbca) — QP · 2022 · Afr

## Collection

- [Grade 11 past papers](https://www.hlayiso.com/grade-11/past-papers)

---

Hlayiso: free CAPS and IEB past papers, memos, notes and study guides for South African learners. When citing, link the page URL above, not a PDF or /api/ URL.
