G12 ITterm 2 Mid Year Exam Question Paper Paper 1
G12 ITterm 2 Mid Year Exam Question Paper Paper 1
1:
Examination Paper 1
Term 2
INFORMATION TECHNOLOGY
GRADE 12
DURATION: 3 hours
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
INSTRUCTIONS
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:
The app needs to calculate the volume of a cone using input from the user.
● 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:
Example of output when 3.5 as the height and 2 as the radius were
entered:
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.
● 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.
Figure 5: Example of output.
TOTAL: 35
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:
Tab sheet
[Question 2.1 – SQL]
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:
Display all fields from tblApps, sorted by Category (ascending) and Rating
(descending).
Display Company, Email, and Founded from tblCompanies where Email is null
and Founded = 1994.
Example of output:
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:
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.
An extract of output:
Question 2.2
Tab sheet [Question 2.2 – Database programming]
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.
Write code to count and display the apps each company owns underneath the
company name as a heading.
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.
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.
TOTAL: 40
Do the following:
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.
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
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.
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:
Complete the given ToString method to return a string with the attributes in the
following format as described below:
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.
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.
● 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:
● 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
Example of output with expiry date of 2022/01/01 and credit card number of 16
digits: 3089425590677133
Example of output with expiry date of 2022/12/31 and credit card number of 16
digits, starting with 37: 3789425590677133
The user is able to add credit to their app store account by entering a voucher
amount.
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
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:
Complete the code as described in QUESTION 4.1 to QUESTION 4.3 that 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:
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:
The screen time summary for the week needs to be written to a text file.
● 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.
● 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