Prog I:
Semester Review
Multiple Choice
Identify the choice that best completes the statement or answers the question.
____ 1. What type of programming language is Visual Basic?
a. an assembly language
c. an object-oriented language
b. a machine language
d. a low-level language
____ 2. What can occur when the user interacts with an object?
a. an application occurrence
c. a handler
b. an event
d. nothing
____ 3. Which window displays the application interface and allows objects to be added, deleted, and
sized?
a. the Start window
c. the Code window
b. the Design window
d. the application window
____ 4. Which area of the IDE contains controls that are used to create objects on the interface?
a. the Toolbox
c. the Solution Explorer window
b. the Start Page
d. the Properties window
____ 5. Which area of the IDE is used to switch between the Design and Code windows?
a. the Toolbox
c. the Solution Explorer window
b. the Start page
d. the Properties window
____ 6. Which area of the IDE is used to change the text displayed in a Label object?
a. the Toolbox
c. the Solution Explorer window
b. the Start Page
d. the Properties window
____ 7. Which key combination is used to open the IDE Navigator?
a. Shift+Tab
c. Ctrl+Tab
b. Shift+F1
d. Ctrl+F1
____ 8. To size an object
a. select it and then use the arrow keys.
b. drag in the center of the object.
c. right-click the object and then select Resize.
d. select it and then drag a handle.
____ 9. Which is not a property of the Label control?
a. (Name)
c. Font
b. Text
d. Style
____ 10. Which is a difference in a form between the Design window and run time?
a. The controls on the form cannot be edited.
b. The form changes color.
c. The form gets much larger.
d. The form displays each object’s Name property.
____ 11. Converting a program to a language the computer understands is a process called
a. closing.
c. terminating.
b. conversion.
d. compiling.
____ 12. Which control is used to add a menu to an interface?
____ 13.
____ 14.
____ 15.
____ 16.
a. the Label control
c. the MenuStrip control
b. the RadioButton control
d. the AddMenu control
A set of instructions that tells the computer how to perform a task are called
a. a form.
c. objects.
b. an interface.
d. statements.
Together, the statements for an application are called
a. a form.
c. program code.
b. comments.
d. instructions.
A Click event procedure responds to
a. a mouse click.
c. dragging the title bar.
b. the pressing of a key on the keyboard. d. the movement of the mouse.
Which statement is used to stop program execution?
a. Application.Over()
c. Application.Exit()
b. Application.Halt()
d. Application.Quit()
____ 17. Which statement indicates the end of an event procedure?
a. End
c. End Procedure
b. End Sub
d. Sub
____ 18. Which statement declares an event procedure?
a. Start Sub
c. Application.New
b. End Sub
d. Sub
____ 19. Which type of statement is used in a procedure to change a value at run time?
a. a value statement
c. an object statement
b. a property statement
d. an assignment statement
____ 20. Which object is used to group related radio buttons?
a. a Label object
c. a MenuStrip object
b. a GroupBox object
d. a Button object
____ 21. Which control object should be used when the user must select only one option from a set of
options?
a. Button
c. RadioButton
b. Label
d. MenuStrip
____ 22. Which character begins a comment?
a. a colon (:)
c. a single quotation mark (')
b. a double quotation mark (")
d. a question mark (?)
____ 23. Which is the order of operations?
a. + * - /
c. - / + *
b. + / * d. * / + -
____ 24. In the event procedure above, which type of object is clicked in order to execute the Click event
procedure?
a. a Label object
c. a Form object
b. a Button object
d. a MenuStrip object
____ 25. In the event procedure above, what result is assigned to the label’s Text property?
a. 5 + 10 – 3
c. 12
b. 5
d. btnQuestion1
____ 26. In the event procedure above, what is the (Name) property of the Label object set to?
a. btnQuestion1
c. lblAnswer.Text
b. lblAnswer
d. Answer
____ 27. Which is a valid identifier?
a. $12
c. 55
b. Integer
d. diameter
____ 28. Which is a valid declaration statement?
a. Dim height and width As Integer
b. Dim height, width As Integer
c. Dim height As Integer, width As Integer
d. Dim height, Dim width As Integer
____ 29. How many values can a variable store at one time?
a. 1
c. 5
b. 2
d. 10
____ 30. Which operator is used to assign a new value to a variable?
a. =
c. *
b. ==
d. –
____ 31. Which statement declares the variable radius and assigns it a value of 15?
a. Dim radius = 15
c. Dim radius As Integer = 15
b. Dim radius As Integer == 15
d. Dim radius = 15 As Integer
____ 32. What is the final value of finalNumber after the last statement executes?
Dim startingNumber As Integer = 10
Dim finalNumber As Integer = 25
startingNumber = finalNumber / 5
finalNumber = startingNumber + 5
a. 5
c. 20
b. 10
d. 25
____ 33. In the assignment statement Dim x As Integer = 20, the value 20 is called
a. a variable
c. an initializer
b. a literal
d. an expression
____ 34. The TextBox control TextAlign property
a. sets the alignment of the text box to match it corresponding label.
b. determines what text is displayed in the text box.
c. sets the alignment of the text relative to the form.
d. sets the alignment of the text relative to the text box.
____ 35. The TextBox control (Name) property
a. sets the alignment of the text relative to the text box.
b. identifies a control for the programmer.
____ 36.
____ 37.
____ 38.
____ 39.
____ 40.
____ 41.
____ 42.
____ 43.
____ 44.
____ 45.
____ 46.
____ 47.
____ 48.
c. determines what text is displayed in the text box.
d. sets the alignment of the text relative to the form.
The TextBox control Text property
a. sets the alignment of the text relative to the text box.
b. identifies a control for the programmer.
c. determines what text is displayed in the text box.
d. sets the alignment of the text relative to the form.
Which should be used to let a user know what input is expected in an application?
a. a variable
c. a prompt
b. an identifier
d. a keyword
The statement weight=Val("Forty-eight kilograms") returns a value of
a. forty-eight.
c. 0.
b. 48.
d. 48 kilograms.
The statement weight=Val("48 kilograms") returns a value of
a. forty-eight and a half kilograms.
c. 0.
b. 48.
d. 48000.
A procedure that performs a task and returns a value is called
a. an assignment.
c. a function.
b. a TextChanged event.
d. an event procedure.
Which is executed when the user types in a text box?
a. a variable assignment.
c. a function.
b. a TextChanged event procedure.
d. an exception.
Which is not a primitive data type?
a. Integer
c. String
b. Double
d. Boolean
Which data type declares a variable that stores a true or false value?
a. Integer
c. Char
b. Double
d. Boolean
Which Visual Basic keyword is used to clear labels?
a. Default
c. Nothing
b. Erase
d. Static
Which data type declares a variable that stores a positive or negative whole number?
a. Integer
c. Char
b. Double
d. Boolean
How many bytes are used to store an Integer variable?
a. 2
c. 8
b. 4
d. 16
Which data type is most appropriate for whether an employee qualifies for a bonus?
a. Integer
c. Boolean
b. Decimal
d. Char
Which data type is most appropriate for the number of students in a class?
a. Integer
c. Boolean
b. Double
d. Char
____ 49. In the assignment statement Dim x As Integer = 5.6, x is assigned the value
a. 0.
c. 5.6.
b. 5.
d. 6.
____ 50. Which operator is used for modulus division?
a. /
c. %
b. \
d. Mod
____ 51. What is the result of the following expression when x is 3576?
(x\10) Mod 10
a. 6
c. 76
b. 7
d. 357
____ 52. What is the result of the following expression when x is 125?
x Mod 6
a. 0
c. 20
b. 5
d. 20.5
____ 53. A named memory location which stores a value that cannot be changed from its initial assignment
is called a
a. constant.
c. procedure.
b. variable.
d. function.
____ 54. Which keyword does a constant declaration begin with?
a. Static
c. Integer
b. Const
d. Final
____ 55. Which statement declares a constant named PRICE with a value of 5.25?
a. Const PRICE = 5.25
c. Const As Double PRICE = 5.25
b. Const PRICE As Double = 5.25
d. Final PRICE As Double = 5.25
____ 56. Which is not a Visual Basic keyword?
a. Date
c. False
b. Const
d. Start
____ 57. Which type of error occurs in statements that are syntactically correct, but produce undesired or
unexpected results?
a. syntax error
c. run-time error
b. semantic error
d. exception error
____ 58. Which type of error occurs when a statement violates the rules of Visual Basic?
a. syntax error
c. run-time error
b. semantic error
d. exception error
____ 59. A statement that has been marked as a stopping point is called a
a. watching statement.
c. debug statement.
b. breakpoint.
d. stop point.
____ 60. A Watch window can be used to
a. display the application interface.
b. examine values during the execution of a program.
c. switch to the Code window.
d. display online help.
____ 61. Given the following statements:
If guess = selected Then
Me.lblMessage.Text="Correct"
Else
Me.lblMessage.Text="Incorrect"
End If
What is displayed when guess is 8 and selected is 9?
a. Correct
b. Incorrect
c. nothing would be displayed
d. Correct on one line and Incorrect on the next line
____ 62. Given the following code segment:
Dim finished As Boolean = False
If finished Then
lblMessage.Text = "Game finished"
Else
lblMessage.Text = "Next round"
End If
Which will be displayed when the code segment is run?
a. False
b. Game finished
c. Next round
d. A syntax error will be generated because finished is not a correct Boolean
expression.
____ 63. Which statement should be used to decide among three or more actions?
a. If…Then statement
c. nested If…Then…Else statement
b. If…Then…Else statement
d. If…Then…ElseIf statement
____ 64. What kind of error do the following statements contain?
Dim grossPay As Decimal = 4250.50
If grossPay > 3000 Then
lblMessage.Text = "Your tax rate is 33%"
ElseIf grossPay > 4000
lblMessage.Text ="Your tax rate is 35%"
End If
a. a semantic error
b. a syntax error
____ 65. Given the following statements:
Select Case quantity
Case 0 To 10
c. a run-time error
d. an exception error
Me.lblMessage.Text = "Quantity is too low."
Case 11 To 20
Me.lblMessage.Text = "Quantity is in the correct range."
Case Else
Me.lblMessage.Text = "Quantity is too high."
End Select
What message would be displayed if quantity is 18?
a. Quantity is too low.
b. Quantity is in the correct range.
c. Quantity is too high.
d. No message would be displayed.
____ 66. Given the following statements:
Dim experience As Integer = 10
If experience > 5 Then
Me.lblMessage.Text="Sufficient Experience"
Else
Me.lblMessage.Text="Inexperienced"
End If
What is displayed when the statements execute?
a. Sufficient Experience
b. Inexperienced
c. nothing would be displayed
d. Sufficient Experience on one line and Inexperienced on the next line
____ 67. Given the following statements:
Select Case quantity
Case Is < 10
Me.lblMessage.Text = "Quantity is too low."
Case Is < 20
Me.lblMessage.Text = "Quantity is in the correct range."
Case Is >= 20
Me.lblMessage.Text = "Quantity is too high."
End Select
What message would be displayed if quantity is 20?
a. Quantity is too low.
b. Quantity is in the correct range.
c. Quantity is too high.
d. No message would be displayed.
____ 68. Given the following statements:
Select Case bestPrice
Case Is < 10
Me.lblMessage.Text = "Price is too low."
Case Is < 20
Me.lblMessage.Text = "Price is in the correct range."
Case Is >=20
Me.lblMessage.Text = "Price is too high."
End Select
____ 69.
____ 70.
____ 71.
____ 72.
____ 73.
____ 74.
What message would be displayed if bestPrice is 16?
a. Price is too low.
c. Price is too high.
b. Price is in the correct range.
d. No message would be displayed.
Using Rnd() alone generates random numbers
a. less than or equal to 0.
b. greater than or equal to 0 and less than 1.
c. greater than or equal to 0 and less than or equal to 1.
d. greater than or equal to 1.
The statement Me.lblRandNum.Text = Rnd()*100 generates random numbers
a. less than or equal to 100.
b. greater than or equal to 0 and less than 100.
c. greater than or equal to 100.
d. greater than or equal to 1 and less than or equal to 100.
Which statement generates random numbers greater than or equal to 10 and less than 51?
a. Rnd() * 41
c. 51 * Rnd() + 10
b. 10 * Rnd() + 51
d. 42 * Rnd() + 10
Which statement is included in the beginning of an event procedure to initialize the Rnd() function
so that different random numbers are generated from run to run?
a. Initialize()
c. Randomize()
b. Random()
d. RndInt()
Which is not a logical operator?
a. And
c. Not
b. Or
d. If
Which statement displays the following message box?
a. MessageBox.Show("Try again")
c. Show.Message("Try again")
b. MessageBox.Display("Try again")
d. Message.Show("Try again")
____ 75. Which statement correctly updates the counter amount?
a. amount = amount + 1
b. value = amount + amount
c. amount = value + 1
d. value = amount + value
____ 76. Which is used to place related check boxes together?
a. Label
c. ListBox
b. GroupBox
d. TextBox
____ 77. Which character can be used to continue a statement onto the next line?
a. an asterisk (*)
c. a hyphen (-)
b. an underscore (_)
d. an exclamation mark (!)
____ 78. Given the following statements:
Dim x As Integer = 0
Do
x=x+2
Loop While x < 10
How many times will the body of the Do…Loop execute?
a. 0
c. 5
b. 2
d. 10
____ 79. Given the following code segment:
Dim x As Integer = 4
Dim number As Integer = 10
Do While number > x
x=x+2
Me.lblNumbers.Text = x
Loop
Which will be displayed when the code segment is executed?
a. 4
c. 6 8 10
b. 6
d. 10
____ 80. Given the following code segment:
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?
a. 0
b. 10
____ 81. Given the following statements:
Dim x As Integer
Do
x=x+3
c. 18
d. An infinite loop will occur.
Loop While x <> 30
Which initial value of x will make the loop infinite?
a. 0
c. 7
b. 3
d. 15
____ 82. Which statement correctly updates the accumulator total?
a. total = Accumulator(total)
c. total = total + sale
b. total = total + total
d. total = sale + sale
____ 83. Given the following code segment:
Do While quantity < 50
numShipments += 1
inStock += quantityReceived
Loop
Which variable is the accumulator?
a. quantity
b. numShipments
____ 84. Given the following statements:
For x As Integer = 1 To 11
MessageBox.Show(x)
Next x
____ 85.
____ 86.
____ 87.
____ 88.
____ 89.
c. inStock
d. Loop
How many message boxes will be displayed?
a. 1
c. 11
b. 10
d. 12
The vbTab constant
a. left aligns text.
b. places a string into the next field of eight characters.
c. is used to move text to a new line.
d. places text in the center of a form.
Which Web color can be selected for an object so that the form BackColor shows through?
a. OldLace
c. Show Through
b. Clear
d. Transparent
Which ColorDialog control property is set to True to allow the user to create a custom color?
a. Name
c. Color
b. Transparent
d. AllowFullOpen
A user’s selection in the Color dialog box
a. is stored in the Color property of the ColorDialog component.
b. is stored in a constant declared at the top of a program.
c. automatically changes a form’s background color.
d. is stored in the (Name) property of the ColorDialog component.
When an image is tiled on a form, it is
a. repeated to fill the form.
c. transparent.
b. sized to fill the form.
d. displayed in black and white.
____ 90. Which is not a supported BackgroundImage file format?
a. BMP
c. JPG
b. GIF
d. PIC
____ 91. Which Visual Basic project folder stores images?
a. bin
c. obj
b. My Project
d. Resources
____ 92. Which statement must be included in an application that uses Windows operating system sounds?
a. Imports System.Play
c. Imports System.Media
b. Imports System.Sounds
d. Imports System.Music
____ 93. Which Visual Basic project folder stores sound files?
a. bin
c. obj
b. My Project
d. Resources
____ 94. The Timer control Interval property is specified in
a. milliseconds.
c. minutes.
b. seconds.
d. hours.
____ 95. If a timer should process an action every minute, then its Interval property should be set to
a. 1.
c. 1000.
b. 60.
d. 60000.
____ 96. What type of procedure is coded for each timer object added to an application?
a. a Timer event procedure
c. a TextChanged event procedure
b. a Tick event procedure
d. a MouseDown event procedure
____ 97. What does the “2” represent in the statement
Dim bluePen As New Pen(Color.Blue, 2)?
a. the pen color
c. the line thickness
b. the type of pen
d. the line length
____ 98. The upper-left corner of a drawing surface is represented by the coordinates
a. (0, 0).
c. (300, 0).
b. (0, 300).
d. (300, 300).
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
C
B
B
A
C
D
C
D
D
A
D
C
D
C
A
C
B
D
D
B
C
C
D
B
C
B
D
B
A
A
C
B
B
D
B
C
C
C
B
C
B
C
D
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
C
A
B
C
A
D
D
B
B
A
B
B
D
B
A
B
B
B
C
D
A
B
A
C
B
B
B
D
C
D
A
A
B
B
C
D
D
C
C
C
C
B
D
87
88
89
90
91
92
93
94
95
96
97
98
D
A
A
D
D
C
D
A
D
B
C
A
© Copyright 2026 Paperzz