Skip to content

Information Technology Grade 12 P1 NSC June 2014 QP (Eng)

Question paperInformation TechnologyGrade 12201412 pages

Grade 12 Information Technology Paper 1 question paper from the NSC June 2014 (English), 12 pages. Read online or download the free PDF.

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 SENIOR CERTIFICATE EXAMINATION COMPUTER STUDIES P1 HIGHER GRADE 2014 MARKS: 100 TIME: 3 hours This question paper consists of 12 pages. Copyright reserved Please turn over
Downloaded from hlayiso.com Computer Studies/HG/P1 2 DBE/2014 SCE INSTRUCTIONS AND INFORMATION 1. This is a three-hour examination. Because of the nature of the examination, it is important to note that you will not be allowed to leave the examination room before the end of the session. 2. This question paper consists of TWO sections: SECTION A: Delphi (QUESTIONS 1, 2 and 3) SECTION B: Turbo Pascal (QUESTIONS 4, 5 and 6) 3. Answer SECTION A or SECTION B depending on the programming language you have studied. 4. The examination disk that you will receive should contain the following files: SECTION A: DELPHI QUESTION 1: Quest1 QUESTION 2: Quest2 QUESTION 3: Quest3 SECTION B: TURBO PASCAL Software: DOS BOX, TP7 [install DOS BOX, mount the drive before executing Turbo.exe] QUESTION 5: QUEST5.pas, QUESTION 6: QUEST6.pas, CARDSALE.DAT 5. Type your examination number as a comment statement at the beginning of each program. 6. Make backup copies of the files on disk. 7. Save your work every 10 minutes. 8. Make a printout of each question at the end of the examination. Copy your examination folder to a disk or CD. Hand in all the printouts and the examination disk. 9. No components of the Delphi-forms may be removed, replaced or added. 10. Pay attention to modularity, readability, sound programming techniques and user-friendly input and output. 11. Additional time for printing is allocated after the three-hour session. No changes may be made to any documents during this time. SCENARIO (FOR BOTH SECTION A AND SECTION B) XYZ Trading sells electronic devices to the public. It is a very popular store and business is thriving. After the 2014 Soccer World Cup, the owner decided to promote sales by running competitions in which customers can win cash and other prizes. Copyright reserved Please turn over
Downloaded from hlayiso.com Computer Studies/HG/P1 3 DBE/2014 SCE SECTION A: DELPHI QUESTION 1: DELPHI The owner decided that for May 2014 he will give cash awards to customers standing in the queue at the till point, as follows:  He will decide how many customers will receive cash awards. The starting amount is R1.  If he decides on the first 25 customers then the first customer in the queue will receive R1, the next 2 customers in the queue will receive R2 each, the next 3 customers in the queue will receive R3 each and so on until the 25 th customer in the queue. An incomplete Delphi program called Q1 has been provided. Open the project. When the program is executed the following screen appears: Complete the program as follows: 1.1 Read the number of people that will receive cash awards from the given text box. Convert this value to an integer. (2) 1.2 Write code for the Process button so that when it is clicked: 1.2.1 The amount of money that the last person will receive and the total amount of money that will be required to pay the winners is calculated (10) 1.2.2 All the amounts that will be handed out, the award that the last person will receive and the total amount of cash that will be required is displayed (3) SAMPLE OUTPUT: [15] Copyright reserved Please turn over
Downloaded from hlayiso.com Computer Studies/HG/P1 4 DBE/2014 SCE QUESTION 2: DELPHI Customers that make purchases for R1 500 or more stand a chance to win a cash voucher. Twenty random amounts in the range 0–30 will be assigned to the numbers 1 to 20. The customer will be asked to pick 5 numbers in the range 1–20 and the amounts represented by the numbers are then added together. The customer will be given a voucher to that value. To avoid amounts being predicted, the owner requires a program that will randomise the amounts represented by each number for each new customer. The following rules also apply:  A customer is allowed to choose a number more than once (that is, repeats are allowed).  If the customer chooses a number above 20 or below 1, R5 will be is deducted.  If the value of the voucher amount becomes negative, it is set to 0.  To further advantage the customer, if the voucher amount is a two-digit number and the units digit is larger than the tens digit, the digits are reversed. An incomplete Delphi program called Q2 has been supplied. Open the project. It generates a GUI as shown below: 2.1 Complete the code for the Randomize button that will generate 20 random amounts in the range 0–30 and store them in an array called box. (6) 2.2 Write the code for the Show Max/Min button that will determine and display the highest and lowest amounts assigned to the numbers and the maximum possible voucher amount that the customer can win from the amounts stored. (7) 2.3 Write a function called CheckRange that will receive an integer value as a parameter. The function returns true if the value is in the range 1–20 or false if otherwise. (4) Copyright reserved Please turn over
Downloaded from hlayiso.com Computer Studies/HG/P1 5 DBE/2014 SCE 2.4 In this game the customer must choose 5 numbers in the range 1–20. The 5 choices are entered in the indicated text fields (Choice1, Choice2, ...). Write code for the button labelled Customers Choice. Each choice is a number in the range 1–20. Store these 5 choices in an array called Cust. Data input is done with the keyboard. (3) 2.5 Write a function called ReverseDigits that receives a two-digit amount as a parameter. The two-digit amount is reversed only if the units digit is higher than the tens digit and the new amount formed is then returned. If the digits are not reversed, then the original amount is returned. (9) 2.6 Write a function called CalculateVoucher that will determine the voucher amount based on the following criteria:  Use the function called CheckRange to determine if a number is in the correct range and deduct R5 if it is not.  As soon as the voucher value becomes negative reset the amount to 0.  Use the function ReverseDigits to reverse the digits of the voucher, if applicable. (11) 2.7 Complete the code for the button Voucher Value to display the following:  The 5 numbers chosen by the customer  The amounts represented by each number  The total amount of the voucher (10) SAMPLE OUTPUT 1: Copyright reserved Please turn over
Downloaded from hlayiso.com Computer Studies/HG/P1 6 DBE/2014 SCE SAMPLE OUTPUT 2: [50] QUESTION 3: DELPHI The owner wants to encourage customers to pay by card rather than use cash. He decides to assign ticket numbers to customers that paid by card. Two ticket numbers are drawn at random and those customers will each receive tickets and an all-expenses paid trip to Brazil to watch the 2014 Soccer World Cup. When customers pay by card, their details are captured and written to a text file. A sample text file called CARDSALE.DAT has been provided containing details of customers as follows: Customer first name, customer surname, customer account number and amount of the purchase. The first three entries in the text file CARDSALE.DAT is as follows: Lihle Madond 4933130001408352 456.20 Samantha Naidoo 6000123967890561 83.40 Johannes Viljoen 5438900124563882 257.90 ... Only customers who have purchased for a minimum amount of R100 qualify for the draw and will be assigned ticket numbers. (The second customer in the sample text file above purchased for an amount below R100, and therefore no ticket number must be generated.) A ticket number is generated for each purchase according to the following algorithm:  The ticket number starts with the first letter of the customer's first name followed by the first 3 letters of his/her surname in capital letters. Assume the customers only have one first name and one surname.  The last four digits of the account number are then attached. Copyright reserved Please turn over
Downloaded from hlayiso.com Computer Studies/HG/P1 7 DBE/2014 SCE  To keep track of the number of tickets, a three-digit number starting with 001, 002 et cetera, is attached at the end. Example of the first two valid ticket numbers: LMAD8352001 JVIL3882002 ... An incomplete Delphi program called Q3 has been supplied. Open the program. When the program executes, the following form is created: Complete the Delphi code as indicated below: 3.1 Declare the following: 3.1.1 A record structure called Customer to store the following fields: firstname, surname, cardnum, amount (3) 3.1.2 An array called arrCust to hold 20 records (1) 3.2 Write the code for the procedure called getCustDetails that will read the given text file (CARDSALE.DAT) and transfer the details of each qualifying customer into the array of records. The file must be assigned and the array of records must be created when the button Customer Details is clicked. (11) 3.3 Write the code for the Generate Tickets button that will use the details in the array of records to generate ticket numbers according to the criteria listed above. Each ticket number must be stored in an array called ValidTickets. (12) 3.4 Complete the code for the function called Sum that finds the sum of all payments made by card. (4) Copyright reserved Please turn over
Downloaded from hlayiso.com Computer Studies/HG/P1 8 DBE/2014 SCE 3.5 Write the code for the Display All button to: 3.5.1 Call the relevant procedures and functions 3.5.2 Display the list of valid tickets and the total amount of sales made with card payments (4) SAMPLE OUTPUT: [35] TOTAL: 100 Copyright reserved Please turn over
Downloaded from hlayiso.com Computer Studies/HG/P1 9 DBE/2014 SCE SECTION B: PASCAL QUESTION 4: PASCAL The owner decided that for May 2014 he will give cash awards to customers standing in the queue at the till point, as follows:  He will decide how many customers will receive cash awards. The starting amount is R1.  If he decides on the first 25 customers then the first customer in the queue will receive R1, the next 2 customers in the queue will receive R2 each, the next 3 customers in the queue will receive R3 each and so on until the 25 th customer in the queue. Develop a Pascal program that will: 4.1 Prompt the user to enter the number of people that will receive cash rewards (2) 4.2 Calculate the amount of money that the last person will receive and the total amount of money that will be required to pay the winners (10) 4.3 Display all the amounts that will be handed out, the award that the last person will receive and the total amount of cash that will be required (3) SAMPLE OUTPUT: Enter starting amount R? 1 Enter number of people in the queue? 18 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 The last person will receive: R 6 Total amount required: R 73 Save this program as QUEST4.pas. [15] Copyright reserved Please turn over
Downloaded from hlayiso.com Computer Studies/HG/P1 10 DBE/2014 SCE QUESTION 5: PASCAL Customers that make purchases for R1 500 or more stand a chance to win a cash voucher. Twenty random amounts in the range 0–30 will be assigned to the numbers 1 to 20. The customer will be asked to pick 5 numbers in the range 1–20 and the amounts represented by the numbers are then added together. The customer will be given a voucher to that value. To avoid amounts being predicted, the owner requires a program that will randomise the amounts represented by each number for each new customer. The following rules also apply:  A customer is allowed to choose a number more than once (that is, repeats are allowed).  If the customer chooses a number above 20 or below 1, R5 will be is deducted.  If the value of the voucher amount becomes negative, it is set to 0.  To further advantage the customer, if the voucher amount is a two-digit number and the units digit is larger than the tens digit, the digits are reversed. An incomplete Pascal program called QUEST5.pas has been supplied. Open the program. It contains a menu with five options that compiles and executes without errors. 5.1 Declare an array called box to hold 20 integer values and an array called Cust to store 5 integer values. (3) 5.2 Write a procedure called FillAmounts that will generate 20 random numbers in the range 0–30 and store them in the array called box. (3) 5.3 Write a procedure called ShowBoundaries that will determine and display the highest and lowest amount represented by the numbers and the maximum possible voucher amount that the customer can win from the amounts stored. (7) 5.4 Write a function called CheckRange that will receive an integer value as a parameter. The function returns true if the value is in the range 1–20 or false if otherwise. (4) 5.5 In this game the customer must choose 5 numbers in the range 1–20. Write a procedure called GetChoice that receives an array as a parameter. The procedure must store the 5 numbers in the range 1–20 in the array. Each number in the array represents a number that the customer has chosen. Data input is done with the keyboard. (3) 5.6 Write a function called ReverseDigits that receives a two-digit amount as a parameter. The two-digit amount is reversed only if the units digit is higher than the tens digit and the new amount formed is then returned. If the digits are not reversed, then the original amount is returned. (9) Copyright reserved Please turn over
Downloaded from hlayiso.com Computer Studies/HG/P1 11 DBE/2014 SCE 5.7 Write a function called CalculateVoucher that will determine the voucher amount based on the following criteria:  Use the function CheckRange to determine if a number is in the correct range and deduct R5 if it is not.  As soon as the voucher value becomes negative reset the amount to 0.  Use the function ReverseDigits to reverse the digits of the voucher, if applicable. (11) 5.8 Write a procedure called Display to display the following:  The 5 numbers chosen by the customer  The amounts represented by each number  The total amount of the voucher (7) 5.9 Call the correct procedures/functions to achieve the desired outcome of each menu option. (3) [50] QUESTION 6: PASCAL The owner wants to encourage customers to pay by card rather than use cash. He decides to assign ticket numbers to all customers that paid by card. Two ticket numbers are drawn at random and those customers will each receive tickets and an all-expenses paid trip to Brazil to watch the 2014 Soccer World Cup. When customers pay by card, their details are captured and written to a text file. A sample text file called CARDSALE.DAT has been provided containing details of customers as follows: Customer first name, customer surname, customer account number and amount of the purchase. The first three entries in the text file CARDSALE.DAT is as follows: Lihle Madond 4933130001408352 456.20 Samantha Naidoo 6000123967890561 83.40 Johannes Viljoen 5438900124563882 257.90 ... Only customers who have purchased for a minimum amount of R100 qualify for the draw and will be assigned ticket numbers. (The second customer in the sample text file above purchased for an amount below R100, and therefore no ticket number must be generated.) A ticket number is generated for each purchase according to the following algorithm:  The ticket number starts with the first letter of the customer's first name followed by the first 3 letters of his/her surname in capital letters. Assume the customers only have one first name and one surname.  The last four digits of the account number are then attached. Copyright reserved Please turn over
Downloaded from hlayiso.com Computer Studies/HG/P1 12 DBE/2014 SCE  To keep track of the number of tickets, a three-digit number starting with 001, 002 et cetera, is attached at the end. Example of the first two valid ticket numbers: LMAD8352001 JVIL3882002 ... An incomplete Pascal program called QUEST6.pas has been supplied. Open the program. 6.1 Declare the following: 6.1.1 A record structure called customer to store the following fields: firstname, surname, cardnum, amount (3) 6.1.2 An array called arrCust to hold 20 records (1) 6.2 Complete the procedure called getCustDetails that will read the given text file (CARDSALE.DAT) and transfer the details of each qualifying customer into the array of records. (9) 6.3 Complete the procedure called GenerateTickets that will use the details in the array of records to generate ticket numbers according to the criteria listed above. Each ticket number must be stored in an array called ValidTickets. (12) 6.4 Complete the function called Sum that finds the sum of all payments made by card. (4) 6.5 Complete the procedure called Display to: 6.5.1 Call the relevant procedures and functions (3) 6.5.2 Display the list of valid tickets and the total amount of sales made with card payments (3) [35] TOTAL: 100 Copyright reserved

Study this subject

More from Grade 12 Information Technology

View all