Skip to content

Information Technology Grade 12 P1 2015 Memo (Eng)

MemorandumInformation TechnologyGrade 12201511 pages

Grade 12 Information Technology Paper 1 memorandum from the Eastern Cape Mock Exam 2015 (English), 11 pages. Read online or download the free PDF.

Free to read online, no sign-up needed

Answer online

Loading document…

Loading document…

Questions in this paper

Document textSearch extracted text and jump to a page.
Downloaded from hlayiso.com NATIONAL SENIOR CERTIFICATE GRADE 12 SEPTEMBER 2015 INFORMATION TECHNOLOGY P1 MEMORANDUM MARKS: 150 This memorandum consists of 11 pages.
Downloaded from hlayiso.com 2 INFORMATION TECHNOLOGY P1 (E/C/SEPTEMBER 2015) QUESTION 1: POSSIBLE SOLUTION procedure TForm1.btn1Click(Sender: TObject); 4 marks var sname,ssurname,srooms : string; begin sname := ledname.text;  ssurname := ledsurname.text;  srooms := rgprooms.items[rgprooms.itemindex];  lbldisplay.Caption := sname + ' '+ ssurname+': '+srooms;  procedure TForm1.btn2Click(Sender: TObject); 8 marks var idays : integer; rcost : real; begin idays := strtoint(edtnumdays.text);  if idays <= 5 then rcost := idays *250 else rcost := 5 *250 + (idays - 5)*96/100*250;  edtcost.text := floattostrf(rcost,ffcurrency,8,2);  procedure TForm1.btn3Click(Sender: TObject); 6 marks var iminutes, ihours : integer; rcost : real; begin iminutes := strtoint(edtminutes.Text);  ihours := round ((iminutes/60)+0.5);  rcost := ihours * 30;  lblIntCost.Caption := floattostrf(rcost, ffcurrency,8,2);  procedure TForm1.btn4Click(Sender: TObject); 15 marks var ichar, k, inum, ilen : integer; scode : string; begin ichar := 0;  inum := 0;  scode := edtpass.text;  ilen := length(scode);  for k := 1 to ilen do begin if scode[k] in ['*','?','#','%'] then inc(ichar);  Copyright reserved Please turn over
Downloaded from hlayiso.com (EC/SEPTEMBER 2015) INFORMATION TECHNOLOGY P1 3 if (scode[k]) in ['0'..'9'] then inc(inum);  end; if (ilen = 10)  and (ichar >= 3)  and (inum >= 3)  then ShowMessage('Valid Password')  else ShowMessage('Invalid Password');  end; procedure TForm1.btnQ5Click(Sender: TObject); 17 marks var itotal, iran,inights, k, l : integer; sstars : string; begin randomize; reddisplay.clear;  reddisplay.Paragraph.tabcount := 1;  reddisplay.Paragraph.tab[0] := 50;  reddisplay.Lines.add('Month'+#9+'No of Nights');  itotal := 0;  inights := 0;  for k := 1 to 12 do begin sstars := '';  iran := random(20) + 1;  for l := 1 to iran do begin sstars := sstars + '*';  end; reddisplay.lines.add(inttostr(k)  + #9 + sstars + inttostr(iran));  inights := inights + iran;  end; itotal := inights * 450;  reddisplay.lines.add('Total No of Nights booked: '+inttostr(inights));  reddisplay.lines.add('Total Income for the year: '+inttostr(itotal));  end; [50] Copyright reserved Please turn over
Downloaded from hlayiso.com 4 INFORMATION TECHNOLOGY P1 (E/C/SEPTEMBER 2015) QUESTION 2: POSSIBLE SOLUTION unit clstravel_u; 27 marks Question 2 53 marks interface uses sysutils; type TTravel = class private fbooking : string; fdest : string;  fdate : string; fpeople : integer; fdiscount : real; ftotal : real; public constructor create(sbooking, sdest, sdate : string; ipeople:integer; rtotal : real);  procedure calcdiscount; procedure calctotal;  function tostring:string;  function getdest : string;  end; implementation { TTravel } procedure TTravel.calcdiscount;  var imonth : integer; rdiscount : real; begin imonth := strtoint(copy(fdate,4,2));  if imonth in [2,5,8,11] then begin rdiscount := 5;  if fpeople >= 15 then rdiscount := 7.5;  end else if fpeople >= 15 then rdiscount := 2.5 else rdiscount := 0;  fdiscount := rdiscount/100*ftotal; end; Copyright reserved Please turn over
Downloaded from hlayiso.com (EC/SEPTEMBER 2015) INFORMATION TECHNOLOGY P1 5 procedure TTravel.calctotal; begin ftotal := ftotal - fdiscount;  end; constructor TTravel.create(sbooking: string; sdest, sdate: string; ipeople: integer; rtotal: real); begin fbooking := sbooking; fdest := sdest; fdate := sdate; fpeople := ipeople;  ftotal := rtotal; fdiscount := 0;  end; function TTravel.getdest : string; begin result := fdest;  end; function TTravel.tostring: string; begin result := 'Booking Nr: ' + fbooking + #13 + 'Destination: ' + fdest+#13+'Date: ' +fdate+#13+'Number of people: '+inttostr(fpeople)+#13+'Discount: '+floattostrf(fdiscount,ffcurrency,8,2)+ #13+ 'Total: '+floattostrf(ftotal,ffcurrency,8,2)+#10; end; fields currency end. Copyright reserved Please turn over
Downloaded from hlayiso.com 6 INFORMATION TECHNOLOGY P1 (E/C/SEPTEMBER 2015) unit question2_u; 26 marks interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, clstravel_u, ComCtrls; type TForm1 = class(TForm) btn2_1: TButton; redOutput: TRichEdit; cboinput: TComboBox; procedure btn2_1Click(Sender: TObject); private {Private declarations} public {Public declarations} end; var Form1: TForm1; Travel : TTravel;  implementation {$R *.dfm} procedure TForm1.btn2_1Click(Sender: TObject); var myfile, myfile1 : textfile; soneline,sinput, sbooking,sdest,sdate : string; ipos,ipeople : integer; rtotal : real; begin if fileexists('Destination.txt')<>true then begin Showmessage('File does not exist');  Exit;  end; Assignfile(myfile,'Destination.txt');  Reset(myfile);  sinput := cboinput.text;  while not eof(myfile) do begin readln(myfile,soneline);  ipos := pos(';',soneline); sbooking := copy(soneline,1,ipos-1);  delete(soneline,1,ipos); Copyright reserved Please turn over
Downloaded from hlayiso.com (EC/SEPTEMBER 2015) INFORMATION TECHNOLOGY P1 7 ipos := pos(';',soneline); sdest := copy(soneline,1,ipos-1);  delete(soneline,1,ipos); ipos := pos(';',soneline); sdate := copy(soneline,1,ipos-1);  delete(soneline,1,ipos); ipos := pos(';',soneline); ipeople := strtoint(copy(soneline,1,ipos-1));  delete(soneline,1,ipos); rtotal := strtofloat(soneline);  travel := TTravel.create (sbooking,sdest,sdate,ipeople,rtotal); correct order travel.calcdiscount;  travel.calctotal;  if sinput = 'ALL' then redoutput.lines.add(travel.tostring)  else if travel.getdest = sinput then redoutput.lines.add(travel.tostring);  end; closefile(myfile);  end; end. Copyright reserved Please turn over
Downloaded from hlayiso.com 8 INFORMATION TECHNOLOGY P1 (E/C/SEPTEMBER 2015) QUESTION 3: POSSIBLE SOLUTION unit Question3_u; Question 3: 47 marks interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, Grids, StdCtrls, ExtCtrls, ComCtrls, Buttons; type TForm1 = class(TForm) Button1: TButton; Edit1: TEdit; Label1: TLabel; StringGrid1: TStringGrid; Button2: TButton; RadioGroup1: TRadioGroup; redDisplay: TRichEdit; BitBtn1: TBitBtn; procedure Button1Click(Sender: TObject); procedure Button2Click(Sender: TObject); procedure FormCreate(Sender: TObject); private {Private declarations} public procedure changeDate(irowf : integer); procedure Display; {Public declarations} end; var Form1: TForm1; irfound : integer; ar2flights : array[1..26,1..4] of string = (('John','09/09/2015','JHB','CPT'),('Sarah','12/11/2015','ELS','JHB'),('Pete','10/01/2015','J HB','CPT'),('Lorna','19/11/2015','DBN','JHB'),('Maxwell','12/11/2015','ELS','DBN'), ('Muzi','10/01/2015','JHB','CPT'),('Mavis','19/11/2015','DBN','JHB'),('Michal','12/11/201 5','ELS','DBN'), ('Rahul','10/01/2015','JHB','CPT'),('Vuyisa','19/11/2015','DBN','JHB'),('Masande','12/11/ 2015','ELS','DBN'),('Beena','10/01/2015','JHB','CPT'),('Lungile','19/11/2015','DBN','JHB '),('Kazimla','12/11/2015','ELS','DBN'), ('Alupheli','10/01/2015','JHB','CPT'),('Ellen','19/11/2015','DBN','JHB'),('Mbongovuyo','1 2/11/2015','ELS','DBN'), ('Sibulele','10/01/2015','JHB','CPT'),('Esihle','19/11/2015','DBN','JHB'),('Ronney','12/11/ 2015','ELS','DBN'), ('Lulutho','10/01/2015','JHB','CPT'),('Naledi','19/11/2015','DBN','JHB'),('Justine','12/11/2 015','ELS','DBN'),('Grace','10/01/2015','JHB','CPT'),('Athi','19/11/2015','DBN','JHB'),('Si negugu','12/11/2015','ELS','DBN')); Copyright reserved Please turn over
Downloaded from hlayiso.com (EC/SEPTEMBER 2015) INFORMATION TECHNOLOGY P1 9 arrseats : array[1..6] of char = ('A','B','C','D','E','F'); implementation {$R *.dfm} //============================================================ procedure TForm1.Button1Click(Sender: TObject); var bfound : boolean; sname : string; irow,irowfound : integer; begin bfound := false;  sname := edit1.text;  for irow := 1 to 26 do begin if ar2flights[irow,1] = sname then begin bfound := true;  irowfound := irow;  irfound:=irow;  end; end; if bfound = true then begin Showmessage(sname+' has been found');  Display;  //Call the procedure Display ChangeDate(irowfound); //Call the procedure ChangeDate() end else Showmessage(sname+' has not been found');  end; //=========================================================== procedure TForm1.changeDate(irowf : integer);  var sdate : string; begin sdate := inputbox('Enter Date','','');  ar2flights[irowf,2]:= sdate;  Showmessage('Date successfully changed');  end; //============================================================ procedure TForm1.Display;  irow, icol : integer; begin stringgrid1.cells[0,0]:='Name';  Copyright reserved Please turn over
Downloaded from hlayiso.com 10 INFORMATION TECHNOLOGY P1 (E/C/SEPTEMBER 2015) stringgrid1.cells[1,0]:='Date'; stringgrid1.cells[2,0]:='From'; stringgrid1.cells[3,0]:='To'; for irow := 1 to 26 do for icol := 1 to 4 do stringgrid1.cells[icol-1,irow]  := ar2flights[irow,icol];  end; //============================================================ procedure TForm1.Button2Click(Sender: TObject); var iseatrow,iseat ,irow: integer; cseat : char; sseatnr, sFilename,sName : string; tFile:Textfile; begin redDisplay.clear; if radiogroup1.itemindex = 0 then begin iseatrow:= random(6) + 1;  repeat iseat := random(6) + 1;  until (iseat <> 2) and (iseat <> 5);  cseat := arrseats[iseat];  sseatnr := inttostr(iseatrow)+cseat;  end else if radiogroup1.itemindex = 1 then begin iseatrow:= random(24) + 7;  iseat := random(6) + 1;  sseatnr := inttostr(iseatrow) + arrseats[iseat];  end; sName:=ar2flights[irfound,1];  redDisplay.Lines.Add('Name : ' + sName); redDisplay.Lines.Add('Date : ' + ar2flights[irfound,2]); redDisplay.Lines.Add('From : ' + ar2flights[irfound,3]);  redDisplay.Lines.Add('To : ' + ar2flights[irfound,4]); redDisplay.Lines.Add('Seat : ' + sseatnr); sFileName:=sName+'.txt';  assignfile(tFile,sfileName);  rewrite(tFile);  writeln(tFile,'Name : ' + sName); writeln(tFile,'Date : ' + ar2flights[irfound,2]); writeln(tFile,'From : ' + ar2flights[irfound,3]);  writeln(tFile,'To : ' + ar2flights[irfound,4]); writeln(tFile,'Seat : ' + sseatnr); closefile(tFile);  redDisplay.Lines.Add('****File '+sName+'.txt successfully saved****');  end; Copyright reserved Please turn over
Downloaded from hlayiso.com (EC/SEPTEMBER 2015) INFORMATION TECHNOLOGY P1 11 //============================================================ procedure TForm1.FormCreate(Sender: TObject); begin Display;  //Call the procedure end; //============================================================ end. TOTAL: 150 Copyright reserved Please turn over

Study this subject

More from Grade 12 Information Technology

View all