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

A

True

22
Q

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

A

True

23
Q

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

A

True

24
Q

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

A

False

25
Q

The statement lstBox.Items.Add(“”) clears all text from the list box

A

False

26
Q

The statement txtBox = “Hello” is an example of a syntax error

A

True

27
Q

The following statement is valid where dog and cat are variables of the same type:
dog = cat

A

True

28
Q

Option Explicit requires you to declare every variable before its use

A

True

29
Q

With Option Strict On, a statement of the form
intVar = dblVar
is not valid.

A

True

30
Q

A statement of the form
dblVar = intVar
is a narrowing assignment statement.

A

False

31
Q

An assignment statement of the form
intVar = 8 / 4
is not valid

A

True

32
Q

After the statement txtBox.Text = “” is executed, the text box will be clear and the
cursor will appear inside the text box

A

False

33
Q

A string literal is a sequence of characters that is treated as a single entity

A

True

34
Q

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

A

False

35
Q

Typecasting is used to convert a value to a different data type

A

True

36
Q

The Trim method is used to remove all blank space before and after a string

A

True

37
Q

The Substring method is used to extract a portion of a string

A

True

38
Q

The empty string is the same as a string that contains one space

A

False

39
Q

A variable declared inside an event procedure is said to have local scope

A

True

40
Q

A variable declared outside of an event procedure is said to have class-level scope

A

True

41
Q

A variable declared inside an event procedure cannot have the same name as a variable
declared inside another procedure

A

False

42
Q

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

A

False

43
Q

The value of
(12345).ToString(“C”)
is $12,345.00.

A

True

44
Q

The value returned by InputBox is a string

A

True

45
Q

The line continuation character must be preceded with a space

A

True

46
Q

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

A

True

47
Q

Named constants must have class-level scope

A

False

48
Q

The value assigned to a class-level named constant can be changed in any procedure

A

False

49
Q

The statement
Const TAX_RATE As Double
is not valid

A

True

50
Q

The value of
DateDiff(DateInterval.Day, #1/1/2014#, #2/1/2014#)
is 31

A

True