Exam 4: Variables and Arithmetic Operations
What are the rules for naming variables in Visual Basic? Providing examples of the good and the bad, discuss what impact good programming practice has on the naming of variables.
The name must begin with a letter or an underline symbol (_). The name can contain letters, numbers, or the underline symbol. It cannot contain spaces or other special characters. Reserved words in Visual Basic cannot be used for variable names; reserved words appear in blue in the code window. Good programming practice dictates that the variable names you use should reflect the actual values to be placed in the variable. That way, anyone reading the program code can easily understand the use of the variable. For example, a good variable name for a string variable that will contain an employee's last name would be strEmployeeLastName. Names you should not use include strXXX, strLN, strEmp, or strName. Each of these names is imprecise and potentially misleading. You should consider the people who will be reading your code when you name the variables in your program. Your goal must be to make the task of reading your code as clear and easy as possible.
A(n) ____ Exception occurs when a calculation creates a value larger than one that can be processed by a procedure.
D
A(n) ____________________ specifier is used to identify the number of positions to the right of the decimal point that should be returned when displaying numeric data.
precision
The ____ indicates that a statement is an assignment statement.
When using ____ division (\), any remainder amount is dropped or truncated.
Does entering Dim intValue = 1 provide an error in Visual Basic 2015? Explain why or why not, and the significance of this.
A(n) ____________________ will contain a permanent value throughout the execution of the program.
An Overflow Exception will occur if the user enters a value greater than the maximum value that can be processed by the statement.
The CancelButton property of the Windows Form object allows you to specify which button is activated when the CTRL key on the keyboard is pressed.
A local variable is a variable that can only be accessed in the region in which it was defined.
A prefix of ____ is used to denote that a variable has been defined as a Boolean data type.
The ____________________ property of a TextBox object controls the alignment of the text content.
A(n) ____________________ is a procedure that returns a value when it is called.
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)