Preview

String and T/f

Good Essays
Open Document
Open Document
2717 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
String and T/f
Chapter 3 Variables, Input, and Output
Section 3.1 Numbers
1.

What is the correct statement when declaring and assigning the value of 100 to an Integer variable called numPeople?
(A)
(B)
(C)
(D)

Dim numPeople = 100
Dim numPeople = Int(100) numPeople = 100
Dim numPeople As Integer = 100

D
2.

What is the value of Int(8.9)?
(A)
(B)
(C)
(D)

3.

The type of error that is normally spotted by the Code Editor is:
(A)
(B)
(C)
(D)

4.

runtime logic syntax user C

Which of the following arithmetic operations has the highest level of precedence?
(A)
(B)
(C)
(D)

5.

8
8.9
9
1
A

+*/
^
()
D

Which of the following statements removes all text from lstBox?
(A)
(B)
(C)
(D)

lstBox.Clear() lstBox.Items.Clear() lstBox.Text.Clear() lstBox.Items.Add("") B

6.

What will be the contents of the variable x after the following statement is executed? x = Math.Sqrt(((9 + 7) / (4 * 2)) + 2)

(A)
(B)
(C)
(D)
(E)
7.

1
2
3
4
None of the above
B

Suppose the Double variable num has the value 123.4567. What value will the following statement assign to num? num = Math.Round(num, 2)

(A)
(B)
(C)
(D)
8.

123.4567
123.457
123.45
123.46
D

What value will be assigned to the numeric variable x when the following statement is executed? x = 2 + 3 * 4

(A)
(B)
(C)
(D)
9.

20
14
92
234
B

Which of the following statements declare the variables a and b as type Integer?
(A)
(B)
(C)
(D)

a =
Dim
Dim
Dim

D

0: b = 0 a, b a & b As Integer a, b As Integer

10. Assume that x, y, and temp are Integer variables. Which of the following lines of code swaps the values of x and y?
(A) x = y y = x

(B) x = temp x = y y = temp

(C) temp = x x = y y = temp

(D) x = y temp = x y = temp

C
11. Which of the following is a valid name for a variable?
(A)
(B)
(C)
(D)

Two_One
2One
Two One
Two.One
A

12. Given x = 3 and y = 1, what value will be assigned to the Double variable w when the following statement is executed? w = (x + y) / (x – y)

(A)
(B)
(C)
(D)

1
2
3
None of the above
B

13. What will be displayed when

You May Also Find These Documents Helpful

Related Topics