Transcription of NATIONAL CERTIFICATE (VOCATIONAL) …
1 Copyright reserved Please turn over PRINCIPLES OF COMPUTER PROGRAMMING (Second Paper: Practical) NQF LEVEL 3 NOVEMBER 2009 (10041023) 27 November (X-Paper) 09:00 13:00 This question paper consists of 15 pages. NATIONAL CERTIFICATE ( vocational ) (10041023) -2- NC1900(E)(N27)V Copyright reserved Please turn over TIME: 4 HOURS MARKS: 150 _____ INSTRUCTIONS AND INFORMATION 1. 2. 3. Answer ALL the questions. Read ALL the questions carefully. Number the answers according to the numbering system used in this question paper. _____ INSTRUCTIONS TO CANDIDATES AND LECTURERS 1. 2. 3. 4. 5. 6. Candidates must be seated in the computer laboratory 30 minutes before the start of the examination to ensure that all computers have the appropriate programs.
2 The questions in this question paper will be done on the computer by making use of a database program (MSAccess) and 2005 or 2005 Express. Candidates must make sure that they print their work immediately after they have completed a question. Ensure that your examination number is printed on each printout. NO QUESTION WITHOUT A PRINTED EXAMINATION NUMBER WILL BE MARKED. In the event of a power failure or a computer or printer breakdown, the invigilator will make the necessary arrangements for students to continue and the actual time lost will be given to them once they resume working. All work on the computer should be saved at regular intervals to prevent loss of work in the event of a power failure.
3 NO additional time may be allowed for such lost work. No candidate may print his/her work for another candidate, or make a memory stick available to another or access other candidates' work on the network. Any attempt to access information from or transfer information to another candidate in whatever manner is a contravention of the examination rules and regulations and will be viewed in an extremely serious light. (10041023) -3- NC1900(E)(N27)V Copyright reserved Please turn over 7. 8. All printouts or screen prints done during the session MUST be handed in. Make sure that your examination number appears on all pages. 9. 10. 11.
4 12. Students may NOT copy the source code of to MSWord and then print it from the word processor. Steps to make a SCREEN DUMP: Run the solution. Hold in the ALT key and press PRINT SCREEN (This will copy the active screen). Open the MSWord program in Windows and PASTE the screen. Add your examination number to the top right-hand side of your screen. Print from here. You are allowed to make use of the Help files on The following files will appear on your hard drive: C:\NOV 2009 PRACTICAL\CLASS LIST\ C:\NOV 2009 PRACTICAL\ICECREAM\ C:\NOV 2009 PRACTICAL\ _____ (10041023) -4- NC1900(E)(N27)V Copyright reserved Please turn over QUESTION 1: PROGRAMMING The following question refers to a solution that has been saved on your hard drive.
5 Open the solution CLASS LIST (C:\NOV 2009 PRACTICAL\CLASS LIST) on the hard disk and complete this question by following the instructions below. You are part of a team who works for a company that designs school administration packages. Your job is to add the code to the user interface. Buttons ListBox Labels GroupBox TextBoxes The above list was used to name the controls on the user interface screen. Use this as a reference to complete the program code. (10041023) -5- NC1900(E)(N27)V Copyright reserved Please turn over WORKING OF THE PROGRAM EXPLAINED Step 1: Amount of students is entered into the Amount Students TextBox, Enter Amount button is clicked and then the Student Detail, GroupBox, with the Student Detail will be enabled.
6 Step 2: The Student Name and Student Surname are keyed in; the process will use a loop to count how many entries have been made by the user. Step 3: Click Enter Student button. Step 4: Key in the next student. Step 5: When the last student's name is keyed in, the MessagesBox appears. Step 6: Names and Class of students are written into the ListBox on the right-hand side of the form. Step 7: Fields are cleared when Clear button is clicked. Step 8: Program exits when Exit button is clicked. GENERAL HINT: The program should make use of TWO counters. (10041023) -6- NC1900(E)(N27)V Copyright reserved Please turn over Add your examination number to LABEL 4 on the form and as a comment in your code.
7 HINT: Use the following data in your program. There are FIVE students. Name Surname Jabu Nkosi Busi Mabena Eden Zulu Ernest Botha Suzi Quatro (1) Declare the variables and the array. (3) The program has to store the NAMES and SURNAMES of the students in an array called AmountArray() of the type string. (3) The GroupBox must be enabled when the amount has been keyed in into the txtAmount TextBox. (1) When the user clicks Enter Amount, the TextBox for the amount has to be cleared. (1) Redimension the array to the new size of the amount of students. (1) Make use of a counter variable. (2) The program has to test if the user keyed in an amount bigger than zero (0).
8 (2) When the user clicks the Enter Student button, the Name and Surname have to be entered into the array. (3) The TextBox for Name and Surname has to be cleared when the user clicks the Enter Student button. (1) Move the focus back to the txtName TextBox. (1) When the user has entered the final name, a MessageBox has to appear, saying Limit Reached. (2) The names and surnames of the students have to be written to the ListBox from the array using a For - Next loop. (4) There should be a space between the Name and the Surname when they are displayed in the ListBox. (1) (10041023) -7- NC1900(E)(N27)V Copyright reserved Please turn over The names of the students have to be sorted in alphabetical order.
9 Use the ListBox sort method. (2) The Clear button has to clear all TextBoxes. Make use of a Procedure. (3) The Exit button has to close the program. (1) Add descriptive comments to each subprocedure. (4) Make a screen dump of the completed form. Make sure that your examination number appears on the form as specified in QUESTION (2) Print the source code. (2) [40] QUESTION 2: DEBUGGING PROGRAM You are working as a junior programmer in a company that writes programs for small enterprises. The current project is in its final phase and is handed over to you to complete. Open the solution C:\NOV 2009 PRACTICAL\ICECREAM) on the hard drive.
10 This program calculates and displays incorrect results. It is your job to find these errors in the program. Use the test data below to test the program. The last column shows the output that is expected. TEST DATA Ice-Cream Sales Cold Drink Sales Correct Output 20 3 3 20 150 11 11 150 INSTRUCTIONS (10041023) -8- NC1900(E)(N27)V Copyright reserved Please turn over Change the original code so that the output would be the same as in the CORRECT OUTPUT column in the table above. Below is the code from the hard disk. Public Class frmIceCream ' Replace this COMMENT with your EXAMNUMBER Private Sub btnEnterData_Click(ByVal sender As , ByVal e As ) Handles ' This program Calculates the Average Dim Icecream As Single Dim Colddrinks As Single Dim Average As Integer Icecream = Colddrinks = Average = Icecream + Colddrinks / 2 = " The average = " & Average End Sub End Class (6) Add your examination number as a comment.