Visual Basic Net
Visual Basic Net
Kolej Selatan
Final Examination
Semester 2 / Year 2011
COURSE
COURSE CODE
TIME
DEPARTMENT
LECTURER
Students ID
Batch No.
:
:
Notes to candidates:
1) The question paper consists of 6 pages
x 2 marks= 20 marks )
Please choose most appropriate answer. State the answer in the answer booklet.
1. You use the ____ method to add items to a list box.
a. AddList
c. AddItems
b. Item
d. Add
2. Which of the following will return a random value within the range of 1 to 10?
a. randomGenerator.Next(0,11)
c. randomGenerator.Next(0,10)
b. randomGenerator.Next(1,10)
d. None of above
b. 4
d. 10
b. Hel
d. None of above
b. 5
d. None of above
1/6
b. 5
d. None of above
9. Which of the following statements sort the Hello array in descending order?
a. Sort(Hello)
c. Array.Sort(Hello)
b. Hello.Reverse()
d. Array.Reverse(Hello)
10. If the elements in two or more array are related by their subscripts, the arrays are called
as ______ arrays.
a. parallel
c. matching
b. coupled
d. associated
2/6
3/6
Figure 1.0
4/6
Figure 1.1
c) Write a function to for ADD ID and ADD SCORE button. For the ADD ID button, once
clicked, ID will added to IdListBox while once click the ADD SCORE button, score
will be added to ScoreListBox. If there is no value in ID text or Score textbox, the
system will pop out a message dialog to inform the user Invalid Input. Figure 1.1
show the output (5 marks)
Figure 1.2
d) Write a search function for Search ID button. The system should able to retrieve
relevant score value in Label 6 based on the ID number in IDTextBox. You are required
to create an public String sArrayID(100) and public integer sArrayScore(100) to
hold the value of ID and Score respectively. Figure 1.0 show the example output of this
function. (13 marks)
5/6
6/6