q1 q2 only
q1 q2 only
1. Three past papers have been provided in this document per question for Paper
1.
5. Question 1 - General
a. Grade 10/11 problem solving/algorithm skills must be known.
b. Consult Exam Guideline Document for examples of possible
questions/list of components/math functions.
c. GUI manipulation through code.
6. Question 2 - Databases
a. 2.1 – code construct manipulating databases from grade 11 (20 marks)
b. 2.2 – SQLs (select/update/delete/insert) (20 marks)
7. Question 3 – OOP
a. Understand the following key concepts/methods
i. Attributes
ii. Constructor
iii. Mutator method
iv. Assessor method
v. toString
vi. Auxillary methods
vii. Parameters
viii. Object Instantiation
b. Take note of keywords in questions like:
i. Return – always a function
ii. Receive – receive parameters
8. Question 4 – Problem Solving
a. One dimensional and two dimensional arrays must be
understood well and practiced for this problem solving question.
b. Parallel arrays/sorting/searching must be practiced.
Page 1 of 106
LESSON PLAN
QUESTION 1 – GENERAL PROGRAMMING SKILLS
1. NOVEMBER 2023 Q1
Extract the name entered from the edit box edtQ1_1 and store
the name in the provided sName variable.
Extract the age entered/selected from the spin edit spnQ1_1
and store the age in the provided iAge variable.
Display the name and age, one below the other, using an
output dialogue box.
Example of input:
Example of output:
(5)
Page 2 of 106
LESSON PLAN
Learners who are interested in playing hockey are divided into teams of
11 players. A total of 11 players represents a full team in hockey.
The remainder of the learners who could not make up a full team
will be placed onto a reserve list.
Extract the total number of learners from the edit box edtQ1_2.
Use the total number of learners and the constant PLAYERS to
calculate the following:
o Number of hockey teams made up of 11 players
o Number of learners on the reserve list
(9)
Code has been provided using an input dialogue box for the user to
enter the finishing position of a participant. The user input is
assigned to the variable iPosition.
Page 3 of 106
LESSON PLAN
(6)
<Name>#<Mark>
Page 4 of 106
LESSON PLAN
NOTE: Your code must work correctly for any number of lines of
text in the file.
HINT: Use the position of the hash character (#) to extract the
mark for each learner.
Example of output:
(15)
TOTAL : 40
2. NOVEMBER 2022 Q1
Page 5 of 106
LESSON PLAN
Example of output:
(3)
The combo box cmbQ1_2 has been populated with the names of the
months from January to December.
Page 6 of 106
LESSON PLAN
(7)
C = √𝐴5 + 𝜋𝐵2
The user must enter the values for A and B in the edit boxes
Example with the values of 3.15 (A) and 1.07 (B) as input and the
result (C) as output:
(8)
Page 7 of 106
LESSON PLAN
The number of subjects that learners are enrolled for varies. The
marks achieved by a learner for each subject must be entered, and
the average mark must be calculated based on the number of
marks that was entered.
Examples of output:
Marks for two subjects and the average:
Page 8 of 106
LESSON PLAN
(11)
Code has been provided to extract two words from edit boxes edtQ1_5_1
and edtQ1_5_2 and convert them to lower case.
Write code to determine whether the two words extracted from the
edit boxes form an anagram or not and display a suitable message
in memo memQ1_5.
(11)
TOTAL : 40
Page 9 of 106
LESSON PLAN
3. NOVEMBER 2021 Q1
(4)
Page 10 of
106
LESSON PLAN
Example of output for seven breaks: Example of output for eight breaks:
(8)
sphere and a tetrahedron (a solid shape with four flat sides that are
triangles). The program must calculate and display the volume of
the combined figure.
Page 11 of
106
LESSON PLAN
The following information is provided:
1
The formula to calculate the volume of the combined figure is:
𝑉 = 𝑣𝑜𝑙𝑢𝑚𝑒 𝑜𝑓 𝑡𝑒𝑡𝑟𝑎ℎ𝑒𝑑𝑟𝑜𝑛 + (𝑣𝑜𝑙𝑢𝑚𝑒 𝑜𝑓 𝑠𝑝ℎ𝑒𝑟𝑒)
2
Page 12 of
106
LESSON PLAN
4
The formula to calculate the volume of a sphere is:
𝑉=
𝜋𝑟3
3
(7)
NOTE: The first item (@) in the combo box is situated in position one.
Page 13 of
106
LESSON PLAN
The first eight symbols in the combo box are shown below.
(11)
Code has been provided to clear the rich edit and to initialise an
Page 14 of
106
LESSON PLAN
Randomly generate a capital letter from the alphabet in the range 'A'..'Z'.
Compile a string using the generated letters.
Repeat the process until the generated letter is a duplicate of
the previous (last) letter that was generated.
Display the generated string in the redQ1_5 rich edit. Each time
the output string must include the final duplicate characters, as
shown in the example output.
HINT: The ASCII values for the letters 'A' to 'Z' start at 65 for the
letter 'A', 66 for the letter 'B', and so on up to the value of 90
for the letter 'Z'.
Example of output:
NOTE: The output your program generates may differ from the
output examples, because the letters are randomly
generated. The string that is generated can contain less or
more characters than the strings
supplied in the examples. (10)
TOTAL : 40
Page 15 of
106
LESSON PLAN
QUESTION 2 – DATABASE PROGRAMMING
1. NOVEMBER 2023 Q2
NOTE: The data pages attached at the end of this question provide information on
the design of the database and its contents.
Do the following:
Open the incomplete project file called Question2_P.dpr in the Question 2 folder.
Enter your examinationnumber as a comment in the first line of the
Question2_U.pas unit file.
Compile and execute the program. The program has no functionality
currently. The contents of the tables are displayed, as shown below on
the selection of tab sheet
2.2 - Delphi code.
Page 16 of
106
LESSON PLAN
Follow the instructions below to complete the code for each section as
described in QUESTION 2.1 and QUESTION 2.2.
Use SQL statements to answer QUESTION 2.1 and Delphi code to
answer QUESTION 2.2.
NOTE:
The 'Restore database' button is provided to restore the data contained
in the database to the original content.
The content of the database is password-protected, i.e. you will NOT
be able to gain direct access to the content of the database using
Microsoft Access.
Code is provided to link the GUI components to the database. Do NOT
change any of the provided code.
TWO variables are declared as public variables, as described in the table below.
Page 17 of
106
LESSON PLAN
NOTE:
Use ONLY SQL statements to answer QUESTION 2.1.1 to
QUESTION 2.1.5.
Code to execute the SQL statements and display the results of the
queries is provided. The SQL statements assigned to the variables
sSQL1, sSQL2, sSQL3, sSQL4 and sSQL5 are incomplete.
(3)
(4)
Page 18 of
106
LESSON PLAN
Example of output of the first five records:
(6)
Display the LecturerID and the total salary in a new column with
the heading Salary, formatted to currency.
(5)
Page 19 of
106
LESSON PLAN
Example of the first six records of the tblCourses table after
the online option was changed to false for the programming
courses:
(4)
NOTE:
Use ONLY Delphi programming code to answer QUESTION 2.2.1
and QUESTION 2.2.2.
NO marks will be awarded for SQL statements in QUESTION 2.2.
Page 20 of
106
LESSON PLAN
(14)
(4)
Page 21 of
106
LESSON PLAN
TOTAL : 40
Page 22 of
106
LESSON PLAN
Table: tblCourses
Page 23 of
106
LESSON PLAN
NOTE:
Connection code has been provided.
The database is password-protected; therefore, you will not be able to
access the database directly.
The following one-to-many relationship with referential integrity exists between the
two tables in the database:
Page 24 of
106
LESSON PLAN
2. NOVEMBER 2022 Q2
NOTE: The data pages attached at the end of this question provide information on the design
of the database and its contents.
TWO variables are declared as public variables, as described in the table below.
Page 25 of
106
LESSON PLAN
NOTE:
Use ONLY SQL code to answer QUESTION 2.1.1 to QUESTION 2.1.5.
Code to execute the SQL statements and display the results of the
queries is provided. The SQL statements that will be assigned to
the variables sSQL1, sSQL2, sSQL3, sSQL4 and sSQL5 are
incomplete.
Example of output:
(4)
Page 26 of
106
LESSON PLAN
(3)
(4)
Calculate and display the total amount that each client will
receive for the cans they have collected, formatted to currency.
Display the ClientName field and the total amount to receive,
using the field name Total Amount.
(8)
Page 27 of
106
LESSON PLAN
code] NOTE:
Use ONLY Delphi programming code to answer QUESTION
2.2.1 and QUESTION 2.2.2.
NO marks will be awarded for SQL statements in QUESTION 2.2.
Page 28 of
106
LESSON PLAN
(4)
Code has been provided to extract the year selected from the
radio group rgpQ2_2_2.
Page 30 of
106
LESSON PLAN
Example of output if the client record with ClientID BUS06
and the year 2022 has been selected:
(13)
TOTAL : 40
Page 31 of
106
LESSON PLAN
Table: tblCanCollection
Page 32 of
106
LESSON PLAN
3. NOVEMBER 2021 Q2
NOTE: The data pages attached at the end of this question provide
information on the design of the database and its contents.
Follow the instructions that follow to complete the code for each
section as described in QUESTION 2.1 and QUESTION 2.2.
TWO variables are declared as public variables as described in the table below.
Page 33 of
106
LESSON PLAN
NOTE: Code to execute the SQL statements and display the results of the queries is
provided. The SQL statements assigned to the variables sSQL1, sSQL2,
sSQL3, sSQL4 and sSQL5 are incomplete.
Use ONLY SQL code to complete the SQL statements for QUESTION 2.1.1 to
QUESTION 2.1.5 that follow.
Example of output:
(3)
Example of output:
NOTE: The date format may differ from the example in the output. (3)
(4)
Page 34 of
106
LESSON PLAN
Example of output:
(6)
(3)
Page 35 of
106
LESSON PLAN
NOTE:
Use ONLY Delphi programming code to answer QUESTION
2.2.1 to QUESTION 2.2.3.
NO marks will be awarded for SQL statements in QUESTION 2.2.
Page 36 of
106
LESSON PLAN
Page 38 of
106
LESSON PLAN
Table: tblClubs
Table: tblMembers
Page 40 of
106
LESSON PLAN