Visual Basic I: Chapter 3
The statement weight=Val("Forty-eight kilograms") returns a value of...
0
How many values can a variable store at one time?
1
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
10
How many bytes are used to store an Integer variable?
4
The statement weight=Val("48 kilograms") returns a value of...
48
What is the result of the following expression when x is 125? x Mod 6
5
In the assignment statement Dim x As Integer = 5.6, x is assigned the value...
6
What is the result of the following expression when x is 3576? (x\10) Mod 10
7
Which operator is used to assign a new value to a variable?
=
What data type declares a variable that stores a true or false value?
Boolean
What data type is most appropriate for whether an employee qualifies for a bonus?
Boolean
What keyword does a constant declaration begin with?
Const
What statement declares a constant named PRICE with a value of 5.25?
Const PRICE As Double = 5.25
A valid declaration statement is...
Dim height, width As Integer
Which statement declares the variable radius and assigns it a value of 15?
Dim radius As Integer = 15
A constant value can be changed from its initial assignment.
False
A global declaration allows a variable to be accessible only in the procedure it is declared in.
False
A local declaration allows a variable to be accessible to any code in the Form class.
False
A run-time error is also called a syntax error.
False
A variable of type String is initialized to 0 by default.
False
An Integer variable that is declared but not initialized stores the value 1.
False
Identifiers are case sensitive.
False
If a value is large and could possibly have a decimal portion, Integer is the best data type choice.
False
In a numeric expression, integer division is performed after modulus division.
False
It is good programming practice to keep the scope of variable declarations as wide as possible.
False
Keywords can be used as variable identifiers.
False
Modulus division truncates the decimal portion of the quotient to result in an integer.
False
Multiple variables with different data types can be declared in a single statement.
False
The Integer data type requires more memory than the Double data type.
False
The value of a declared constant can be changed anywhere in the program code.
False
What data type declares a variable that stores a positive or negative whole number?
Integer
What data type is most appropriate for the number of students in a class?
Integer
What operator is used for modulus division?
Mod
What Visual Basic keyword is used to clear labels?
Nothing
An invalid Visual Basic keyword is...
Start
What is not a primitive data type?
String
A Char assignment requires double-quotation marks (").
True
A breakpoint is a statement that has been marked as a stopping point.
True
A module-level declaration is global to any code in the Form class.
True
A program with a semantic error will produce unexpected results.
True
A run-time error halts program execution at the statement that cannot be executed.
True
A run-time error will occur if a text box contains data that does not match the variable type.
True
A value with a decimal portion is automatically rounded to a whole number when assigned to an Integer variable.
True
A variable can be declared and initialized in the same statement.
True
A variable is a name for a value stored in memory.
True
A variable must be declared before it is used.
True
A variable of type Char is initialized to Nothing by default.
True
A variable of type Double is initialized to 0 by default.
True
An error will be generated when hello is assigned to an Integer variable.
True
An identifier can contain spaces.
True
Debugging is the process of getting an application to work correctly.
True
Grouping variables together in a single statement is good programming style only when the variables represent related items.
True
In Visual Basic, widget and Widget refer to the same variable.
True
Logic errors must be found by the programmer.
True
Nothing is a keyword.
True
The & operator is used to assign a new value to a variable.
True
The Val() function converts text box data to a numeric value.
True
The statement Dim Function As Integer will generate a syntax error.
True
The value of a constant can be assigned only in the declaration.
True
The value of a variable is changed through assignment.
True
Values represented by the Double data type are referred to as floating point.
True
What is executed when the user types in a text box?
a TextChanged event procedure
A procedure that performs a task and returns a value is called...
a function
A statement that has been marked as a stopping point is called a...
breakpoint
A named memory location which stores a value that cannot be changed from its initial assignment is called a...
constant
The TextBox control Text property...
determines what text is displayed in the text box
A valid identifier is...
diameter
A Watch window can be used to...
examine values during the execution of a program
The TextBox control (Name) property...
identifies a control for the programmer
In the assignment statement Dim x As Integer = 20, the value 20 is called...
literal
What should be used to let a user know what input is expected in an application?
prompt
What type of error occurs in statements that are syntactically correct, but produce undesired or un-expected results?
semantic error
The TextBox control TextAlign property...
sets the alignment of the text relative to the form
What type of error occurs when a statement violates the rules of Visual Basic?
syntax error