National Certificate (Vocational) : NQF Level 2
National Certificate (Vocational) : NQF Level 2
National Certificate (Vocational) : NQF Level 2
(10041022)
565Q2S2130
TIME: 4 HOURS
MARKS: 100
3. Candidates must print the answers immediately after they have completed the
question. A candidate's EXAMINATION NUMBER must appear on all printouts
as no question without a printed EXAMINATION NUMBER will be marked.
5. All computer work should be saved at regular intervals to prevent loss of work.
No additional time may be allowed for work lost due to lack of saving.
6. No candidate may print his/her work for another candidate, or make a memory
stick available to another candidate or access another candidate's work on the
network. Any attempt to access any 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.
7. All PRINTOUTS and SCREEN PRINTS done during the session must be
handed in.
9. Candidates may not copy the source code from VB.NET to MS Word to be
printed from the word processor.
10.2 Hold the ALT key down and press the PrintScreen button (This will
copy the active screen).
10.4 Add your EXAMINATION NUMBER to the top right-hand side of the
page.
12. The following files will appear in the folders on the hard drive:
12.1 QUESTION 1
… \DeveloperConference
IMAGE: Developer.png
… \IMAGES
12.2 QUESTION 2
… \CalPriceIncrease
12.3 QUESTION 3
… \ComputeTestAverage
12.3 QUESTION 4
… ShoppingList
QUESTION 1
The following questions refer to the VB.NET program Developers Conference that has
been saved on the computer.
With the evolution of 4IR a team of developers is planning a conference. You and your
team offered to design an application to help register conference attendees.
The program allows the user to enter a corporate ID, first name, last name, select a
number of days for training, select a pre-course and check the course to attend.
When the user clicks the Calculate Cost button, Cost Information is displayed in a label
at the bottom of the program.
You have to design the graphical user interface for the program.
NOTE: No code is required for this question. You are only required to create the
graphical user interface.
Use FIGURE 1 below and the instructions which follow as a guide to help you complete
the interface.
FIGURE 1
Open the program DeveloperConference and follow the instructions below to complete
the blank interface which has been saved on the computer.
1.2 Add FOUR GROUP BOXES to the form, to group the Lawyer Information,
Client Details, Case Types and Payment Information.
1.3 Add SIX LABELS to the form, one for the Title, Corporate ID, first name, last
name, number of days, and one to display the conference costs information.
Registration
Label lbCorporateID Corporate ID: Default
Label lblFirstName First name: Default
Label lblLastName Last name: Default
Label lblNumber Number of days Default
Label lblDisplay (Blank) Border: Fixed Single
Size: See Figure 1 (9)
1.4 Add THREE TEXT BOXES to the form to enter the Corporate ID, First Name
and Last Name.
CONTROL
Text Box
Text Box
NAME
txtCorporateID
txtFirstName
(Blank)
(Blank)
TEXT
Text Box txtLastname (Blank) (3)
1.6 Add a RADIO BUTTON to the form, to indicate whether or not the client has
legal insurance, and also to select the case type.
1.7 Add THREE COMBO BOXES to the form to choose the course.
1.8 Add THREE BUTTONS to the form, one to process the payment, one to clear
all the fields on the form, and one to exit the program.
1.9 Change the text in the title of the form to your EXAMINATION NUMBER and
make a PRINTOUT of the form.
(2)
[26]
QUESTION 2
The following questions refer to the VB.NET program called CalPriceIncrease that has
been saved on the computer.
To determine the percentage with which a store increases the price of items an
application must be designed that can be used to determine the percentage increase
per item in a store:
The program should be able to calculate and determine if there is a percentage increase
for an item:
Clicking on the Calculate Increase button should then result in the percentage rate being
displayed to the user.
Use the IPO chart below to help you with the program.
INPUT PROCESSING OUTPUT
ItemName Calculate Percentage: ItemName
yearOnePrice PercentRate
yearTwoPrice PercentRate = (Price1 x Price2) / Price1 × 100
FIGURE 2 below is a screen print of the user interface. The completed interface has
been saved on the computer.
Open the solution CalPriceIncrease and follow the instructions to complete the program.
FIGURE 2
The following steps explain how to use the program in order to calculate percentage
increase or decrease of an item:
STEP 1 RUN the program and enter the Item, Price1, and Price2.
2.2 Add the following program code to the click event of the Calculate button:
2.2.2 Determine that the item text box is not empty. If it is empty display a
message box, set focus. Else assign the value from the item text box
to the appropriate variable. (3)
2.2.3 Determine if the text boxes of price1 and price 2 contain numeric
values. If nonnumeric then display a message box, set focus. Else
assign the value from the price text box to the appropriate variable. (5)
2.2.5 Determine that the percentage increase rate is greater than zero and
if is greater than zero display the calculated increase percentage in
the label as shown in Step 2 above. (6)
2.3 Clicking the Clear Button should clear the textbox and the label, as well as set
focus on Price1 text box. (3)
QUESTION 3
The following questions refer to the VB.NET program called ComputeTestAverage that
has been saved on the computer.
You designed an application to help candidates determine their performance early in the
year by calculating their test marks for theory and practical work to get an average mark
indicating pass or fail.
The program allows the user to enter the theory mark and practical mark as follows:
The program determines the average and displays a message indicating either pass or
fail with the average mark.
Use the IPO chart below to help you with the program:
FIGURE 3 is a screen print of the user interface. The completed interface has been
saved on your computer. Open the solution ComputeTestAverage and follow the
instructions to complete the program.
FIGURE 3
STEP 1 RUN the program and enter the theory mark and the practical mark.
STEP 2 Click the Calculate Average button to calculate and display the Average mark
as below.
3.1 Add the following program code to the click event of the Calculate Average
button:
3.1.2 Determine that the theory and practical text boxes contain numeric
values If empty, alert the user with an error message, set the focus
to the theory text box and clear values. (5)
3.1.3
Convert and assign the values from the text boxes to the appropriate
variables. (2)
3.1.4 Calculate the average mark for theory and practical. (2)
3.1.5 Determine that the Average mark is greater than or equal to 50,
using (an) <if> statement. (3)
3.2 Clicking the Clear Button should display a message alerting the user about
clearing the text boxes, the display label and set focus to theory text box.
3.3
Clicking the Exit button should close the program.
(6)
(1)
QUESTION 4
The following questions refer to the VB.NET program ShoppingList that has been saved
on the computer.
You designed an application that allows you to enter items you want to buy and their
prices until you enter X to stop the program and to calculate and display the total cost of
the items.
FIGURE 4
STEP 1 RUN the program and click the Create ShoppingLlist button to enter all the
shopping list items:
STEP 3
Enter X to stop entering items and display the output of the program in the
Shopping List box.
STEP 4 The Clear button clears shopping list on the form.
STEP 5 When the Exit button is clicked, the following message is displayed:
Clicking the OK button closes the application, while clicking the Cancel button
leaves the program running.
The application contains numerous syntax and logical errors, and you must debug the
source code.
Below is a PRINTOUT of the program code with all the syntax and logical errors still
present.
Public Class frmShoppingList
'declare variables
DimstrItem As String
Dim decPrice As Decimal
Dim decTotalPrice As Decimal
End If
'determine that the user enters a number for an item
price
Next
lstShoppingList.Items.Add(======================')
lstShoppingList.('TOTAL PRICE = ' & .ToString('c'))
End Sub
End Sub
End Class
4.1 Open the program ShoppingList and correct all the syntax and logical errors in
the code. (18)
4.2 Add your EXAMINATION NUMBER to the source code as indicated and make
a PRINTOUT of the source code. (1)
4.3 Add you EXAMINATION NUMBER to the title bar of the form, and enter the test
data below.
Item Price
Bread 15
Milk 22
Eggs 90
Copyright reserved