P.S: This is just a study guide. The questions may not appear exactly like this.
1. What is the decision symbol in a flow chart?
• Square
• Rectangle
• Circle
• Diamond
2. Which of the following expressions uses a relational operator?
• x + y
• x >= y
• x AND y
• x % y
3. A conditional expression is also known as a _____ expression or statement.
• relational
• Boolean
• logical
• mathematical
4. A _____ statement can be used to choose between several actions without using an If statement.
• complex
• select
• blocking
• choice
5. Hitting F8 after a breakpoint invokes what action?
• Program execution finds runtime errors.
• Program execution stops.
• Program execution resets the values of all variables.
• Program execution steps to the next line of code.
6. What is the first technique that a programmer should employ to check his or her code for logic errors?
• 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. What is the purpose of function Debug – Windows – Autos in Visual Studio?
• Activate the automatic syntax checker of the compiler.
• Auto Select all variables that may have erroneous values and display them.
• Automatically discover possible runtime errors in the code.
• Observe and change the values of variables.
8. Which statement regarding these two sets of code is true?
(a)
If z = 10 Then
If x = 11 Then
System.Console.WriteLine(“Hi”)
End If
End If
(b)
If z = 10 Or x = 11 Then
System.Console.WriteLine(“Hi”)
End If
• The two sets of code are NOT equivalent and do different things.
• The condition statement in “a” is not valid.
• “a” and “b” will produce the same outputs.
• “b” is not a valid set of Visual Basic instructions.
9. When using the logical operator “Or,” what part of the expression must be true so that the entire expression is evaluated as true?
• Only the right portion
• Only the left portion
• Either the left or right portion
• Either the left or right portion, but not both
10. Suppose that the selector in a Select Case block is the string variable strValue. Which of the following is NOT a valid Case clause?
• Case strValue.Substring(0, 1)
• Case “Adams”
• Case strValue.Length
• Case “739”
11. Using If…Then…Else statements, write code calculate sales bonus to be paid to salespersons selling widgets, considering the following tiers:
Sales between $0 and $5,000: 1% bonus
Sales between $5,001 and $10,000: 3% bonus
Sales over $10,000: 5% bonus
Assume the salesperson’s total sales value stored in a variable totalSales and is always greater than zero, and a salesBonus variable has been declared.