0% found this document useful (0 votes)
8 views23 pages

G12 ITterm 2 Mid Year Exam Question Paper Paper 1

Grade 12 2025 past paper for I.T from SACAI

Uploaded by

koketsoshawn825
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views23 pages

G12 ITterm 2 Mid Year Exam Question Paper Paper 1

Grade 12 2025 past paper for I.T from SACAI

Uploaded by

koketsoshawn825
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 23

Exam - Task 4.

1:
Examination Paper 1
Term 2

INFORMATION TECHNOLOGY

GRADE 12

DURATION: 3 hours

TOTAL MARKS: 150


DATE ISSUED: 9 June 2025 DUE DATE: 9 June 2025

EXAMINER: DAVID COETZER MODERATOR: RENE LEUS


WHAT IS PLAGIARISM

Plagiarism is when you use someone else’s work without giving them credit.
Please ensure that you do not copy the answers from the online campus or any
other sources. Complete the assessment in your own words.

DECLARATION OF AUTHENTICITY

I declare that all work in this formal assessment is my own. I have not committed
plagiarism as defined by the plagiarism policy. I have not accessed any resources
on the online campus to help me complete this assessment. I will not use
text-to-speech software (such as Natural Readers) or any other type of
concession (unless I have been approved for a concession in writing by
Academic Support within the Student Well-Being Department or SACAI in the
form of a concession letter). I will ensure that this assessment is completed in
my own handwriting and that I have not used any stylus to assist in writing this
paper

Add your name here


_________________________
Student signature

Please turn over 2


LEARNING OUTCOME​

●​ Apply all practical concepts learnt in Terms 1 and 2 in an examination


setting.

INSTRUCTIONS

1.​ The front page of your answer sheet must include:


a.​ Your name
b.​ Your student number
c.​ The signed plagiarism declaration
2.​ This EXAM comprises FOUR main questions. You must extract the data
files provided and code in the files as outlined below:

QUESTION 1: QUESTION 2: QUESTION 3: QUESTION 4:


frmQuestion1_P.dpr frmQuestion2_P.dpr frmQuestion3_P.dpr frmQuestion4_P.dpr
frmQuestion1_U.dfm frmQuestion2_U.dfm frmQuestion3_U.dfm frmQuestion4_U.dfm
frmQuestion1_U.pas frmQuestion2_U.pas frmQuestion3_U.pas frmQuestion4_U.pas
frmQuestion1_U.res frmQuestion2_U.res frmQuestion3_U.res frmQuestion4_U.res​
CoolApp.jpg Apps.mdb clsAppStore_u.pas
AppsBackup.mdb

3.​ Attempt to answer all the questions.


4.​ The maximum mark for this exam is 150 marks.
5.​ You have 180 minutes to complete this exam.
6.​ Attempt to answer all the questions.
7.​ Save your work at regular intervals as a precaution against possible power
failures. Answer all questions in the data files provided.
8.​ Make sure you answer the questions according to the specifications given
in each question. Marks will be awarded according to the set
requirements.
9.​ Answer only what is asked in each question. For example, if the question
does not ask for data validation, then no marks will be awarded for the
data validation.
10.​Your programs must be coded in such a way that they will work with any
data and not just the sample data supplied or any data extracts that

Please turn over 3


appear in the question paper.
11.​ Routines such as search, sort and selection must be developed from first
principles. You may NOT use the built-in features of Delphi for any of
these routines.
12.​ All data structures must be defined by you, the programmer, unless the
data structures are supplied.
13.​ You will receive data files as outlined above with this question paper:
a.​ Make sure your data is extracted (unzip your folder)
b.​ “Save As” all documents and add your name to the file at the end.
14.​ You must upload your answer files as a compressed (zipped) folder in .zip
format. DO NOT use WinRAR to compress your folder.

a. ​ Right-click on your completed test folder


b. ​ Click on “Send to”
c. ​ Choose “Compressed (zipped) folder​

Please turn over 4


QUESTION 1: GENERAL PROGRAMMING SKILLS

Scenario: An app interface has been created that needs to be completed. The
app will do a variety of tasks like determine if a year is a leap year, calculate
the volume of a cone, provide a word game and determine the waiting time for
lives for a game.

Do the following:

● Open the incomplete program in the folder Question1.


● Enter your name and surname as a comment in the first line of the
frmQuestion1_U.pas file.
● Compile and execute the program. The user interface displays THREE tab
sheets.
● Follow the instructions below to complete the code for EACH section of
QUESTION 1, as described in QUESTION 1.1 to QUESTION 1.3.

Example of the graphical user interface (GUI):

Figure 1: Example of the GUI.

Please turn over 5


Question 1.1 [13 marks]

Tab sheet [Home]:


Button [Home Page]

Write code to do the following:

●​ Store the input from the user from the DateTimePicker.


●​ Extract the year from the date selected.
●​ Determine and display in the label lblOutput, whether the extracted year
is a leap year or not.
●​ Change the label lblOutput as follows:
○​ Change the font to 'Chiller'.
○​ Set the text size to 20.
○​ Display the text in bold.
●​ Load the picture provided in the Question 1 folder named CoolApp.jpg
into imgApp.

Example of output for the date 2022/03/11:

Figure 2: Example of output.

Please turn over 6


Question 1.2 [8 marks]

Tab sheet [Volume]:


Button [Volume]

The app needs to calculate the volume of a cone using input from the user.

Write code to do the following:

●​ Test whether the user has entered a value in edtHeight. If they have not,
change the colour of the edit edtHeight to yellow, place the cursor in
edtHeight and ensure that the rest of the code will not execute.
●​ Store the input from the user for the height and radius of the cone as
entered in the edit and SpinEdit.
●​ Calculate the volume of the cone by making use of the following formula:​

Figure 3: Calculation for the cone.

● ​ Display the volume in edtDisplay.

Example of output when 3.5 as the height and 2 as the radius were
entered:

​ ​ ​ ​ Figure 4: Example of output.

Please turn over 7


Question 1.3 [14 marks]

Tab sheet [App Lives]:


Button [Waiting Time]

The user wants to play a game app where one needs "lives" to continue playing
the game. Initially, the waiting period for a new life is 45 seconds. During the
game, the waiting period increases for each new life needed. Help the user
determine how many lives they will get for the time they are willing to wait.

Code has been provided to display the heading in the RichEdit.​


The value of 45 has been assigned to the variable iSeconds for the first
45-second waiting period.

Write code to:

●​ Make use of an InputBox to store input from the user for the total
number of seconds they are prepared to wait for lives.
●​ Starting from 45 seconds, each new life’s waiting time increases by 7.5% of
the previous number of seconds. This increase is rounded down to the
closest integer number of seconds before being added to the previous
time.
●​ Continue to display each life number that the user will receive, the waiting
period for each life and the total waiting period so far until the maximum
waiting time has been reached. Ensure that you calculate and display only
the number of lives less than or equal to the time the user entered.
●​ Calculate and display the number of actual minutes and seconds the user
waited in total.

Example of output when 200 seconds were entered:


Figure 5: Example of output.

Please turn over 8


●​ Enter your Name and Surname as a comment in the first line of the
program file frmQuestion1_U.
●​ Save all the files ('File/Save All').

​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ TOTAL: 35

QUESTION 2: SQL and DATABASE PROGRAMMING

SCENARIO: A database of apps and the companies that own them have been
supplied with an incomplete program. The program must allow the user to
search for data about companies and apps and manipulate the data.

The data pages attached at the end of the question paper provide
information on the design of the database and its contents.

Do the following:

●​ Open the incomplete project file frmQuestion2_P.dpr in the folder


Question2.
●​ Enter your name and surname as a comment on the first line of the
frmQuestion2_U.pas file.
●​ The Restore database button is provided to restore the data contained in
the database to the original content.
●​ Follow the instructions that follow to complete the code for each question
as described below.
●​ Do not change any of the provided code.
●​ The database has been linked to the GUI components for you.
●​ TWO variables are declared as public variables, as described in the table
below.

Variable Data type Description


tblCompanies TADOTable Refers to the table
tblCompanies
tblApps TADOTable Refers to the table tblApps

Please turn over 9


Question 2.1

Tab sheet
[Question 2.1 – SQL]

Example of the graphical user interface (GUI) for QUESTION 2.1:

Figure 6: Example of the GUI.

NOTE: Code to execute the SQL statements and display the results of the
queries is provided. Use ONLY SQL code to complete the SQL statements for
QUESTION 2.1.1 to QUESTION 2.1.5 to follow:

Question 2.1.1 [3 marks]


Button [Sort]

Display all fields from tblApps, sorted by Category (ascending) and Rating
(descending).

An extract of the output:

​ ​ ​ Figure 7: An extract of output.

Please turn over 10


Question 2.1.2 [4 marks]
Button [1994]

Display Company, Email, and Founded from tblCompanies where Email is null
and Founded = 1994.

Example of output:

​ ​ ​ ​ Figure 8: Example of output.

NOTE: The date format is not important to match. ​

Question 2.1.3 [4 marks]


Button [Salaries]

The average salary for an employee is R 30 000 per month. Calculate and display
the amount a company would have to spend on salaries in a month for their
number of employees. Display the company name of only those companies
whose names start with the letter 'P' and the calculated salary field. Use the field
heading Salaries to display the calculated amount, formatted as currency.

Example of output:

Figure 9: Example of output.

Question 2.1.4 [6 marks]


Button [Ratings]

Code has been provided to store an app category from the ComboBox
cmbCategory.​

Display the company name and its highest app rating for the category selected.
Display the highest app rating in a field HighestRating.​

Please turn over 11



Example of output when Games were selected:

Figure 10: Example of output.

Question 2.1.5 [4 marks]


Button [Change]

Write code to add 1 000 more employees to the company ‘Yamia’.


NOTE: Code has been provided to display a message and the output in the
DBGrid.

An extract of output:

Figure 11: Example of output.

Question 2.2
Tab sheet [Question 2.2 – Database programming]

Example of the graphical user interface (GUI) for QUESTION 2.2:

Please turn over 12


Figure 12: GUI example.

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.

Question 2.2.1 [12 marks]


Button [Apps]

Write code to count and display the apps each company owns underneath the
company name as a heading.

An extract of the output:

Figure 13: Example of output.

Please turn over 13


Question 2.2.2 [3 marks]
Button [E-mail]

Select a company from the tblCompanies table in the dbGrid that does not have
an email address. Write code to add the e-mail address' ‘[email protected]’ to the
Email field for the company selected in the dbGrid.

An extract of the output when Yamia was selected in the dbGrid:

Figure 14: Example of output.

Question 2.2.3 [4 marks]


Button [New app]

Code has been provided to assign the name and category of a new app to
variables.

Write code to add the new app to tblApps by doing the following:

● Assign the CompanyID from the company currently selected in the dbGrid
for the companies table, as the CompanyID of the new app.
● Assign the provided variables for the name and category to the
corresponding app fields.
● The app is free. Assign the correct value to the Free field for this new app.

An extract of output when the company Thoughtsphere was selected in the


tblCompanies dbGrid:

Figure 15: Example of output.

Please turn over 14


●​ Enter your Name and Surname as a comment in the first line of the
program file frmQuestion2_u.
●​ Save all the files ('File/Save All').

TOTAL: 40

QUESTION 3: OBJECT-ORIENTED PROGRAMMING

Scenario: A user needs to register an account with an app store by entering a


username and credit card details. The program must ensure that the credit
card is valid and from a recognised issuer before allowing the user to add
funds to their app store account.

Do the following:

● Open the incomplete program in the folder Question3.


● Enter your name and surname as a comment on the first line of the
frmQuestion3_U.pas file.

Example of the graphical user interface (GUI):

Figure 16: Example of output.

Please turn over 15


Complete the code as specified in QUESTION 3.1 for the clsAppStore_u.pas
object class and in QUESTION 3.2. for the frmQuestion3_u.pas form class.

NOTE: For this question, you are NOT allowed to include any additional
attributes or user-defined methods (unless explicitly stated in the question).

Question 3.1

The incomplete object class (TStore) provided contains code for the declaration
of four attributes that describe an AppStore object.

The attributes for an AppStore object have been declared as follows:

Attribute Description
fUsername The account username chosen by the user
fCreditcard The user’s credit card number
fExpiryDate The credit card’s expiry date
fAmount Amount of credit available in the store account

Question 3.1.1 [4 marks]

Write code for a constructor create method that will receive the username,
credit card number and the credit card’s expiry date as parameter values. Assign
these values to the respective attributes. Set the fAmount attribute to the value
of zero. ​ ​

Question 3.1.2 [13 marks]

Create a method DetermineIssuer to validate the credit card number and


expiry date.

The credit card is valid if the expiry date is after the current date and the credit
card number consists of 16 digits. The provider who issued the card can be
returned if the card is valid, otherwise, the provider name is returned as “Invalid”

The method must determine and return the name of the card issuer as
described below:
●​ A valid card:
○​ Has an expiry date after today's date.
○​ Contains 16 digits.
●​ If the card is valid, then return the name of the card issuer as follows:

Please turn over 16


Issuer The credit card number…
MasterCard Starts with a 3 followed by a 0, 6 or 8

VISA Starts with a 4


American Express Starts with a 3 followed by a 4 or a 7

●​ If the card is not valid, return “Invalid”. ​

Question 3.1.3 [2 marks]

Create an accessor method GetAmount, to return the store credit amount.

Question 3.1.4 [4 marks]

Create a mutator method, SetAmount, to receive an amount and add it to the


store credit amount in fAmount.

Question 3.1.5 [4 marks]

Complete the given ToString method to return a string with the attributes in the
following format as described below:

App Store account details:


Username: <Username>
Your store account has an amount of: <Amount of store credit>

Example of output on the form:

Figure 17: Example of output.

Question 3.2

The incomplete unit frmQuestion3_u provided contains code for the object
class to be accessible and the declaration of an object variable objAppStore.

Please turn over 17


Question 3.2.1 [5 marks]
Button [Register]

The user must enter a username in the edit box edtUsername, the credit card
number in the edit box edtCard and select the card expiry date from the
datetimepicker dtpExpiry.

Write code to do the following:

● Extract the username, credit card number and expiry date from the relevant
components.
● Use the extracted values to instantiate a new objAppStore object. ​
● Display an appropriate message to indicate that the object has been
instantiated.

Example of output:

​ Figure 18: Example of output.

Question 3.2.2 [3 marks]


Button [Display]

● Write code to use the ToString method to display the object's information in
the redOutput component
● Use the DetermineIssuer method to display the name of the credit card
issuer in the lblIssuer label.

Example of output with expiry date of 2022/12/31 and credit card number of 16
digits, starting with 36: 3689425590677133

Figure 19: Example of output.

Please turn over 18


Example of output with expiry date of 2022/12/31 and credit card number of 15
digits: 308942559067713

Figure 20: Example of output.

Example of output with expiry date of 2022/01/01 and credit card number of 16
digits: 3089425590677133

Figure 21: Example of output.

Example of output with expiry date of 2022/12/31 and credit card number of 16
digits, starting with 37: 3789425590677133

Figure 22: Example of output.

Question 3.2.3 [5 marks]


Button [Add to account]

The user is able to add credit to their app store account by entering a voucher
amount.

Write code to do the following:

●​ Extract the amount entered in edtVoucher.

Please turn over 19


●​ Use the SetAmount method to increase the amount available by the
value entered in edtVoucher. Use GetAmount to display the updated
amount in the label lblAmount.

Example of output:

Figure 23: Example of output.

●​ Enter your Name and Surname as a comment in the first line of the
units clsAppStore_u and frmQuestion3_u.
●​ Save all the files ('File/Save All').

TOTAL: 40

QUESTION 4: PROBLEM-SOLVING PROGRAMMING

Scenario: Your smartphone monitors how much time you spend staring at
your screen, and which apps you use the most. This is referred to as
monitoring your screen time.
You have been provided with an incomplete program that simulates a screen
time app by giving the number of hours spent using various categories of apps
in one week.

Do the following:

● Open the incomplete program frmQuestion4_P.dpr in the folder


Question4.
● Enter your name and surname as a comment on the first line of the
frmQuestion4_U.pas file.
● The program has no functionality currently.

Please turn over 20


Example of the graphical user interface (GUI):​

Figure 24: Example of output.

The program contains the declarations of three arrays called arrCategories,


arrTime and arr2Screentime.

●​ arrCategories has been assigned the names of five app categories:



arrCategories: array[1..5] of string = ('Entertainment', 'Games', 'Lifestyle',
'Social Media', 'Travel');

●​ arrTime: array[1..5] of Integer, an array parallel to arrCategories that will


store the total number of hours spent using each category of app for the
week.
●​ The number of hours spent using each app for each day of the week,
Sunday to Saturday, are stored in a two-dimensional array named
arr2Screentime in hours:

NOTE: Do not change the code provided.​

Complete the code as described in QUESTION 4.1 to QUESTION 4.3 that follows:

Please turn over 21


Question 4.1 [9 marks]
Button [Display]

Write code to display the arrays in the stringgrid stgOutput as follows:

●​ Display the abbreviations of the names of the days of the week, from
Sunday to Saturday, as column headings in stgOutput.
●​ Display the app categories in arrCategories as row headings in
stgOutput.
●​ Display the contents of the two-dimensional array arr2Screentime under
the correct headings in the StringGrid.

Example of output:

Figure 25: Example of output.

Question 4.2 [17 marks]


Button [Summary]

A summary needs to be generated that calculates how many hours in total have
been spent using each category of apps for the week and determines and
displays the category with the highest usage.

Calculate and display, in redQ4, the total number of hours’ usage for each app
category for the entire week in neat columns. Store these totals in the parallel
array arrTime.

Determine and display the app category with the highest number of hours for
the week.

Example of output:

Please turn over 22


Figure 26: Example of output.

Question 4.3 [9 marks]


Button [Save]

The screen time summary for the week needs to be written to a text file.

Write code to do the following:

●​ If the file Screen.txt exists, add to the end of the text file. If it does not
exist, create the text file using code.
●​ Add each category and its total number of hours for the week, stored in
arrTime, to the text file in the following format:

< category>@<hours>

An example of the text file contents after the Summary and then the Save
button has been clicked.

Figure 27: Example of text file output.

●​ Enter your Name and Surname as a comment in the first line of the
unit frmQuestion4_u.
●​ Save all the files ('File/Save All').

TOTAL: 35
GRAND TOTAL: 150
EXAM END

23

You might also like