Deck 3: Using Variables and Constants

Full screen (f)
exit full mode
Question
A blank space must precede and follow the concatenation operator (&).
Use Space or
up arrow
down arrow
to flip the card.
Question
A variable can be declared in more than one procedure without generating an error.
Question
A static variable is a procedure-level variable that retains its value even when the procedure in which it is declared ends.
Question
Integer, Long, and Short memory variables can store floating-point numbers.
Question
Data types and classes are not related to each other.
Question
Named constants make programs more self-documenting and easier to modify.
Question
The data type returned by the Val function is Short data type.
Question
Computers can process data stored in memory variables faster than data stored in a property of a control.
Question
Data declared as Decimal data type is not subject to small rounding errors that may occur with floating-point numbers.
Question
A named constant in a program can never be changed during program execution.
Question
A variable declared in the declaration section of a form is called a procedure-level variable.
Question
A form button that has a darkened border when it does not have the focus is called the default button.
Question
A variable that has procedure scope is available to all procedures in the application.
Question
All numeric variables are initialized to zero lacking code to the contrary.
Question
The distance to the sun is 93,000,000 miles, which can be written using exponential notation as 93.0E5.
Question
Boolean variables, when created, are always true unless otherwise stated.
Question
Single and Double type memory variables can hold floating-point numbers.
Question
A Short memory variable uses twice the amount of memory as an Integer variable.
Question
When the Cancel button or the Close button is clicked on a dialog box created by the InputBox function, default value of the dialog box is used.
Question
It is a good practice to use the data type with the largest storage requirements to maintain program efficiency.
Question
A variable that was not assigned a specific data type is assigned which data type?

A) Char
B) String
C) Boolean
D) Object
Question
A memory variable that is a Decimal data type requires ____ bytes of storage.

A) 2
B) 4
C) 8
D) 16
Question
When using the Visual Basic .NET InputBox function which of the following is the recommended standard?

A) sentence capitalization for both prompt and title
B) book title capitalization for the title and sentence capitalization for the prompt
C) book title capitalization for both prompt and title
D) Pascal case for both
Question
The Visual Basic .NET verb to create a variable is ____.

A) Declare
B) Create
C) Dim
D) Const
Question
The assignment symbol in Visual Basic .NET is the ____ symbol.

A) ^
B) <
C) >
D) =
Question
The least efficient data type, because the computer must determine the contents of the memory location first, is the ____ data type.

A) Boolean
B) Short
C) Integer
D) Object
Question
A literal constant is an item of data whose value does not change while the application is running.
Question
The Visual Basic .NET operator that concatenates two or more strings together is ____.

A) @
B) %
C) &
D) #
Question
Date variables are automatically set to which value when created?

A) 12:00 AM January 1, 1980
B) 12:00 AM January 1, 2000
C) 12:00 AM January 1, 0001
D) 12:00 AM January 1, 0000
Question
You can eliminate the problems that occur as a result of implicit type conversions by entering the Option Explicit On statement in the General Declarations section of the Code Editor window.
Question
Spaces are allowed in variable names.
Question
String and object variables are initialized to ____ when created.

A) spaces
B) Nothing (no data at all)
C) the word "Nothing"
D) zero
Question
The practice of capitalizing the first letter in the second and subsequent words in variable names is referred to as the Hungarian notation.
Question
Which of the following keys is used to select the default button?

A) Enter
B) Esc
C) Tab
D) Shift
Question
A memory variable that is a Single data type requires ____ bytes of storage.

A) 2
B) 4
C) 6
D) 8
Question
A variable's lifetime indicates how long the variable remains in the computer's internal memory.
Question
To force a procedure-level variable to retain its value even when the procedure in which it is declared ends execution, you must make it a ____ variable.

A) constant
B) persistent
C) static
D) const
Question
This combination of characters Chr(13) & Chr(10) forces Visual Basic .NET ____.

A) to issue a carriage return followed by a line feed
B) to exit the routine and restart
C) to restart from the beginning of the subroutine
D) to strip the remainder of the routine
Question
A memory variable that is a Double data type requires ____ bytes of storage.

A) 2
B) 4
C) 6
D) 8
Question
A default button is identified by setting the Windows form's ____ property.

A) DefaultButton
B) AcceptButton
C) SelectedButton
D) CancelButton
Question
A variable name must begin with a letter or the ____.

A) ampersand (&)
B) percent sign (%)
C) exclamation mark (!)
D) underscore (_)
Question
A control's ____ event occurs when the contents of a control's Text property are altered.

A) CodeChanged
B) TextChanged
C) ChangedText
D) TextModified
Question
The keyword ____ is used to create a named constant within a Visual Basic .NET program.

A) Fixed
B) Const
C) ConstantFixed
D) Perm
Question
The ____ keyword in a procedure header is used to associate a procedure with different objects or events.

A) private
B) handles
C) local
D) associate
Question
The ____ class contains methods that you can use to convert a numeric value to a specified data type.

A) Convert
B) Format
C) Parse
D) Number
Question
Which of the following can store a floating-point number?

A) Single
B) Long
C) String
D) Integer
Question
To produce output of the number 125 as $125.00 you would use which of the following functions?

A) CurrencyFormat
B) Format$
C) Format
D) FormatOutput
Question
Every numeric data type in Visual Basic .NET has a ____ method that can be used to convert a string to that numeric data type.

A) Convert
B) Format
C) Parse
D) Number
Question
Instead of storing data in the properties of various controls, programmers can create ____, which are named memory locations to store data.

A) characters
B) variables
C) integers
D) strings
Question
The ____ of a variable determines where in the program a variable can be used.

A) dim
B) type
C) scope
D) extent
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/50
auto play flashcards
Play
simple tutorial
Full screen (f)
exit full mode
Deck 3: Using Variables and Constants
1
A blank space must precede and follow the concatenation operator (&).
True
2
A variable can be declared in more than one procedure without generating an error.
True
3
A static variable is a procedure-level variable that retains its value even when the procedure in which it is declared ends.
True
4
Integer, Long, and Short memory variables can store floating-point numbers.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
5
Data types and classes are not related to each other.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
6
Named constants make programs more self-documenting and easier to modify.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
7
The data type returned by the Val function is Short data type.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
8
Computers can process data stored in memory variables faster than data stored in a property of a control.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
9
Data declared as Decimal data type is not subject to small rounding errors that may occur with floating-point numbers.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
10
A named constant in a program can never be changed during program execution.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
11
A variable declared in the declaration section of a form is called a procedure-level variable.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
12
A form button that has a darkened border when it does not have the focus is called the default button.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
13
A variable that has procedure scope is available to all procedures in the application.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
14
All numeric variables are initialized to zero lacking code to the contrary.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
15
The distance to the sun is 93,000,000 miles, which can be written using exponential notation as 93.0E5.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
16
Boolean variables, when created, are always true unless otherwise stated.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
17
Single and Double type memory variables can hold floating-point numbers.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
18
A Short memory variable uses twice the amount of memory as an Integer variable.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
19
When the Cancel button or the Close button is clicked on a dialog box created by the InputBox function, default value of the dialog box is used.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
20
It is a good practice to use the data type with the largest storage requirements to maintain program efficiency.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
21
A variable that was not assigned a specific data type is assigned which data type?

A) Char
B) String
C) Boolean
D) Object
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
22
A memory variable that is a Decimal data type requires ____ bytes of storage.

A) 2
B) 4
C) 8
D) 16
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
23
When using the Visual Basic .NET InputBox function which of the following is the recommended standard?

A) sentence capitalization for both prompt and title
B) book title capitalization for the title and sentence capitalization for the prompt
C) book title capitalization for both prompt and title
D) Pascal case for both
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
24
The Visual Basic .NET verb to create a variable is ____.

A) Declare
B) Create
C) Dim
D) Const
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
25
The assignment symbol in Visual Basic .NET is the ____ symbol.

A) ^
B) <
C) >
D) =
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
26
The least efficient data type, because the computer must determine the contents of the memory location first, is the ____ data type.

A) Boolean
B) Short
C) Integer
D) Object
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
27
A literal constant is an item of data whose value does not change while the application is running.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
28
The Visual Basic .NET operator that concatenates two or more strings together is ____.

A) @
B) %
C) &
D) #
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
29
Date variables are automatically set to which value when created?

A) 12:00 AM January 1, 1980
B) 12:00 AM January 1, 2000
C) 12:00 AM January 1, 0001
D) 12:00 AM January 1, 0000
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
30
You can eliminate the problems that occur as a result of implicit type conversions by entering the Option Explicit On statement in the General Declarations section of the Code Editor window.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
31
Spaces are allowed in variable names.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
32
String and object variables are initialized to ____ when created.

A) spaces
B) Nothing (no data at all)
C) the word "Nothing"
D) zero
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
33
The practice of capitalizing the first letter in the second and subsequent words in variable names is referred to as the Hungarian notation.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
34
Which of the following keys is used to select the default button?

A) Enter
B) Esc
C) Tab
D) Shift
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
35
A memory variable that is a Single data type requires ____ bytes of storage.

A) 2
B) 4
C) 6
D) 8
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
36
A variable's lifetime indicates how long the variable remains in the computer's internal memory.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
37
To force a procedure-level variable to retain its value even when the procedure in which it is declared ends execution, you must make it a ____ variable.

A) constant
B) persistent
C) static
D) const
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
38
This combination of characters Chr(13) & Chr(10) forces Visual Basic .NET ____.

A) to issue a carriage return followed by a line feed
B) to exit the routine and restart
C) to restart from the beginning of the subroutine
D) to strip the remainder of the routine
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
39
A memory variable that is a Double data type requires ____ bytes of storage.

A) 2
B) 4
C) 6
D) 8
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
40
A default button is identified by setting the Windows form's ____ property.

A) DefaultButton
B) AcceptButton
C) SelectedButton
D) CancelButton
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
41
A variable name must begin with a letter or the ____.

A) ampersand (&)
B) percent sign (%)
C) exclamation mark (!)
D) underscore (_)
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
42
A control's ____ event occurs when the contents of a control's Text property are altered.

A) CodeChanged
B) TextChanged
C) ChangedText
D) TextModified
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
43
The keyword ____ is used to create a named constant within a Visual Basic .NET program.

A) Fixed
B) Const
C) ConstantFixed
D) Perm
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
44
The ____ keyword in a procedure header is used to associate a procedure with different objects or events.

A) private
B) handles
C) local
D) associate
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
45
The ____ class contains methods that you can use to convert a numeric value to a specified data type.

A) Convert
B) Format
C) Parse
D) Number
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
46
Which of the following can store a floating-point number?

A) Single
B) Long
C) String
D) Integer
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
47
To produce output of the number 125 as $125.00 you would use which of the following functions?

A) CurrencyFormat
B) Format$
C) Format
D) FormatOutput
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
48
Every numeric data type in Visual Basic .NET has a ____ method that can be used to convert a string to that numeric data type.

A) Convert
B) Format
C) Parse
D) Number
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
49
Instead of storing data in the properties of various controls, programmers can create ____, which are named memory locations to store data.

A) characters
B) variables
C) integers
D) strings
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
50
The ____ of a variable determines where in the program a variable can be used.

A) dim
B) type
C) scope
D) extent
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
locked card icon
Unlock Deck
Unlock for access to all 50 flashcards in this deck.