VB2015 Quiz
a
" For intX As Integer = 10 To 99 " will end when intX contains the number __________ a. 100 b. 101 c. 110 d. 111
d
A procedure that allows the user to Enter one or more values. The first input instruction will get the first value only and is referred to as the ___________ read a. starter b. entering c. initializer d. priming
d
How many times will the MessageBox.Show method in the following code be processed? Dim intCount As Integer Do MessageBox.Show("Hello") intCount += 1 Loop While intCount > 4 a. 5 b. 0 c. 8 d. 4
d
How many times will the MessageBox.Show method in the following code be processed? Dim intCount As Integer Do While intCount > 4 MessageBox.Show("Hello") intCount += 1 Loop a. 5 b. 4 c. 1 d. 0
a
How many times will the MessageBox.Show method in the following code be processed? For intCount As Integer = 6 To 13 Step 2 Messagebox.Show("Hello") Next intCount a. 4 b. 8 c. 3 d. 5
c
The computer will stop processing the loop in " For intCount As Integer = 6 To 13 Step 2 Messagebox.Show("Hello") Next intCount" when the intCount variable contains the number a. 11 b. 12 c. 14 d. 13
d
The instructions in a ________________ loop might not be processed at all, whereas the instructions in a ___________ loop are always processed at least once. a. pretest, posttest b. pretest, pretest c. posttest, posttest d. posttest, pretest
d
The items in a list box belong to which collection? a. Values b. List c. ListItems d. Items
b
What will the following code displaty in the lblAsterisks control? For intX As Integer = 1 To 2 For intY As Integer = 1 To 3 lblAsterisks.Text = lblAsterisks.Text & """ Next intY lblAsterisks.Text = lblAsterisks.Text & ControlChars.NewLine Next intX a. ** ** ** b. *** *** c. *** *** *** *** d. *** *** ***
d
What will the following code display? Dim intSum As Integer Dim intY As Integer Do while intY < 3 For intX As Integer 1 To 4 intSum += intX Next intX lblSum.Text = intSum.ToString a. 15 b. 5 c. 8 d. 30
b
Which event occurs when the user selects a different item in a list box? a. none of the below b. SelectedValueChanged c. SelectedItemChanged d. SelectionChanged
b
Which of the folloiwng statements selects the fourth item in the lstNames control? a. lstNames.SelectIndex = 4 b. lstNames.SelectedIndex = 3 c. lstNames.SelectedIndex = 4 d. lstNames.SelectIndex = 3
c
Which of the following For clauses indicates that the loop instructions should be processed as long as the intX variable's value is less than 100? a. none of the below b. For intX As Integer = 10 To 101 c. For intX As Integer = 10 To 99 d. For intX As Integer = 10 To 100
a
Which of the following clauses stops the loop when the value in the intPopulation variable is less than the number 5000? a. All of the below b. Do While intPopulation >= 5000 c. Do Until intPopulation < 5000 d. Loop While intPopulation >= 5000
c
Which of the following methods is used to add items to a list box? a. ItemAdd b. AddList c. Add d. Item
a
Which of the following properties stores the index of the item selected in a list box? a. SelectedIndex b. SelectionIndex c. Index d. Selection
b
Which of the following statements can be used to code a loop whose instructions you want processed 10 times? a. For...Next b. Either A or C c. Do...Loop d. None of the above
b
Which of the following statements is equivalent to the statement dblTotal = dblTotal + dblScore? a. dblTotal =+ dblScore b. dblTotal += dblScore c. dblScore =+ dblTotal d. dblScore += dblTotal
a
Which of the following statements pauses program execution for one second? a. System.Threading.Thread.Sleep(1000) b. System.Threading.Thread.Pause(1000) c. System.Threading.Thread.Sleep(100) d. System.Threading.Thread.Pause(1)