NEW
Font size
WorksheetsCSC301 Chapter 2
Total questions: 10
Worksheet time: 5mins
What is the result of the following expression: 96 \ 30?
3
3.2
6
None of the above
What is the result of the following expression: 96 Mod 30?
3
3.2
6
None of the above
Which of the following is an invalid name for a variable?
dbl8%Rate
decCost
strName
None of the above.
The expression intNum * intNum * intNum is equivalent to which of the following expressions?
A. intNum ^ 3
B. intNum * 3
C. intNum ^ 2 * intNum
Both A and C.
What is the result of the following expression: 3 * 5 \ 2 + 30 / 5?
7.5
13
13.5
None of the above.
Which of the following declares a named constant having the Double data type?
A. Const dblRATE As Double = 0.09
B. Const dblRATE As Double
C. Constant dblRATE = 0.09
D. Both A and B.
If the decPay variable contains the number 1200.76, which of the following statements displays the number as 1,200.76?
lblPay.Text = decPay.ToString("N2")
lblPay.Text = decPay.ToString("F2")
lblPay.Text = decPay.ToString("D2")
lblPay.Text = decPay.ToString("C2")
You declare a named constant with which keyword?
Constant
Const
NamedConstant
Dim
When a string variable is created in memory, Visual Basic assigns it the initial value 0.
True
False
If the following code executes, which value is assigned to strA?
Dim dblTest As Double = 0.25
Dim strA As String = dblTest.ToString("p")
"0.25"
"2.50"
"25.00%"
"0.25"
