Willis 3220 Chapter 6
What will the following code display in the lblAstericks control? For intX As Integer = 1 To 2 For intY As Integer = 1 To 3 lblAstericks.Text = lblAstericks.Text & "*" Next intY lblAstericks.Text = lblAstericks.Text & ConrolChars.NewLine Next intX
*** ***
The loop controlled by the correct For clause For intX As Integer = 10 To 99 will end when the intX variable contains the number ________. 100 101 111 110
100
The computer will stop processing the loop For intCount As Integer = 6 To 13 Step 2 MessageBox.Show("Hello") Next intCount) when the intCount variable contains the number 11 12 13 14
14
What will the following code display in the lblSum control? Dim intSum As Integer Dim intY As Integer Do While intY < 3 For intX As Integer = 1 To 4 intSum += intX Next intX intY += 1 Loop lblSum.Text = intSum.ToString
30
Which of the following methods is used to add items to a list box? Add AddList Item ItemAdd
Add
Which of the following clauses stops the loop when the value in the intPopulation variable is less than the number 5000? Do while intPopulation >= 5000 Do while intPopulation < 5000 Loop while intPopulation >= 5000 All of the above
All of the above
Which of the following For clauses indicates that the loop instructions should be processed as long as the intX variables value is less than 100? For intX As Integer = 10 To 100 For intX As Integer = 10 To 99 For intX As Integer = 10 To 101 None of the above
For intX As Integer = 10 To 99
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
Four
The items in a list box belong to which collection? Items ListItems List Values
Items
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
One
The instructions in a ____________ loop might not be processed at all, wereas the instructions in a _________ loop are always processed at least once. Posttest, Pretest Pretest, Posttest
Pretest, Posttest
Which of te following properties stores the index of the item selected in a list box? Index Selection SelectedIndex SelectionIndex
SelectedIndex
Which event occurs when the user selects a different item in a list box? SelectionChanged SelectedItemChanged SelectedValueChanged none of the above
SelectedValueChanged
Which of the following statements pauses program execution for one second? System.Threading.Thread.Pause(1000) System.Threading.Thread.Sleep(1000) System.Threading.Thread.Pause(1) System.Threading.Thread.Sleep(100)
System.Threading.Thread.Sleep(1000)
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
Zero
Selection
choosing between multiple variables (not from the book's definition)
Which of the following statements is equivalent to the statement dblTotal = dblTotal + dblScore? dblTotal += dblScore dblScore += dblTotal dblTotal =+ dblScore dblScore =+ dblTotal
dblTotal += dblScore
Which of the following statements can be used to code a loop whose instructions you want processed 10 times? Do .. Loop For ... Next either a or b
either a or b
Which of the following statements selects the fourth item in the LstNames control? lstNames.SelectIndex = 3 lstNames.SelectedIndex = 3 lstNames.SelectIndex = 4 lstNames.SelectedIndex = 4
lstNames.SelectedIndex = 3
Sequence
order of operations (not from the book's definition)
A procedure 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 entering priming initializer starter
priming
Repetition
repeating sequence to go back to the top (not from the book's definition)