Skip to content
Question paper

Information Technology Grade 10 P1 KwaZulu Natal June 2018 QP

Grade 10 Information Technology Paper 1 question paper from the KwaZulu Natal June 2018, 18 pages. Read online or get the free PDF download, memo linked when available.

Subject: Information TechnologyGrade 10201818 pages
Download

Loading document…

Loading document…

Document textSearch extracted text and jump to a page.
Downloaded from hlayiso.com education Department: Education PROVINCE OF KWAZULU-NATAL ui i es Sie ee ee i ee a ee eR gee H INFORMATION TECHNOLOGY i : PAPER 1 : te MID YEAR 2018 : ® ay Sages eeseeeeseceeseeeeeeaaaeeeaeee eee Eee e "GRADE 10 MARKS: 120 TIME: 3 HOURS EXAMINER(S) : P Rampersad (Northlands Girls’ High) : C.Andrew (Danville Park Girls’ High) MODERATOR : S.Naicker (Merebank Secondary) This question paper consists of 17 pages including this cover page. Page 1 of 17
Downloaded from hlayiso.com INSTRUCTIONS AND INFORMATION: 10. Answer ALL the questions. 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. Make sure that you answer the questions according to the specifications that are given in each question. Marks will only be awarded based on the set requirements. Answer only what is asked in each question. Your programs must be coded in such a way that it will work with any data and not just the sample data supplied or any data extracts that appear in the question paper. Save your work regularly on the disk (CD/flash disk/DVD, et cetera) that you have been given, or on the disk space allocated to you for this examination session. Make sure that your name and surname appears as a comment in the first line of code. Also include the question number as part of the comment. Print the programming code of all the programs that you completed. You will be given half an hour printing time after the examination session. At the end of this examination session, you must hand in the disk/CD 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. Ensure that all files can be read. You have been provided with the Delphi files in the folders Question(, Question2, Question3 and Question4. Page 2 of 17
Downloaded from hlayiso.com QUESTION 1: GENERAL PROGRAMMING SKILLS 1.1 Many learners in Grade 9 are eager to study programming. They have asked the Grade 10’s to teach them some basic programming skills. After teaching these learners basic skills, you are now required to create an exercise that may be used to test their skills. They are required to complete the following program. The program is based on a Market Day organised by the school to raise funds. Individuals or class groups may hire a stall to sell items or provide services or play games Compile and execute the program found in the Question folder. The user interface displays FOUR different sections named Question 1.1 to Question 1.4. The program has no functionality currently. The graphical user interface (GUI) is as follows: So Fort Question 1.1 Question 1.3 Learner Name ' _. Computer Game Stall : Grade oe ; Enter Number of Players eee Stall Kumber (13 calculate Cost of Extension Cables and Internet | Question 1.2 Question 1.4 Dance-a-thon Drinks Choose your drink =» Enter Participants Name Number af Drinks ¢ Regula Fruit juice So _) Male Female Hot chocolate - 12.00 ~- Cold drink - 9.75 Drink Prices Gender aes aaa | | 1.4 Add Dancer Male Dancers Female Dancers | Mega Size Drink Prices | Twice the price of requiar i size drinks | fGrinks Display cost of drinks here Complete the code for each section of QUESTION 1, as described in QUESTION 1.1 to QUESTION 1.4. Button [1.1 Allocate Stall] Write code to use the information entered in the Learner Name, Grade and Stall Number edit boxes to produce a message that a stall has been reserved. Use appropriate variables with meaningful names to store the data extracted from the edit boxes. The message must be created in the following format: Stall <Stall Number> reserved for <Learner Name> in <Grade> The message must be displayed in the panel component pniRegistered. Change the colour of pniRegistered to clAqua. (9) Page 3 of 17
Downloaded from hlayiso.com A sample of the output for Ravi Naidoo in Grade 9 who has booked stall number 10 is: Question 1.1 Learner Name Grade 9 Stall Number io 1.2 Button [1.2 Calculate Cost of Drinks] A stall which sells soft drinks requires buyers to select drinks from the combo box cembDrinks. The prices of the drinks are displayed in the memo component memDrinkPrices. e = Fruit juice - R10..50 e Hot Chocolate — R12.00 6 Cold drink — R9.75 The user is required to select: * one of the drinks from the cornbo box embDrinks and e to select the number to be ordered from the spin edit box sedNumberDrinks. e The user also has a choice of selecting the Mega 450 ml option by using the check box component chkDrinkSize. If component chkBrinkSize is selected then the cost is doubled. Write code to calculate the amount to be paid based on the selected information. Display the calculated amount in the label component /bIDisplayDrinkCost and format the output to currency with TWO decimal places and in red text. (.4) Example of output if 2 Hot Chocolate Mega drinks are selected: Question 1.2 Brinks Hot chocolate oy Regular Size Orink Prices ae Fruit juice - 10.50 [4] Maga 450ml Hot chocolate - 12.00 Co Cold drink ~ 9.75 1.2 Calculate Cost of Drinks Number of Grinks 2 Mega Size Drink Prices Twice the price of regular size drinks Cost of Drinks = R 49,00 Page 4 of 17
Downloaded from hlayiso.com A school hall is setup to play computer games. Each player is required to bring their own computer equipment. ' Specially designed extension power cables with multi-adaptors will be provided for a fee of R96. Each of these power cables can be used by four players. Each player will also be required to pay a fee of R75 to make use of the Internet. Write code using appropriate variables to: e €xtract the number of players from the edit box edtNumberPlayers and store the value in an appropriate variable e Calculate the number of power cables that will be needed and store in an appropriate variable. Note that a maximum of FOUR players may use a power cable. e Calculate the total fee for the required number of cables and store in an appropriate variable. e Calculate the total fee for use of the Internet and store in an appropriate variable e Display the calculated values in the memo component memQ1_3Display as shown in the sample output below. Example of output if the number of players entered is 63: Question 1.3 ____ Computer Game Stall Enter Humber of Players 63 1.3 Calculate Cast of Extension Cables and Internet | playel Number of pewer cables 16 Power cable fee R 1 936.00 Internet fee R 4725.00 Total fee R 6 261.00 Page 5 of 17
Downloaded from hlayiso.com 1.4 Button [1.4 Add Dancer] A stall holds a dance-a-thon to see how long partners can stay on their feet. Family and friends pledge support for their teams to encourage their success. The program helps to compile a list of male and female dance participants Write code to: e Extract the name of the participant and store in a suitable variable declared locally e Determine if the participant is male or female from the component rgoGender e Add the name to the appropriate list box IstMales or IstFemales. (6) A sample output of male participant Tim Govender and female participant Stacy James is: Question 1.4 Dance-a-thon Stacy James Enter Participants Name Gender o Male © Female Male Dancers Female Dancers r Stacy James be | Tim. Gevender ; | L 1.5 Write code for an OnActivate event for frmMain that does the following: e Change the caption of the form frmMain to ‘Market Day’ Change the colour of the form frmMain to yellow. Change the colour of the edit components: edtName, edtGrade and edtStallNumber to Aqua e Change the wicth of lb/Males and IblFemales to 145 ® Change the font size of [b/Males and IbiFemales to14 (5) ) [54] Page 6 of 17
Downloaded from hlayiso.com QUESTION 2 21 2.1.1 Write a program that lets a user play "Rock, Paper, Scissors" against the computer. The program should ask the user to choose one of the three choices, and then the computer randomly picks one (without knowing what the user has chosen). For this problem, the user should be asked to select an integer: 0 for rock, 1 for paper, or 2 for scissors. Rock beats scissors, scissors beats paper, paper beats rock. You are required to complete the program found in the Question2 folder according to the direction given in 2.1.1 to 2.1.9. The form in the program contains the following GUI components and those components listed are to be used to write required code as described in this question: e sedChoice e btnPlay e memDisplay ame: Rock Paper Scissors Welcome to Rock, Paper, Scissors Game - Choose your option Rock(0) Paper(1) Scissors(2) 0 Sen a Write code in the onClick event handler for btnPlay to do the following: Declare all the necessary variables to store the: e user's choice extracted from sedChoice provided computer's choice stored as an integer user's choice stored as a string computer's choice stored as a string result stored as a string Extract the user's choice in sedChoice and assign the value to the appropriate variable. (1) Page 7 of 17
2.15 2.1.6 Downloaded from hlayiso.com Write code to do the following: e if Ois selected in sedChoice then assign the value ‘Rock’ to your user's choice string variable e if 1 is selected in sedChoice then assign the value ‘Paper’ to your user's choice string variable e if 2is selected in sedChoice then assign the value ‘Scissors’ to your user's choice string variable Write code for the computer to generate a random integer in the range 0 to 2 and assign the value to the appropriate variable. Include in the event handler a procedure that ensures that the random function will generate a different random number every time event handler for btnPlay is run. Write code to do the following: » if the random number generated is 0 then assign the value ‘Rock’ to your computer's choice string variable e if the random number generated is 1 then assign the value ‘Paper’ to your computer's choice string variable * if the random number generated is 2 then assign the value ‘Scissors’ to your computer's chcice string variable Write code to display the following output in memDisplay as shown in the sample output: 2 ‘The result of the Rock, Paper, Scissors game’ 2 ‘Your choice is' <followed by the users choice> » 'The computer's choice is: ' <followed by the computers choice> Sample Output: The result of the Rock, Paper, Scissors game Your choice is Rock The computer's choice is: Scissors Page 8 of 17 (3)
Downloaded from hlayiso.com 2.1.7 Write code to determine the winner of the game. The following algorithm may be used to determine the result: ° Ifthe user’s choice is the same as the computer's choice then the result is: draw e Ifthe user’s choice is “rock’(0) and the computer's choice is “paper’(1), then the result is: computer wins ( paper beats rock) e {fthe user's choice is “rock’(0) and the computer's choice is “scissors”(2), then the result is: user wins (rock beats scissors) e If the user’s choice is “paper’(1) and the computer's choice is “rock’(0), then the result is: user wins ( paper beats rock) e [f the user's choice is “paper’(1) and the computer's choice is “scissors’(2), then the result is: computer wins ( scissors beats paper) e Ifthe user's choice is “scissors’(2) and the computer's choice is “paper’(1), then the result is: user wins ( scissors beats paper) » Ifthe user’s choice is “scissors’(2) and the computer's choice is “rock’(0), then the result is: computer wins (rock beats scissors) e Assign the result (‘user wins’ or ‘computer wins’ to the appropriate variable (7) 2.1.8 Write code to display the result of the game in memDisplay as shown in the sample output below: (1) “BE Game: Rock Paper Scissors Welcome to Rack, Paper, Scissors Game i Choose your option Rock({0) Paper(1) Scissors(2) oO The result of the Rock, Paper, Scissors game Your choice is: Rack The computer's choice is: Rock Result: Draw i a i i | | | i} | | | | | | | | Page 9 of 17
Downloaded from hlayiso.com {GB Game: Rock Paper Scissors) Welcome to Rock, Paper, Scissors Game | Play Ghoose your option Rock(0) Paper(1) Scissors(2) The result of the Rock, Paper, Scissors game Your choice is: Paper The computer's choice is: Rock Result: User wins Welcome to Rock, Paper, Scissors Game chasse your option Rock(0) Paper(1) Scissors(2) 25 The result of the Rock, Paper, Scissors game Your chaice is: Scissors The computer's choice is: Rock Result: Computer wins | _ Retry 2.1.9 Code an OnClick event handler for bmbRetry to clear memDisplay and set the focus in sedChoice. (1) [24] Page 10 of 17
Downloaded from hlayiso.com QUESTION 3 A computer stall selis computer related accessories. A program is required to help when customers make purchases. e When making purchases the code of the item and the price must be entered e The total price of items purchased must be calculated each time a new item is entered. Therefore a global variable rTotal is provided. e Your program must allow for discounts on purchases exceeding given totals. e Your program must also determine the change to be given to customers when payment is made. You are required to complete the program found in the Question3 folder according to the direction given below:. Code for the onActivate event for the form is provided. The cade is used to display data in two colurnns in the richedit component. Make use of this when displaying data in the richedit redOutput. Make use of local variables as required Write code for this program as directed in questions 3.1 to 3.4. The interface for the program with limited functionality is as follows: 4 Computer steit Item Code Code Price Price List Item Code Price FD8GB 58,00 FD ISGE 75,00 enk PB1000 198.00 3 hone charger 45,00 Phone Charger i‘ 65.00 / Change | Charger Cable CCLEGHT 25.00 i Reset | i 3.1 Write code in the onClick event handler for btnEnter to do the following: 3.1.1 e Declare all the necessary variables to store the: o Item code extracted from edtCode o Price extracted from edéPrice e Extract the value from edtPrice and add to the variable rTotal Page 11 of 17
Downloaded from hlayiso.com Display the item code and price of this item in the Rich edit component redOutput. Display the price formatted as currency to 2 decimal places. (5) A sample output is as follows: ‘@) Computer stall : P | ItemCode pa ynca Code “Price | PB 1000 R 196.00 Price B12 e Write code to clear the edit edtCode e Write code to clear the edit edtPrice e Write code to set the focus in the component edtCode 3.2 A discount is awarded to customers based on the total amount spent. If the customer spends: >=R150 and <R300, the discount is 5% >= R300, the discount is 10% 3.2.1 Write code in the onClick event handler for btnTotal to do the following e Declare a variable to store the discount e Calculate the discount awarded to the customer e Calculate the new total considering the discount e Display the sales details as shown in the following sample output. All money values are to be formatted as currency to 2 decimal places (10) Page 12 of 17
Downloaded from hlayiso.com Sample output when the total amount of purchases is < R150: i Computer stall i i Item Code Code Price FROSGS R 53,00 CCLIGHT 0, SubTotal: 83.00 oe Discount: 0.00 Total: R83.00 { Price List | Item Item Code Price Flesh Disk FDSGE $8.00 Flash Disk FDIEGB 75.00 Power Bank 6 1000 136.00 Car Phone Charger CPC 12 45.00 Phone Charger PC220¥ 85.00 Charger Cable CCLIGHT 25.00 “$8 Computer stait Ttem Code SERRE SS Come Price R 53.00 | R 65.09 | Price Ri Discount: R265 ; - Si Total: R 183,35 | Price List i TtemCode rice L FO3GE 53.00 i FD16G8 75.09 ] 81000 146,00 : crcl 45,00 l Charger Cable CCLIGHT 25.00 i { | : | | Bhone Charger PC220Y 65.00 i Page 13 of 17
Downloaded from hlayiso.com Sample output when the total amount of purchases is >R300 Item Code i ‘Code /PB1n00 “FD I668 Pez R 65,00 | i ‘cpcany R 45.00 | R381.00 | feamncs R810 ik R 342,90 pod Price List | Ttem Item Code Price | Flach Dick FOSGE 38.00 Flash Disk FD166B 75.00 Power Bank PE 1000 196.90 Car Phone Charger | CPC1AV 45.00 | Phone Charger FC2204 65,00 (Sane) Charger Cable CCLIGHT 25.00 3.3. Use the following instructions to write code in the onClick event handler for btnChange to determine the change to be given the customer after payment is made for goods purchased: 3.3.1 e Declare all the necessary variables to store the: o The arnount paid o The change due to the user « Use an fnputBox to prompt the user to enter the amount tendered to pay for items purchased.: A sample of the amount entered in an InputBox is as follows Bh Comp Item Code Code PE1900 : ‘Sub-Total: Price Discount: iTotalt Price Let Trem Code rice f FOS¢B i oo j FO16GB | by Toth} Power Bank PB1000 saa Car Phone Charger = CPCI2V 25,00 Phone Charger Po2zy 65.00 Charger Cable CCLIGHT 25.00 3.3.2 Calculate the change that is due to the user and display this amount in redOutput formatted as currency to 2 decimal places. Page 14 of 17
3.4 Downloaded from hlayiso.com A sample of the output is as follows: “GH Computer stall . ke Thent Code Code Price / PB 1200 R 198.00 Sub-Total: R 196.00 Price ‘Discount: R980 ‘Total R 186.20 Charge: R 3.80 Peery [enteritem J Price List — Tem Hem Code Price Flash Disk FDSGB 53.00 ay Flash Disk FDI6GB 75.00 | Tots | Power Bark PB 1000 196.05 — Car Phone Chi 45,00 Phone Cher: 65.00 Charger Cab 28.00 Write code on the onClick event of the button btnReset, to do the following: ° Clear the richedit redOutput, component, e Set the variable rTotal to 0 e Display the headings “Code” and “Price” at the top of redOutput (3) A sample of the output is as follows: Hy Computer stall | Hem Code es . Code Pree | i | Price Price Item Item Code Price Flash Disk FDgGB 58.00 i pe — Flash Disk FD 1668 75.00 ‘ Total \ Power Bank Fg 1000 136,00 i Car Phone Charger © CPC12V 45.00 Phone Charger FC2204 65.00 Charger Cabl CCLIGHT 25.00 i Change oP = “ [27] Page 15 of 17
Downloaded from hlayiso.com QUESTION 4 A Delphi programming contest requires learners to write programs based on given pseudocode. A maths teacher has written the following pseudocode and contestants are required to write code based on the given pseudocode TASK: Determine if an integer is a prime number BEGIN Counter = 0 Ask ‘What is the integer number?’ Get Number For Index = 1 to Number do BEGIN if Number divisible by Index then increase Counter by 1 END If Counter = 2 then Display ‘Number is prime’ otherwise Display ‘Number is not prime’ W Number divisipie by 2 then Dispiay ‘The number is even’ Otherwise END Dispiay ‘The number is odd’ 4.1. The program found in the Question4 folder has no functionality. You are required to complete the program according to the direction given below:. Make use of local variables as required. 4,2 Write code inthe onClick event handler for btmCheck based on the pseudocode provided. You will be required to: a Page 16 of 17 Declare appropriate variables for counter, number and index Retrieving the number entered in the edit edtNum and storing it in the appropriate variable declared. Use the pseudocode to write Delphi code to determine if the number entered is prime or not Display the appropriate message in the component memOutput Use the pseudocode to write Delphi code to determine if the number entered is odd or even Display the appropriate message in the component memOutput
Downloaded from hlayiso.com 4.3 The image in the interface provided is hidden. Write code in the onActivate event of the form to do the following: e Make the image visible e Ensure that the image is proportional e Set the Stretch property of the image to true 4.4 Insert a Close BitButton on the form. Sample outputs: Murmber is not prime | Number is ewen | | I aths is fun _ O * Enter number fa | Mumber is prime Number is odd TOTAL MARKS : 120 Page 17 of 17 (3) [173
Downloaded from hlayiso.com

Study this subject

Revise the topics in this paper, then practise them question by question.

More papers and memos for this grade and subject.

More from Grade 10 Information Technology

View all