wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

CSC301 Chapter 2

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

What is the result of the following expression: 96 \ 30?

a)

3

b)

3.2

c)

6

d)

None of the above

2.

What is the result of the following expression: 96 Mod 30?

a)

3

b)

3.2

c)

6

d)

None of the above

3.

Which of the following is an invalid name for a variable?

a)

dbl8%Rate

b)

decCost

c)

strName

d)

None of the above.

4.

The expression intNum * intNum * intNum is equivalent to which of the following expressions?

a)

A. intNum ^ 3

b)

B. intNum * 3

c)

C. intNum ^ 2 * intNum

d)

Both A and C.

5.

What is the result of the following expression: 3 * 5 \ 2 + 30 / 5?

a)

7.5

b)

13

c)

13.5

d)

None of the above.

6.

Which of the following declares a named constant having the Double data type?

a)

A. Const dblRATE As Double = 0.09

b)

B. Const dblRATE As Double

c)

C. Constant dblRATE = 0.09

d)

D. Both A and B.

7.

If the decPay variable contains the number 1200.76, which of the following statements displays the number as 1,200.76?

a)

lblPay.Text = decPay.ToString("N2")

b)

lblPay.Text = decPay.ToString("F2")

c)

lblPay.Text = decPay.ToString("D2")

d)

lblPay.Text = decPay.ToString("C2")

8.

You declare a named constant with which keyword?

a)

Constant

b)

Const

c)

NamedConstant

d)

Dim

9.

When a string variable is created in memory, Visual Basic assigns it the initial value 0.

a)

True

b)

False

10.

If the following code executes, which value is assigned to strA?


Dim dblTest As Double = 0.25

Dim strA As String = dblTest.ToString("p")

a)

"0.25"

b)

"2.50"

c)

"25.00%"

d)

"0.25"