GRADE 12 SEPTEMBER 2012 INFORMATION TECHNOLOGY P1 MEMORANDUM

Similar documents
GRADE 11 NOVEMBER 2012 INFORMATION TECHNOLOGY P1 INLIGTINGSTEGNOLOGIE V1 MEMORANDUM

GRADE/GRAAD 11 NOVEMBER 2013 INFORMATION TECHNOLOGY P1 INLIGTINGSTEGNOLOGIE V1 MEMORANDUM

NATIONAL SENIOR CERTIFICATE GRADE12

NATIONAL SENIOR CERTIFICATE GRADE12

NATIONAL SENIOR CERTIFICATE GRADE12

NATIONAL SENIOR CERTIFICATE GRADE12

NATIONAL SENIOR CERTIFICATE GRADE12

NATIONAL SENIOR CERTIFICATE GRADE 12

uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ExtCtrls, ImgList, StdCtrls, Buttons, MPlayer;

Delphi Generics.Collections

LAMPIRAN Listing Program

NATIONAL SENIOR CERTIFICATE GRADE 12

NATIONAL SENIOR CERTIFICATE GRADE 12

NATIONAL SENIOR CERTIFICATE GRADE 12

2. Design and Development

NATIONAL SENIOR CERTIFICATE GRADE 12

SENIOR CERTIFICATE EXAMINATION GRADE 12

NATIONAL SENIOR CERTIFICATE GRADE 12

PROVINCIAL EXAMINATION INFORMATION TECHNOLOGY PAPER 1 JUNE 2015 GRADE 11

Source code for simulations: 1 of 11

We are all familiar with the concept of a queue:

var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject); begin ListBox1.Items.LoadFromFile('d:\brojevi.

Introduction to the DLL for the USB Interface Board K8061

APPLICATION NOTE: KONSTANTER LSP32K Interface Protocol

Repetition Algorithms

NATIONAL SENIOR CERTIFICATE GRADE 12

NATIONAL SENIOR CERTIFICATE GRADE 12

HS STELLENBERG : DELPHI : FOKUS VIR EKSAMENS GEDATEER 1 FEB 2017.

LAMPIRAN A. Foto Alat

Kada se pokrene forma da bude plave boje. Dugme Crtaj krugove da iscrtava slučajan broj N krugova istog poluprečnika r (1/4 visine forme) čiji su

NATIONAL SENIOR CERTIFICATE GRADE 12

DELPHI FOR ELECTRONIC ENGINEERS. Part 2 Programming a calculator COURSE

GCE AS and A Level. Computing. AS exams 2009 onwards A2 exams 2010 onwards. Unit 1: Approved specimen question paper. Version 1.1

unit Unit3; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

Image. uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls ;

Использование ассиметричных алгоритмов криптографического преобразования информации в приложениях Windows

SENIOR CERTIFICATE EXAMINATION

NATIONAL SENIOR CERTIFICATE GRADE 12

NATIONAL SENIOR CERTIFICATE GRADE 12

UJIAN AKHIR SEMESTER TEKNIK INFORMATIKA SEKOLAH TINGGI TEKNOLOGI DUTA BANGSA

LAMPIRAN A: DDL DATABASE

LAMPIRAN A: LIST PROGRAM

16. Give a detailed algorithm for making a peanut butter and jelly sandwich.

CSE 20. Lecture 4: Number System and Boolean Function. CSE 20: Lecture2

CS1083 Week 2: Arrays, ArrayList

NATIONAL SENIOR CERTIFICATE GRADE 12

Object Pascal Language Guide

Software Systems Development Unit AS1: Introduction to Object Oriented Development

Interdisciplinary relations in teaching of programming

THREE. Multiple windows

Cambridge Assessment International Education Cambridge International Advanced Subsidiary and Advanced Level. Published

Menu Driven Systems. While loops, menus and the switch statement. Mairead Meagher Dr. Siobhán Drohan. Produced by:

(1) Trump (1) Trump (2) (1) Trump ExampleU ExampleP (2) Caption. TrumpU (2) Caption. (3) Image FormTrump. Top 0 Left 0.

NATIONAL SENIOR CERTIFICATE GRADE 12

NATIONAL SENIOR CERTIFICATE GRADE 12

CSCI 355 LAB #2 Spring 2004

List of Practical for Class XII Computer Science

Modbus Server. ARSoft International

Computing Science Unit 1

Control Structures of C++ Programming (2)

Loops! Loops! Loops! Lecture 5 COP 3014 Fall September 25, 2017

COMPUTING LABORATORY ASSESSED EXERCISE: Othello/Reversi. Autumn term 2001:

a) Answer all questions. b) Write your answers in the space provided. c) Show all calculations where applicable.

12.2 Mixing HLA and MASM/Gas Code in the Same Program In-Line (MASM/Gas) Assembly Code in Your HLA Programs

University of Massachusetts Amherst, Electrical and Computer Engineering

&'()*+,-./0&(1& $ :;

Java How to Program, 10/e. Copyright by Pearson Education, Inc. All Rights Reserved.

CSCI 355 Lab #2 Spring 2007

Chapter 4 Introduction to Control Statements

Programming Language. Control Structures: Repetition (while) Eng. Anis Nazer Second Semester

University of Cape Town ~ Department of Computer Science Computer Science 1015F ~ June Exam

Delphi Language Guide

CS 1302 Chapter 9 (Review) Object & Classes

Programming with Visual Studio Higher (v. 2013)

Cambridge International Examinations Cambridge International Advanced Subsidiary and Advanced Level. Published

LAMPIRAN A. Listing Program. Program pada Borland Delphi 7.0 A-1 Program pada CodeVisionAVR C Compiler A-6

Higher Computing Science. Software Design and Development

Sorting TEN. Alphabetical sort

Introduction to Visual Basic and Visual C++ Arithmetic Expression. Arithmetic Expression. Using Arithmetic Expression. Lesson 4.

CSE115 Introduction to Computer Science I Coding Exercise #7 Retrospective Fall 2017

Loop Structures. Loop Structures. Algorithm to record 5 TV programmes. Recall Structured Programming..3 basic control structures.

Final exam. Final exam will be 12 problems, drop any 2. Cumulative up to and including week 14 (emphasis on weeks 9-14: classes & pointers)

Function: function procedures and sub procedures share the same characteristics, with

Table of Contents Date(s) Title/Topic Page #s. Chapter 4: Writing Classes 4.1 Objects Revisited

1. Which of the following is the correct expression of character 4? a. 4 b. "4" c. '\0004' d. '4'

Practice Midterm Exam. Start with the ones that you consider to be easiest, then move to those that may take more time.

Sample Multiple-Choice Question 01

Cambridge International Examinations Cambridge International Advanced Subsidiary and Advanced Level. Published

Programming Problems 22nd Annual Computer Science Programming Contest

Copy: IF THE PROGRAM or OUTPUT is Copied, then both will have grade zero.

Eng. Mohammed S. Abdualal

Repetition Structures

VISUAL GUIDE to. RX Scripting. for Roulette Xtreme - System Designer 2.0. L J Howell UX Software Ver. 1.0

Condition-Controlled Loop. Condition-Controlled Loop. If Statement. Various Forms. Conditional-Controlled Loop. Loop Caution.

Outline. Program development cycle. Algorithms development and representation. Examples.

Revision for Final Examination (Second Semester) Grade 9

McGill University School of Computer Science COMP-202A Introduction to Computing 1

Chapter 4: Control structures. Repetition

Concours Informatique Luxembourgeois 2012 Epreuve Finale (05/07/2012) Solutions

CSIS-120 Final Exam Fall 2015 Name:

Transcription:

Province of the EASTERN CAPE EDUCATION NATIONAL SENIOR CERTIFICATE GRADE 12 SEPTEMBER 2012 INFORMATION TECHNOLOGY P1 MEMORANDUM MARKS: 120 This memorandum consists of 11 pages.

2 INFORMATION TECHNOLOGY P1 (SEPTEMBER 2012) SECTION A: QUESTION 1 (30 marks) (LO 4 AS 11, 12) procedure TForm1.Button1Click(Sender: TObject); qryschool.sql.text := 'Select * from EducatorsTb order by Surname '; procedure TForm1.Button2Click(Sender: TObject); qryschool.sql.text := 'Select Title, Surname, TeacherCode from EducatorsTb where (subjects = "ENG" or subjects = "AFR" or subjects = "XHO" ) '; OR where (subjects IN [ ENG, AFR, XHO ) procedure TForm1.Button3Click(Sender: TObject); ssubject : string; ssubject := inputbox('enter Subject','',''); qryschool.sql.text := 'Select count(*) as [Potential Subject Numbers] from LearnersTb where (S5 = "'+ssubject+'")'; procedure TForm1.Button5Click(Sender: TObject); qryschool.sql.text := 'Select Name, Surname from LearnersTb where Teachers like "%AM%"'; procedure TForm1.Button7Click(Sender: TObject); qryschool.sql.text := 'Update LearnersTb Set S5 = "LSC" where S5 = "ART"'; qryschool.sql.text := 'Select * from LearnersTb';

(SEPTEMBER 2012) INFORMATION TECHNOLOGY P1 (Memo) 3 procedure TForm1.Button8Click(Sender: TObject); qryschool.sql.text := 'Select class, count(class) AS [Class Sizes] from LearnersTb group by Class '; procedure TForm1.Button9Click(Sender: TObject); qryschool.sql.text := 'Select * from LearnersTb where (S7 = "CONS" or S7 = "TOUR" ) and (class = "G" )';

4 INFORMATION TECHNOLOGY P1 (SEPTEMBER 2012) QUESTION 2 2.1 (LO4 AS4) 2.1.1 Define a class Private Declaring fname, feng, fmaths, faverage 2.1.2 Constructor heading Assigning values to fields Initialising faverage 2.1.3 Procedure CalcAverage heading calculation 2.1.4 Function Qualify Boolean If average >= 60 Qualify true else qualify false 2.1.5 Function tostring heading Putting fields together #9 for columns 2.1.6 GetName heading fname assigned to result/function 2.1.7 GetAverage heading faverage assigned to result/function (55 marks) (3) 2.2 2.2.1 Initialise counter Check if file exists Assignfile Reset While not eof() do Readln Increase counter Get name Get eng mark Get maths mark Assign to arrlearner 2.2.2 Loop Call CalcAverage Call getname and getaverage display 2.2.3 Loop Call CalcAverage Call qualify If qualify = true display tostring 2.2.4 Inputbox Set flag iable to false Loop (counter less than number of learners and flag iable false) If getname = input from inputbox Then flag iable = true Else flag iable = false Increase counter If flag iable = true then display that name was found [32]

(SEPTEMBER 2012) INFORMATION TECHNOLOGY P1 (Memo) 5 POSSIBLE SOLUTION unit Subjects_u; interface uses SysUtils; type TLearner = class private fname : string; feng : integer; fmaths : integer; faverage : real; public constructor create (sname : string; ieng, imaths : integer); procedure CalcAverage; function tostring : string; function getname : string; function getaverage : real; function qualify : boolean; implementation constructor TLearner.create (sname : string; ieng, imaths : integer); fname := sname; feng := ieng; fmaths := imaths; faverage := 0; procedure TLearner.CalcAverage; faverage := (feng + fmaths)/2; function Tlearner.tostring : string; result := fname + #9 + inttostr(feng) + #9 + inttostr(fmaths) + #9 + floattostrf(faverage,fffixed,3,1); function TLearner.getname : string; result := fname; function TLearner.getaverage : real; result := faverage; function TLearner.qualify : boolean; if faverage >= 60 then

6 INFORMATION TECHNOLOGY P1 (SEPTEMBER 2012) qualify := true else qualify := false; end. unit Question2_u; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, Menus, StdCtrls, ComCtrls, Subjects_u; type TForm1 = class(tform) MainMenu1: TMainMenu; RichEdit1: TRichEdit; Options1: TMenuItem; Average1: TMenuItem; ITPhysicalScienceMaths1: TMenuItem; SearchforaLearner1: TMenuItem; Exit1: TMenuItem; procedure FormActivate(Sender: TObject); procedure Average1Click(Sender: TObject); procedure ITPhysicalScienceMaths1Click(Sender: TObject); procedure SearchforaLearner1Click(Sender: TObject); private { Private declarations } public { Public declarations } Form1: TForm1; icount : integer; arrlearners : array[1..50] of TLearner; implementation {$R *.dfm} procedure TForm1.FormActivate(Sender: TObject); myfile : textfile; soneline : string; ipos, ieng, imaths : integer; sname : string; if fileexists('learner.txt') <> true then ShowMessage('File does not exist'); Exit; Assignfile(myfile, 'Learner.txt'); Reset(myfile);

(SEPTEMBER 2012) INFORMATION TECHNOLOGY P1 (Memo) 7 icount := 0; while not eof(myfile) do readln(myfile,soneline); inc(icount); ipos := pos(',',soneline); sname := copy(soneline, 1, ipos - 1); delete(soneline, 1, ipos); ipos := pos(',',soneline); ieng := strtoint(copy(soneline, 1, ipos - 1)); delete(soneline, 1, ipos); imaths := strtoint(soneline); arrlearners[icount] := TLearner.create(sname, ieng, imaths); closefile(myfile); procedure TForm1.Average1Click(Sender: TObject); k : integer; richedit1.lines.add('name' + #9 + #9 + 'Average'); for k := 1 to icount do arrlearners[k].calcaverage; richedit1.lines.add(arrlearners[k].getname + #9 + floattostrf(arrlearners[k].getaverage,fffixed,6,0)); procedure TForm1.ITPhysicalScienceMaths1Click(Sender: TObject); k : integer; richedit1.lines.add('name' + #9 +#9+ 'English' + #9 + 'Maths' + #9 + 'Average'); for k := 1 to icount do arrlearners[k].calcaverage; if arrlearners[k].qualify then richedit1.lines.add(arrlearners[k].tostring); procedure TForm1.SearchforaLearner1Click(Sender: TObject); sinput : string; k : integer; bfound : boolean; sinput := inputbox('enter Name','',''); bfound := false; k := 1; while (k <= icount) and (bfound = false) do if arrlearners[k].getname = sinput then bfound := true else

8 INFORMATION TECHNOLOGY P1 (SEPTEMBER 2012) bfound := false; inc(k); if bfound = true then ShowMessage(sinput + ' found.'); if bfound = false then ShowMessage(sinput + ' not found.');

(SEPTEMBER 2012) INFORMATION TECHNOLOGY P1 (Memo) 9 QUESTION 3 (35 marks) 3.1 For loop columns For loop rows Assign random values (100 600) to stringgrid Assign column headings using a for loop, alternative method Assign row headings using a for loop, alternative method 3.2 Procedure Calculate Totals Heading for row in stringgrid For loop column Initialise total iable For loop row Calculate total of all values in each column 3.3 Procedure CalculateAvgWeek Heading for row in stringgrid For loop Initialise total iable Add all values in columns (for each class) Divide totals by 7 Display the average formatted to 2 decimals in the stringgrid 3.4 CalculateTotals call statement CalculateAvgWeek call statement 3.5 Initialise high iable to 0 For loop row Initialise sum iable For loop column Add values for each class If sum is higher than high Assign sum s value to high Assign the row value to a iable Display message of winning class [35]

10 INFORMATION TECHNOLOGY P1 (SEPTEMBER 2012) POSSIBLE SOLUTION unit question3_u; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, Grids; type TForm1 = class(tform) StringGrid1: TStringGrid; Button1: TButton; Button2: TButton; procedure FormCreate(Sender: TObject); procedure Button1Click(Sender: TObject); procedure Button2Click(Sender: TObject); private { Private declarations } publi procedure CalculateTotals; procedure CalculateAvgWeek; Form1: TForm1; implementation {$R *.dfm} procedure TForm1.FormCreate(Sender: TObject); irow, icol : integer; randomize; for icol := 1 to 4 do for irow := 1 to 7 do stringgrid1.cells[icol,irow] := inttostr(random(500)+101); for icol := 1 to 4 do stringgrid1.cells[icol,0] := 'Week '+inttostr(icol); for irow := 1 to 7 do stringgrid1.cells[0,irow] := 'Class '+inttostr(irow); procedure TForm1.CalculateTotals; icol,irow, itotal : integer; stringgrid1.cells[0,8] := 'Totals'; for icol := 1 to 4 do itotal := 0;

(SEPTEMBER 2012) INFORMATION TECHNOLOGY P1 (Memo) 11 for irow := 1 to 7 do itotal := itotal + strtoint(stringgrid1.cells[icol,irow]); stringgrid1.cells[icol,irow] := inttostr(itotal) procedure TForm1.CalculateAvgWeek; irow, icol : integer; rtotal, raverage : real; stringgrid1.cells[0,9] := 'Average'; for icol := 1 to 4 do rtotal := rtotal + strtofloat(stringgrid1.cells[icol,8]); raverage := rtotal/7; stringgrid1.cells[icol,9] := floattostrf(raverage,fffixed,6,2); rtotal := 0; procedure TForm1.Button1Click(Sender: TObject); CalculateTotals; CalculateAvgWeek; procedure TForm1.Button2Click(Sender: TObject); irow, ihigh, iclass, icol, isum,k,l,itemp : integer; arrclass : array[1..7] of integer; ihigh := 0; for irow := 1 to 7 do isum := 0; for icol := 1 to 4 do isum := isum + strtoint(stringgrid1.cells[icol,irow]); if isum > ihigh then ihigh := isum; iclass := irow; ShowMessage('Winning class: '+inttostr(iclass)); end.