Quiz 3 Flashcards

1
Q

The following statement is valid:

Dim x As Double = 3,542.36

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

If strVar.Length is 5, then the value of
strVar.Substring (4,1)
is the last character of the value of strVar

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Visual Basic always displays numbers in decimal format

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

The exponential notation used in Visual Basic is exactly the same as standard mathematical notation

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

When declaring a variable type String, you must specify a length for the string

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

When declaring a variable that will refer to a submarine, a good name for the variable is sub

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

The function Math.Int will always round mixed numbers down to the next lowest integer

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

When using the equal sign to assign values, the variable on the left hand side of the equal sign will always receive the value

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

The variable firstName and firstNAME are identical

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

The following statement assigns 6 times the value of y to x:

x = 6y

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

The following statement is valid:

y = y + 72

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

A numeric variable that has not been assigned a value has the default value zero

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

The statement a + b = c assigns to c the sum of the values of a and b

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

The lstBox.Items.Clear() statement is used to empty the contents of a list box

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

An assignment statement is used to assign a value to a variable or property

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

You can use a variable name in almost any place you could use a literal value

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Numeric variables can be initialized to zero or any other number, but once they are initialized, they cannot be changed

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

The following two statements are equivalent:
var1 = var2
var2 = var1

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

The value of (11mod2) is 1

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

The value of (11\2) is 1

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

The following two statements are equivalent, where numVar is a numeric variable:
numVar = numVar + 1
numVar += 1

22
Q

The value of strVar.Length is the number of characters in the value of strVar

23
Q

The following lines are valid:
Dim h As String = “Hello”
txtBox.Text = CStr(h.IndexOf(“h”))

24
Q

All comment statements must be placed at the beginning of a program

25
The statement lstBox.Items.Add("") clears all text from the list box
False
26
The statement txtBox = "Hello" is an example of a syntax error
True
27
The following statement is valid where dog and cat are variables of the same type: dog = cat
True
28
Option Explicit requires you to declare every variable before its use
True
29
With Option Strict On, a statement of the form intVar = dblVar is not valid.
True
30
A statement of the form dblVar = intVar is a narrowing assignment statement.
False
31
An assignment statement of the form intVar = 8 / 4 is not valid
True
32
After the statement txtBox.Text = "" is executed, the text box will be clear and the cursor will appear inside the text box
False
33
A string literal is a sequence of characters that is treated as a single entity
True
34
When declaring a variable of type String, you must specify a length for the string
False
35
Typecasting is used to convert a value to a different data type
True
36
The Trim method is used to remove all blank space before and after a string
True
37
The Substring method is used to extract a portion of a string
True
38
The empty string is the same as a string that contains one space
False
39
A variable declared inside an event procedure is said to have local scope
True
40
A variable declared outside of an event procedure is said to have class-level scope
True
41
A variable declared inside an event procedure cannot have the same name as a variable declared inside another procedure
False
42
When a variable declared in one event procedure has the same name as a variable declared in another event procedure, any change to the value of one of the variables will affect the value of the other variable
False
43
The value of (12345).ToString("C") is $12,345.00.
True
44
The value returned by InputBox is a string
True
45
The line continuation character must be preceded with a space
True
46
When the Mask property of a masked text box is set to LL, at most two characters (consisting of letters or spaces) can be entered into the masked text box
True
47
Named constants must have class-level scope
False
48
The value assigned to a class-level named constant can be changed in any procedure
False
49
The statement Const TAX_RATE As Double is not valid
True
50
The value of DateDiff(DateInterval.Day, #1/1/2014#, #2/1/2014#) is 31
True