P.S: This is just a study guide. The questions may not appear exactly like this.
1. Which of the following is NOT a characteristic of variables?
• Declaration
• Initialization
• Span
• All of the above
2. Which of the following is NOT a valid VB data type?
• Char
• String
• Byte
• Letter
3. Which arithmetic operator has highest precedence?
• Division
• Modulus
• Addition
• Subtraction
4. Which of the following is an ILLEGAL multiple declaration?
• Dim var1, var2 As Double
• Dim var1 as Double, var2 as Integer
• Dim var2 as Double = 2, var2 as Integer = 7
• Dim var1 as Double var2 as Integer = 7
5. The proper arithmetic operator precedence, from first to last, is _____.
• subtraction, addition, and multiplication
• addition, subtraction, and multiplication
• exponentiation, division, and subtraction
• exponentiation, addition, and division
6. Which of the following is a Visual Basic built-in data type?
• Date
• Integer
• Double
• Boolean
• All of the above
7. To continue a long statement on another line, use _____.
• Ctrl + Enter
• an ampersand character
• a space followed by an underscore character
• There are no special characters required, just add a new line.
8. Assume that x, y, and temp are Integer variables. Which of the following lines of code swaps the values of x and y?
• temp = x
x = y
y = temp
• x = y
temp = x
y = temp
• x = y
y = x
• x = temp
x = y
y = temp
9. When the correct arithmetic operator precedence rules are applied, what will be the value of the following expression? 5 * 6 / 2 + 1
• 16
• 15
• 10
• 31
10. What will be the contents of the variable y after the following statement is executed? y = Math.Abs(((7 – 9) / 2) – 4)
• 1
• 5
• -1
• -5
11. Write statements that produce a message in the console with the words “US Motto” on one line and the message “E PLURIBUS UNUM” on a second line.