Call Girls Nikol 7397865700 Ridhima Hire Me Full Night
Quiz 9 review sheet
1. Quiz 9 review sheet.
1. Val()function is used to convert an entry in an input box to a number
2. A set of statements that perform a task over and over again based on a condition is called a
loop.
3. A Do…Loop begins after the Boolean condition loops at least once. If the condition is true, the
loop repeats.
4. Repeating a set of statements is called iteration.
5. Accumulators are useful to keep running totals.
6. Do While quantity < 50
numShipments += 1
inStock += quantityReceived
Loop
Which variable is the accumulator? Quantity
7. Given the following statements:
Dim x As Integer = 0
Do
x = x + 2
Loop While x < 10
The Do Loop will execute 5 times. If x = 0, x + 2 = 2, loop, x + 2 = 4, loop, x + 2 = 6, loop, x + 2 =
8, loop, x + 2 = 10. Looping stops because x reaches 10. How many times did it loop? 5
including the first x + 2 = 2.
8. Given the following statements:
For x As Integer = 1 To 11
MessageBox.Show(x)
Next x
How many message boxes will be displayed? 12
9. The following statements would create an infinite loop.
Dim x As Integer = -2
Do While x < 0
x = x + 1
Loop
The answer is False.
10. Convert()is used to convert an entry in an input box to a number.
11. A flag is a condition that is used to run a program.
12. Given the following code segment:
2. Dim a As Integer = 0
Dim b As Integer = 0
Do While a < 10
b += a
Loop
Me.lblMessage.Text = b
Which output will be displayed? 0