Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Section A
Section B
Section C
1. Coding
2. 1 Question
3. Total 25 marks
SAMPLE QUESTIONS
SHORT ANSWERS
1. Create variable names that would be appropriate for holding each of the following
information items: (4 Marks)
a. The number of backpacks sold this week
b. Today’s date
c. An item’s wholesale price
d. A customer’s name
2. Assuming that the variable dblTest contains the value 67521.584, complete the following
table, showing the value returned by each function call: (4 Marks)
3. Write a line (or lines) of code to carry out the task. (8 Marks)
(a) Make btnButton disappear.
(b) Set the color of the characters in the text box txtBox to red.
(c) Enable the disabled button btnOutcome.
(d) Give the focus to txtBoxTwo.
4. Table 1 below gives the terms used by the National Weather Service to describe the
degree of cloudiness. Write Select Case statements that use percentage of cloud cover
to display the appropriate descriptor. (6 Marks)
(a) Loop
intX = intX + 1
Do While intX < 100
(b) Do
lstOutput. Items.Add (“Hello”)
intX = intX + 1
While intCount < 10
6. Write a procedure named TimesTen that accepts a single Integer argument. When the
procedure is called, it should display the product of its argument multiplied by 10 in
message box. (6 Marks)
7. Write the code for a sequential search that determines whether the value -1 is stored in the array
named intValues. The code should print a message indicating whether the value is was found.
(14 Marks)
CODING
(a) Design a flowchart for the event handler btnCalcSale_Click, which calculates the total of
a retail sale. Assume the program uses txtRetailPrice, a TextBox control that holds the
retail price of the item being purchased, and decTAX_RATE, a constant that holds the sales tax
rate (6%). The event handler uses the items above to calculate the sales tax for the purchase and
the total of the sale. Display the total of the sale in a label named lblTotal. (4 Marks)
(b) Convert the flowchart you constructed into Visual Basic code. Write comments wherever
appropriate. (6 Marks)