Mixed 55.doc

CLICK HERE TO DOWNLOAD THIS ANSWER INSTANTLY

1. (TCO 4) Which of the following is true about If statements? (Points : 3)
An If statement can contain a single alternative, dual alternatives, or multiple alternatives.
You must always surround a single statement after the keyword if with parentheses.
You must always match an if with an else.
An else must always be associated with an if, and vice versa.
All of the above
2. (TCO 4) Relational operators allow you to _____ numbers. (Points : 3)
add
multiply
average
compare
3. (TCO 4) In order for a logical AND to return true, which of the following statements must be true? (Points : 3)
Only one of the two conditions being evaluated must be false.
Both conditions being evaluated must be false.
Only one of the two conditions being evaluated must be true.
Both conditions being evaluated must be true.
4. (TCO 4) Given the case statement below, what would be the value of dblVariable after the code executes?
Dim strVariable As String
strVariable = “F”
Select Case strVariable
Case “A”
dblVariable = 10000
Case “B”
dblVariable = 20000
Case “C”
dblVariable = 30000
Case Else
dblVariable = 40000
End Select (Points : 3)
10000
20000
30000
40000
5. (TCO 6) Why would a program statement be highlighted in yellow by the debugger? (Points : 3)
The statement is about to be executed.
It has a syntax error.
A runtime error has occurred.
The statement has just been executed.
None of the above
6. (TCO 6) What is the first technique that a programmer should employ to check his or her code for logic errors? (Points : 3)
Compare expected results to those actually produced by the program.
Compile the program and see if there are errors reported by the compiler.
Do a program walk-through with your programming peers.
Include Try…Catch statements in all critical statements.
7. (TCO 4) Consider the following two sets of code (a and b):
(a)
If a = 1 And b = 1 Then
System.Console.WriteLine(“Hi”)
End If
(b)
If a = 1 Then
If b = 1 Then
System.Console.WriteLine(“Hi”)
End If
End If
Which of the following statements is most accurate? (Points : 3)
The condition in (a) is not valid.
The two sets of code are equivalent, but (a) is preferred to (b) because (a) is clearer.
(a) and (b) will produce different outputs.
(b) is not a valid set of VB instructions.
8. (TCO 4) When using the logical operator “And,” what part of the expression must be true so that the entire expression is evaluated as true? (Points : 3)
Only the right portion
Only the left portion
Either the left or right portion
Both the left and right portion