Computer 4
Chapter 3 and 4 Exam

1. Which of the following is not a Visual Basic built-in data type?
Word
Currency
Single
Long

2. In order for option buttons to work as expected, they must be grouped in a
label
window
frame
commmand button


3. Which statement should be included in a program to help prevent errors associated with variable declarations?
Variable
Option Explicit
Const
Option Variable


4. What is the value calculated by Visual Basic for 6 \ 4?
1.5
1
2
This expression is illegal in Visual Basic


Questions 5 through 7refer to the following application:

Option Explicit

Private Sub txtWord_Change()
lblDisplayWord.Caption = ""
End Sub

Private Sub optLarge_Click()
Dim strDisplayWord As String
strDisplayWord = txtWord.Text
lblDisplayWord.Caption = strDisplayWord
lblDisplayWord.Font.Size = 20
End Sub

Private Sub optSmall_Click()
Dim strDisplayWord As String
strDisplayWord = txtWord.Text
lblDisplayWord.Caption = strDisplayWord
lblDisplayWord.Font.Size = 5
End Sub

5. What happens when the user clicks on the Small option button?
The word entered by the user is displayed as size 20
The word entered by the user is displayed as size 5
Nothing happens
The word entered by the user is deleted from the text box


6. What is the value of strDisplayWord in the optLarge_Click() event procedure?
Large
False
dog
strDisplayWord has no value


7. What happens when the user types a word in the text box?
The word entered by the user is displayed as size 20
The word entered by the user is displayed as size 5
Nothing happens
The label is cleared



8. What is the value calculated by Visual Basic for 6 Mod 4?
1.5
1
2
This expression is illegal in Visual Basic


9. A syntax error is a result of
an error that occurs when a program is run
a statement that violates the rules of Visual Basic
a statement that includes too many variable declarations
a value that is out of range


10. The process of running an application and entering data to reveal any errors is called
debugging
specifying
coding
testing


11. Visual Basic applications
are event-driven
are object-oriented
contain an interface and program code
All of the above are correct


12. Which statement is used to terminate an application?
Stop
Finish
Unload
Terminate


13. The properties of an object
can be accessed at run-time only
contain only the code for an object
define the appearance, behavior, position, and other attributes of an object
cannot be changed by the programmer


14. Which statement is a Visual Basic programming guideline?
Do not use the Object list in the Code Editor window to select the object event procedures.
Do not name any of the objects
Write all code and then name the objects
Create the application interface first


15. The Caption property
identifies an object and is used by the programmer
changes the text displayed in an object
is used to display a dialog box for changing the font, font style, and size of an object's Caption
sets the alignment of a label object


16. An event procedure
is the name for the process used to write Visual Basic code
is a block of code that executes in response to an event
can contain only one line of code
can be written for only click events


Questions 17 through 19 refer to the following application:

Private Sub cmdGoodbye_Click()
lblMessage.Caption = "Good-bye"
End Sub

Private Sub cmdDone_Click()
Unload Me
End Sub


17. What happens when the user clicks on the Good-bye button?
The application terminates
The Done button displays Good-bye
The label displays Good-bye
Nothing happens when the user clicks on the Good-bye button


18. What happens when the user clicks on the Done button?
The application terminates
The Done button displays Good-bye
The label displays Good-bye
Nothing happens when the user clicks on the Done button


19. What happens when the user clicks on the label?
The application terminates
The Done button displays Good-bye
The label displays Good-bye
Nothing happens when the user clicks on the label



20. The Form_Load() event procedure
cannot contain code
is automatically executed when an application is run
is executed when an application is terminated
should not appear in the Code Editor window


Name:

Score =

Application Section