INFORMATION TECHNOLOGY PAPER 1
GRADE 12
NATIONAL SENIOR CERTIFICATE EXAMINATIONS
MAY/JUNE 2021
INSTRUCTIONS AND INFORMATION
NOTE: Candidates must use the file DataENGJune2021.exe.
Do the following:
Once extracted, the following list of files will be available in the folder DataENGJune2021:
FILES PROVIDED:
Question 1:
Question1_P.dpr
Question1_P.dproj
Question1_P.res
Question1_U.dfm
Question1_U.pas
Question 2:
ConnectDB_U.pas
Question2_P.dpr
Question2_P.dproj
Question2_P.res
Question2_U.dfm
Question2_U.pas
ShoppingMallDB - Copy.mdb
ShoppingMallDB.mdb
Question 3:
GiftVoucher_U.pas
Question3_P.dpr
Question3_P.dproj
Question3_P.res
Question3_U.dfm
Question3_U.pas
Question 4:
Barbedos.txt
Kensley.txt
Maistry.txt
Question4_P.dpr
Question4_P.dproj
Question4_P.res
Question4_U.dfm
Question4_U.pas
SECTION A
QUESTION 1: GENERAL PROGRAMMING SKILLS
Do the following:
1.1 Button [1.1 - Calculate thickness of slices] The length of a loaf of bread is 242 mm. The user is required to select/enter the number of the slices of bread required using the spin edit component. The program must calculate the thickness of the slices.
Write code to do the following:
1.2 Button [1.2 - Calculate change] The cost of a loaf of bread is R12.90. The change needs to be calculated for an amount that is offered to buy a loaf of bread. Write code to do the following:
1.3 Button [1.3 - Multiples of 10] Write the code to do the following:
1.4 Button [1.4 - Hidden security code] Two variables, sParagraph and sSecurityCode, have been declared in the code. A paragraph of text, which contains a security code, has been assigned to the variable sParagraph. Rules need to be followed to extract specific characters from the text in the sParagraph variable to compile a security code which must be saved in the provided variable sSecurityCode. The following rules must be applied to compile the security code:
Write code to compile the security code using a loop structure and by applying the specified rules.
NOTE: Your code must output the correct security code for any text assigned to the sParagraph variable.
Example of output if the following text is allocated to sParagraph:
sParagraph = 'I am not lazy, I am just very relaxed. He who laughs last did not get the joke. When nothing is going right, go left. I love school when it is vacation. I put the "Pro" in procrastinate.'
Example of output if the following text is allocated to sParagraph:
sParagraph = 'My Grade 12 year is always going to be my greatest as it provides me with the most opportunities.' (12)
TOTAL SECTION A: 40
SECTION B
QUESTION 2: SQL AND DATABASE
The database ShoppingMallDB contains information on different types of shops in a shopping mall and the details of the managers of the shops. The database contains two tables, namely tblShops and tblManagers. Each manager is in charge of a specific type of shop, e.g. Emily Farez is in charge of all clothing shops.
The data pages attached at the end of the question paper provide information on the design of the database and the content of the tables.
Do the following:
NOTE:
TWO variables are declared as public variables, as described in the table on the next page.
Variable | Data type | Description |
tblShops | TADOTable | Refers to the table tblShops |
tblManagers | TADOTable | Refers to the table tblManagers |
2.1 Tab sheet [Question 2.1 - SQL]
Example of graphical user interface (GUI) for QUESTION 2.1:
NOTE:
2.1.1 Button [2.1.1 - List of shops]
Display ALL fields of the shops in the tblShops table, sorted from the largest to the smallest shop according to the ShopSize field.
Example of output of the first four records: (3)
2.1.2 Button [2.1.2 - Manager number]
The user must select a manager number from the combo box cmbQ2_1_2. Code has been provided to assign the manager number selected by the user to a variable sManagerNum. Display the ShopName of all the shops managed by the manager associated with the selected manager number.
Example of output if manager number 1 is selected: (3)
2.1.3 Button [2.1.3 - Rental > R50 000]
The rental cost of space in the mall is R65.00 per square metre. Use the ShopSize field, which is in square metres, to calculate the rental costs for each shop. Use the new field named Rental to keep the rent amounts.
Display the shop name, shop size and calculated rental amount of all shops with rental amounts that exceed the value of R50 000. The rental amount must be formatted as currency.
Example of output: (5)
2.1.4 Button [2.1.4 - Turnover per manager]
The total turnover is calculated by adding the values in the Turnover field. The total turnover must be calculated per manager.
Display the ManagerName, ManagerSurname and the calculated field called TotalTurnover for EACH manager.
Example of output: (6)
2.1.5 Button [2.1.5 - Update shop name]
The clothing shop, Jeans 4U, has moved to another shopping mall. A new clothing store with the name TeenDream opened in its place. Modify the relevant record by changing the shop name Jeans 4U to TeenDream.
Example of output: (3)
2.2 Tab sheet [Question 2.2 - Delphi code]
Example of graphical user interface (GUI) for QUESTION 2.2:
NOTE:
2.2.1 Button [2.2.1 - Number of small shops]
A shop is classified as a small shop if the size of the shop is less than 300 square metres.
Write code to count and display the number of small shops in the rich edit component redQ2_2_1.
Example of output: (7)
2.2.2 Button [2.2.2 - Display manager]
Information on the manager of a shop must be displayed on request. Code has been provided to enter the name of a shop using an input box.
Write code to do the following:
Example of output if the name of the shop 'Little Kitchen Grocery Store' was entered and found:
Example of output if the name of the shop that was entered was not found: (13)
Ensure that your examination number has been entered as a comment in the first line of the program file.
TOTAL SECTION B: 40
SECTION C
QUESTION 3: OBJECT-ORIENTATED PROGRAMMING
The MidCity Shopping Centre sells gift vouchers that can be used at any shop in the shopping centre. The minimum amount available per gift voucher card is R50 and the maximum amount available is R300.
Do the following:
Example of the graphical user interface (GUI):
Complete the code as specified in QUESTION 3.1 and QUESTION 3.2.
NOTE: For this question, you are NOT allowed to include any additional attributes or user-defined methods not stated in the question.
3.1 The provided incomplete object class (TGiftVoucher) contains code for the declaration of three attributes that describe a GiftVoucher object.
The attributes for a GiftVoucher object have been declared as follows:
Code has been provided for an incomplete toString method.
Complete the code in the object class as described in QUESTION 3.1.1 to QUESTION 3.1.5.
3.1.1 Write code for a constructor method that will receive the gift voucher number, the name of the customer and the balance (amount available on gift voucher) as parameter values. Assign these values to the respective attributes. (4)
3.1.2 Write code for two accessor methods called getVoucherNumber and getBalance for the fVoucherNumber and fBalance attributes respectively. (4)
3.1.3 Write code for a method called isSufficient to receive a real value for a purchase amount and return a Boolean value TRUE if the balance on the gift voucher is sufficient to pay the purchase amount, or FALSE if not. (5)
3.1.4 Write code for a method called updateBalance that will receive a purchase amount as a parameter and subtract the purchase amount from the balance. (3)
3.1.5 Write code to complete the toString method to return a string in the following format:
Voucher number: <fVoucherNumber>
Customer name: <fName>
Available balance: <fBalance>
Example:
Voucher number: 3029
Customer name: Joe Smith
Available balance: R250.00 (4)
3.2 An incomplete program has been supplied in the Question 3 folder. The program contains code for the object class to be accessible and declares an object variable called objGiftVoucher.
Write code to perform the tasks described in QUESTION 3.2.1 and QUESTION 3.2.2 to purchase and use a gift voucher. The GUI contains two separate tab sheets for QUESTION 3.2.1 and QUESTION 3.2.2 respectively.
3.2.1 Tab sheet Q3.2.1 - Purchase gift voucher
Button [Purchase]
The user must enter a voucher number in the edit box edtQ3_VoucherNum, enter the name of the customer in the edit box edtQ3_2_1 and select an amount to be loaded onto the gift voucher from the combo box cmbQ3_2_1. Write code to do the following:
3.2.2 Tab sheet Q3.2.2 - Use gift voucher
Example of output if the purchase amount is less than the balance on the gift voucher:
Before the transaction:
After the gift voucher has been used:
Example of output if the purchase amount is equal to the balance on the gift voucher:
Before the transaction:
After the gift voucher has been used:
Example of output if the purchase amount is more than the balance on the gift voucher:
Before the transaction:
After the gift voucher has been used: (9)
Ensure that your examination number has been entered as a comment in the first line of the object class and the form class.
TOTAL SECTION C: 40
SECTION D
QUESTION 4: PROBLEM-SOLVING PROGRAMMING
Three new malls have been built recently. Each mall has a ground floor that has demo shops to showcase the types of shops on the different levels at the mall. For example, if the ground floor has a clothing store, a restaurant and a furniture store, then the other levels in the mall can only have the types of shops as showcased on the ground floor.
Do the following:
Example of the graphical user interface (GUI):
The following have been provided in the program:
Each character in a line of text represents a type of shop (the first letter of the given list of shop types in array arrShopTypes) that can be found on that specific level in the mall. For example, the letter E refers to Electronics, J refers to Jewellery and so on. The characters used are E, J, F, C, R, T, L and G.
The second line of text in the text file for the Kensley Mall contains the following line of text, 'JCFERECFLE', which indicates that there are 10 shops on level 2 of the mall – one jewellery shop (J), two clothing shops (C), two furniture shops (F), three electronics shops (E), one restaurant (R) and one laundry (L).
Write code to perform the tasks described in QUESTION 4.1 to QUESTION 4.2.
4.1 Button [4.1 - Populate and display array]
The user must select a mall from the radio group rgpQ4.
Write code to do the following:
4.2 Button [4.2 – Count shop type per level]
An enquiry about the number of shops of a specific type per level in the mall must be processed and displayed. The user must enter a character representing the type of shop using an input box.
Show an error message if the input character is not in the range of valid characters, namely E, J, F, C, R, T, L and G.
If a valid character is entered, the number of the specified type of shop in the selected mall must be determined per level and neatly displayed, as shown in the examples below. The heading of the output must display the description of the type of shop in the arrShopTypes array.
Example of output if the Kensley Mall was selected and F was selected as the shop type:
Example of output if the Barbedos Mall was entered and C was selected as the shop type: (15)
TOTAL SECTION D:30
GRAND TOTAL:150
INFORMATION TECHNOLOGY P1
DATABASE INFORMATION QUESTION 2:
The design of the database tables is as follows:
Table: tblManagers
The table contains the records of the managers who manage each court in the shopping mall.
Field name | Data type | Description |
ManagerNumber (PK) | Byte | A unique number assigned to each manager |
ManagerName | Text (30) | The name of the manager |
ManagerSurname | Text (30) | The surname of the manager |
ContactNumber | Text (10) | The contact number of the manager |
Example of the first five records of the tblManagers table:
Table: tblShops
The table contains the information of the shops located in the shopping mall.
Field name | Data type | Description |
ShopNumber (PK) | Number | A unique number assigned to each shop |
ShopName | Text (50) | The name of the shop |
ShopSize | Number | The size of the shop |
TurnOver | Currency | The turnover of the shop |
ManagerNumber (FK) | Byte | A number that identifies the manager of a shop |
Example of the first ten records in the tblShops table:
NOTE:
The following one-to-many relationship with referential integrity exists between the two tables in the database: