Skip to content

Information Technology Grade 12 P2 GAU Prelim 2020 QP

Question paperInformation TechnologyGrade 12202024 pages

Grade 12 Information Technology Paper 2 question paper from the GAU Prelim 2020, 24 pages. Read online or get the free PDF download, memo linked when available.

Free to read online, no sign-up needed

Answer online

Loading document…

Loading document…

Questions in this paper

Document textSearch extracted text and jump to a page.
Downloaded from hlayiso.com PRELIMINARY EXAMINATION GRADE 12 INFORMATION TECHNOLOGY P1 16 SEPTEMBER 2020 MARKS: 150 TIME: 3 hours This question paper consists of 22 pages and 2 data pages.
Downloaded from hlayiso.com Information Technology/P1 2 Preliminary Examination 2020 INSTRUCTIONS AND INFORMATION 1. This question paper is divided into FOUR sections. Candidates must answer ALL the questions in ALL FOUR sections. 2. The duration of this examination is three hours. Because of the nature of this examination it is important to note that you will not be permitted to leave the examination room before the end of the examination session. 3. This question paper is set with programming terms that are specific to the Delphi programming language. 4. Ensure that you answer the questions according to the specifications that are given in each question. Marks will be awarded according to the set requirements. 5. 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 data validation. 6. 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 appear in the question paper. 7. 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. 8. All data structures must be defined by you, the programmer, unless the data structures are supplied. 9. You must save your work regularly on the CD/DVD/flash disk you have been given, or on the disk space allocated to you for this examination session. 10. Make sure that your name and surname appears as a comment in every program that you code, as well as on every event indicated. 11. If required, print the programming code of all the programs/classes that you completed. You will be given half an hour printing time after the examination session. 12. At the end of this examination session you must hand in a CD/DVD/ flash disk with all your work saved on it OR you must make sure that all your work has been saved on the disk space allocated to you for this examination session. Ensure that all files can be read. Please turn over
Downloaded from hlayiso.com Information Technology/P1 3 Preliminary Examination 2020 13. The files that you need to complete this question paper have been given to you on the CD/DVD/flash disk or on the disk space allocated to you. The files are provided in the form of password-protected executable files NOTE: Candidates must use the file DataSept2020.exe. Do the following: • Double click on the password-protected executable file. • Click on the extract button. • Enter the following password: S@nb!2020Plants Once extracted, the following list of files will be available in the folder DataSept2020: SUPPLIED FILES: Question1: Question3: Question1_p.dpr Question3_p.dpr Question1_p.dproj Question3_p.dproj Question1_p.res Question3_p.res Question1_u.dfm Question3_u.dfm Question1_u.pas Question3_u.pas Free State.jpg clsPlant_u.pas Walter Sisulu.jpg Kirstenbosch.jpg Question4: Pretoria.jpg Question4_p.dpr Hantam.jpg Question4_p.dproj Harold Porter.jpg Question4_p.res Question4_u.dfm Question2: Question4_u.pas ConnectDB_U.dcu Planted.txt NiceNursery.mdb NiceNursery_Backup.mdb Question2_p.dpr Question2_p.dproj Question2_p.res Question2_u.dfm Question2_u.pas Please turn over
Downloaded from hlayiso.com Information Technology/P1 4 Preliminary Examination 2020 SECTION A QUESTION 1: GENERAL PROGRAMMING SKILLS SCENARIO: The South African National Biodiversity Institute (SANBI) contributes to South Africa’s sustainable development by facilitating access to biodiversity data, generating information and knowledge, and showcasing and conserving biodiversity in its national botanical and zoological gardens. You have been asked to assist them in finishing some apps they are developing. Do the following: ● Open the incomplete Question1_p.dpr program in the folder Question 1. ● Enter your name and surname as a comment on the first line of the Question1_u.pas file. ● Compile and execute the program. The program currently has no functionality. The following GUI is displayed: ● Follow the instructions below to complete the code for EACH section of QUESTION 1, as described in QUESTION 1.1. to QUESTION 1.4. 1. X Please turn over
Downloaded from hlayiso.com Information Technology/P1 5 Preliminary Examination 2020 1.1. Button [Question 1.1] Write code to do the following: • Change the font of the form to Arial. • Extract a user entered name from a dialog box with the same prompt screen as shown below. • Display the following message in the caption of the form: <Name> is coming to visit! Example of output: (6) 1.2. Combobox [cbbGardensChange] There is a SANBI network of National Botanical and Zoological Gardens that visitors can visit. ● Load the picture of the garden that the user selected in the cbbGardens combobox, into the imgGardens image component. ● The entire picture must be visible in the image component. NOTE: The images are saved in the same folder as the program, with the same name as the garden in the cbbGardens combobox. Example of output when Kirstenbosch is the chosen garden: (4) Please turn over
Downloaded from hlayiso.com Information Technology/P1 6 Preliminary Examination 2020 1.3. Question 1.3 1.3.1. Button [Question 1.3.1] Write code to do the following: ● Extract the date of the visit (edtDate) as a string-datatype and the number of besoekers (sedNumberOfVisitors) to visit a park. ● Display a suitable error message if nothing is entered in the edtDate edit box. Set the mouse marker to the edit box and stop the rest of the code from being executed. NOTE: Do NOT use the exit statement. ● Calculate and display the entrance fee if the cost for one entry is R55.00. Example of output: (8) 1.3.2. Button [Question 1.3.2] Write code to do the following: ● If the user indicated that there are pensioners in the group, the lblOutput label must be made visible. ● Display a message on the lblOutput that the entrance to the garden is free if there are pensioners in the group AND the number of visitors is a perfect square. Please turn over
Downloaded from hlayiso.com Information Technology/P1 7 Preliminary Examination 2020 Examples of output: (6) 1.4. Button [Question 1.4] Plant-labels in botanical gardens traditionally been limited to displaying only the scientific name, family name, common names and distribution. Write code to do the following: Generate six unique codes according to the following requirements: ● Each code must be generated with a random number of characters (no more than 8) from the following provided set of characters: o A, E, I, O, U, o a hash (#) o numbers 0, 1, 2, 3 or 4. ● A character may only appear once in a single code ● If the random number of characters in the code is less than 8, add stars (*) at the beginning of each code to ensure that all codes consist of eight characters Please turn over
Downloaded from hlayiso.com Information Technology/P1 8 Preliminary Examination 2020 Examples of output (NOTE: your output will be different from the examples due to the use of the random-function): (11) • Ensure that your name and surname has been entered as a comment in the first line of the unit. • Save your program. • Print the code if required. TOTAL SECTION A: 35 Please turn over
Downloaded from hlayiso.com Information Technology/P1 9 Preliminary Examination 2020 SECTION B QUESTION 2: DATABASE PROGRAMMING Some botanical gardens have a nursery selling plants and trees to generate an income to support garden maintenance costs. NiceNursery.mdb is a database that contains information about the customers of the nursery, information about the plants and trees that are for sale and also a record of past orders. The data pages attached at the end of this question paper provide information on the design of the database and the content of the tables. Do the following: ● Open the incomplete Question2_p.dpr program in the folder Question 2. ● Enter your name and surname as a comment on the first line of the Question2_u.pas file. ● Compile and execute the program. The program currently has limited functionality. ● Complete the code for each question as described in QUESTION 2.1 and QUESTION 2.2. NOTE: ● Code to connect with the Access database has been provided – do not change any given code. ● Question 2.2 will make use of the ADOTables tblCustomers and tblOrders. ● You can click the Restore button once to restore the database to its original state. 2.1. Tab sheet [Q2.1 – SQL] Complete the SQL code to meet the requirements specified in QUESTION 2.1.1 to QUESTION 2.1.4. NOTE: Insert your SQL instruction in the provided code between the ‘ ‘. Code has been provided to execute the SQL instruction. You may copy the field names included in the code in comments to avoid spelling mistakes. Please turn over
Downloaded from hlayiso.com Information Technology/P1 10 Preliminary Examination 2020 2.1.1. Button [2.1.1 – Customer list] Display all the data of Customers in the tblCustomers table sorted according to the Registered date. Example of the output of the first few records: (3) 2.1.2. Button [2.1.2 – Customers since 2010] Display the customer surname and name from tblCustomers for customers registered since 2010. Example of the output for first few records: (3) 2.1.3. Button [2.1.3 – Customer request] Display the common name, price and stock quantity of all plants/trees available at the nursery that could be planted in a semi-shaded area that will not grow higher than 1 meter. NOTE: that the Height field in tblPlants stores values in cm. Please turn over
Downloaded from hlayiso.com Information Technology/P1 11 Preliminary Examination 2020 Example of the output for first few records: (6) 2.1.4. Button [2.1.4 – Insurance Estimation] The selling price of plants is stored in the Price-field of tblPlants. There is a 15% mark-up from the cost price of plants to the selling price, which is stored in the table. For insurance purposes, calculate and display an estimated value it would cost to replace all the plants in the nursery, based on the cost price. Display the total estimated stock replacement value by plant family of all the plants in the nursery, as currency, with an appropriate caption. Example of the output for first few records: (6) Please turn over
Downloaded from hlayiso.com Information Technology/P1 12 Preliminary Examination 2020 2.2. DATABASE MANIPULATION Select tab sheet Q2.2 ADOTables, which displays the following GUI: NOTES: • The use of the filter, sort and locate methods will not earn any marks. Write all code from first principles. • NO marks will be allocated for the use of SQL statements in QUESTION 2.2. • The names of the tables to be used in your code are tblOrders, tblCustomers and tblPlants. This section simulates the online ordering process for customers who have accounts at Nice Nursery. Complete the code to meet the requirements specified in QUESTION 2.2.1 to QUESTION 2.2.4. Please turn over
Downloaded from hlayiso.com Information Technology/P1 13 Preliminary Examination 2020 2.2.1. Populate the Combobox Write code to add all the Usernames and CustID in tblCustomers to the combobox called cmbCustomers. NOTE: • Clear the items in the combobox. • The combobox must be populated once the tab sheet for Q2.2 is displayed. • Display the text 'Select your username' in the combobox. • The format of the items added must be <Username> (<CustID>). NOTE: If you were unable to populate the combobox, comment the code that does not work and use the value in the constant that has been supplied in the unit, for your input instead. Assume this value is the 200th item in the combobox. Example of the combobox in the GUI after the data has been populated: (6) 2.2.2. Button [Q2.2.2 – New Order] Write code to do the following: • Validate whether a username was selected from the combobox. If not, no data must appear in the richedit and an appropriate message should be displayed. • If a username was selected, your program must do the following: o Store the CustID in a global variable to use in question 2.2.4. Please turn over
Downloaded from hlayiso.com Information Technology/P1 14 Preliminary Examination 2020 o Get today's date and store it in a global variable of a Date-type. Display the date at the top of the richedit. (Note that the format of the date may differ from the example because of the settings of your computer.) o Display the Name and Surname of the customer from the table, tblCustomers in red. Example of error message if a username has not been selected: Example of the richedit Invoice content after username was selected: (9) 2.2.3. Button [Q2.2.3 – Add to Order] Write code to do the following: • Add the common name and the price of the selected plant-item (active record) in the tblPlants dbgrid, to the richedit. The list of items must display in two neat columns (the code to format the neat columns is provided). • Test if there is stock available of the selected plant. o Display a message if there is no stock available, o Else ▪ Display the plant name and price in the richedit and ▪ Add the price to the total amount Please turn over
Downloaded from hlayiso.com Information Technology/P1 15 Preliminary Examination 2020 Example of the richedit Invoice content after four plant-items were selected (the button was clicked four times): Example of error message if the selected plant-item (ID: 76) is out of stock: (5) 2.2.4. Button Complete Order [Q2.2.4] Write code to do the following: • Display the total amount owed in the richedit. • Write the details of the new order to the tblOrders table: o Get the OrderNum from the last record in the table and add 1 to this number. Use this for the new order's OrderNum. o Use today's date as stored in the variable you created in Question 2.2.2 for the DatePlaced. o For DateDelivered, add seven days to today's date. o Use the CustID-value saved in question 2.2.2, and the Total owed to fill the CustID and TotalPaid for this order. o Write the new record to the table, tblOrders. • Display an appropriate message that the order is complete, on the richedit. Please turn over
Downloaded from hlayiso.com Information Technology/P1 16 Preliminary Examination 2020 Example of the complete Invoice (after button Q2.4.4 was clicked): (7) • Ensure that your name and surname has been entered as a comment in the first line of the unit. • Save your program. • Print the code if required. TOTAL SECTION B: 45 Please turn over
Downloaded from hlayiso.com Information Technology/P1 17 Preliminary Examination 2020 SECTION C QUESTION 3: OBJECT ORIENTED PROGRAMMING SCENARIO: The SANBI chooses a shrub, tree, and flower of the month. Information about this plant is then distributed in their newsletters. Do the following: ● Open the incomplete program in the Question 3 folder. ● Open the incomplete object class clsPlant_u. ● Enter your name and surname as a comment in the first line of both the Question3_u.pas file and the clsPlant_u.pas file. ● Compile and execute the program. The program currently has no functionality. The following user interface is displayed: Complete the code as specified in QUESTION 3.1 for the clsPlant_u object class and in QUESTION 3.2 for the Question3_u form class. Please turn over
Downloaded from hlayiso.com Information Technology/P1 18 Preliminary Examination 2020 3.1. Use the following descriptions of the incomplete object class TPlant to complete the class definition: 3.1.1. Declare attributes with the correct datatypes for the object as follows: Name of attribute Description fType A single character indicating what type of plant the object is: (F)lower, (T)ree or (S)hrub). fCommonName The common name used for the plant fFamily The family to which the plant belongs fDiameter The diameter in centimetres of the trunk/stem of the tree/plant (2) 3.1.2. Write code for a constructor method that will receive the type, common name, and family name as parameter values. Assign these values to the respective attributes. Assign a value of 0 to the fDiameter field. (4) 3.1.3. Write code for a method GetType that will return the value of the attribute type as a string as follows: F = Flower T = Tree S = Shrub (3) 3.1.4. Write code for a method SetDiameter that will receive a real value for the diameter of the trunk/stem of the tree/plant. Assign this value to the fDiameter field. If the type of the plant is ‘F’ for flower, the diameter must be set to 1. (3) 3.1.5. Write code for a method CalcWater to calculate and return the amount of water in litres the plant will need to grow for the first year of planting using the values in the table below and the fDiameter-field. • Trunks 15 cm diameter or smaller: 4 litre water per 2.5 cm diameter of trunk • Trunks larger than 15 cm diameter: 8 litre water per 2.5 cm diameter of trunk Month of year 1 Frequency First month Three times a week Second month Two times a week Third month Once per week Fourth to twelfth month Twice per month NOTE: Assume there are 4 weeks in a month. (4) Please turn over
Downloaded from hlayiso.com Information Technology/P1 19 Preliminary Examination 2020 3.1.6. On average, proper establishment of a new plant requires 1 year for every 1.5cm of trunk calliper (diameter). So, for a newly planted 3cm calliper (diameter) plant, it can take up to 2 years for it to become fully established. Write code for a method CalcEst to calculate and return the number of years it will take the plant to establish its root system. (2) 3.1.7. Write code for a ToString method to return a formatted string as follows: <Type> of the month <current system month>: Common Name: <common name> Family Name: <family name> Diameter: <diameter> Litres required for first year: <litres water> Example: Tree of the month June: Common Name: Drakensberg cycad Family Name: Zamiaceae Diameter: 17.57 Litres required for first year: 2688 (6) 3.2. The incomplete unit Question3_u provided, contains code to make the object class TPlant accessible. An object variable, objPlant, has also been declared. Follow the instructions below to create the solution. 3.2.1. Button [Question 3.2.1] • Save the user input for common name, family name and type. • Instantiate objPlant and display a message to indicate that the instantiation was successful. (8) 3.2.2. Button [Question 3.2.2] • Generate a random positive real value smaller than 31 for the diameter of the plant and call the relevant method to change the fDiameter-field. • Call the ToString-method and display the output result in redOutput. Please turn over
Downloaded from hlayiso.com Information Technology/P1 20 Preliminary Examination 2020 • Call the CalcEst-method written in question 3.1.6. If the estimated years of establishment is more than 5, create a dynamic label component on the panel pnlQ321 panel with the following properties: o Left = 8 o Top = 319 o Width = 140 o Height = 32 o Caption = 'Long establishment' o Font.Color = clRed o WordWrap = True Example of output: (8) • Ensure that your name and surname has been entered as a comment in the first line of the form file and the class file. • Save your program. • Print the code if required. TOTAL SECTION C: 40 Please turn over
Downloaded from hlayiso.com Information Technology/P1 21 Preliminary Examination 2020 SECTION D QUESTION 4: PROBLEM-SOLVING PROGRAMMING SCENARIO: The SANBI collected data on the total number of plants that were planted in all their gardens in the year 2019. They need your help to process and display the data. Do the following: ● Open the incomplete program in the Question 4 folder. ● Enter your name and surname as a comment in the first line of the Question4_u.pas file. ● Compile and execute the program – the program currently has no functionality. A text file, ‘Planted.txt’ contains the total number of plants that were planted every day of the year 2019 in the following format: <date>#<day of the week>#<number of plants planted> Herewith an extract of the first few lines from the text file: 01-Jan#Tuesday#326 02-Jan#Wednesday#216 03-Jan#Thursday#277 04-Jan#Friday#206 05-Jan#Saturday#334 06-Jan#Sunday#171 The following data structures are provided: • A constant array for all the months of the year: arrMonths: array[1..12] of string = ('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'); • The declaration for a two-dimensional array to store the total number of plants planted on every day of the week during every month of 2019: arr2Planted: array[1..12, 1..7] of Integer; Complete the code for this program as indicated in QUESTION 4.1 and QUESTION 4.2. Please turn over
Downloaded from hlayiso.com Information Technology/P1 22 Preliminary Examination 2020 4.1. Button [Question 4.1 Load] For this question you have to read the data from the text file store it in the array arr2Planted. The array must contain the total number of plants planted on every day of the week for each month of the year. Do the following: • Test if the file, Planted.txt, exists. If not, display a suitable message and exit the event handler. • Initialize all the values of arr2Planted to 0. • Read all the data from the text file and extract the date, day, and number from each line. • Calculate the total number of plants planted for every day of the week. Store the information in arr2Planted. • Enable btnDisplay. (16) 4.2. Button [Question 4.2 Display] • Display the totals in arr2Planted, as calculated in Question 4.1, in the richedit redOutput in neat columns. The code for the column-formatting in the richedit, has been given to you. • Determine and display during which month of 2019, the most plants were planted. Example of output: (14) TOTAL OF SECTION D: 30 GRAND TOTAL: 150 Please turn over
Downloaded from hlayiso.com Information Technology/P1 23 Preliminary Examination 2020 QUESTION 2: DATABASE INFORMATION DESIGN OF DATABASE TABLES: The records contained in tblCustomers consist of the following fields: ● CustID – a unique field with seven-character identification code (text data type) which is the primary key (PK) ● Surname – Surname of the customer (text data type) ● CustName – Name of the customer (text data type) ● Username – Used for login with online orders (text data type) ● Registered – Date customer registered for online business (Date/Time data type) ● Gender – Gender of customer (text data type – M/F) ● CardType – Credit card type used for online business (text data type) ● Email – E-mail address of the customer (text data type) Example of data from tblCustomers table: The records contained in tblPlants consist of the following fields: ● ID – unique index code for each Plant/Tree (number data type) starting from 1 (PK) ● ScientificName – Scientific Name of Plant (text data type) ● CommonName – Common Name of Plant (text data type) ● Family – Family the plant belongs to (text data type) ● Price – Unit price of plant (currency data type) ● Stock – Number of units of plant in stock (integer data type) ● Preference – Area preference for planting (text data type) ● Height – Maximum height of growth of plant in centimetres (integer data type) Please turn over
Downloaded from hlayiso.com Information Technology/P1 24 Preliminary Examination 2020 Example of data from tblPlants table: The records contained in tblOrders consist of the following fields: ● OrderNum – a unique field with the order number (integer data type) incremented by 1 (PK) ● CustID – seven-character identification code (text data type) which is the foreign key (FK) reference to tblCustomers ● DatePlaced – Date online order was placed (Date/Time data type) ● DateDelivered – Date online order was fulfilled (Date/Time data type) ● TotalPaid – Total amount of order placed and paid (currency data type) Example of data from tblOrders table: The CustID field has been used to link the two tables, tblCustomers and tblOrders.

Study this subject

More from Grade 12 Information Technology

View all