Deck 3: Variables, Input, and Output

ملء الشاشة (f)
exit full mode
سؤال
Which of the following is a valid name for a variable?

A) Two_One
B) 2One
C) Two One
D) Two.One
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
Which of the numbers below is equivalent to 0.000017489?

A) 1.7489E+05
B) 17489E+06
C) 1.7489E-06
D) 1.7489E-05
سؤال
What is the value of Int(8.9)?

A) 8
B) 8.9
C) 9
D) 1
سؤال
What is the correct statement when declaring and assigning the value of 100 to an Integer variable called numPeople?

A) Dim numPeople = 100
B) Dim numPeople = Int(100)
C) numPeople = 100
D) Dim numPeople As Integer = 100
سؤال
Which of the following statements removes all text from lstBox?

A) lstBox.Clear
B) lstBox.Items.Clear
C) lstBox.Text.Clear
D) lstBox.Items.Add("")
سؤال
What will be displayed when the following lines are executed? Dim xx As Double =3,y= 3 , y As Double =1= 1
Dim z As Double
z=x+(yx)x=yz=x+z\begin{array} { l } \mathrm { z } = \mathrm { x } + ( \mathrm { y } \star \mathrm { x } ) \\\mathrm { x } = \mathrm { y } \\\mathrm { z } = \mathrm { x } + \mathrm { z }\end{array}
lstBox. Items. Add (x+y+z)( x + y + z )

A) 4
B) 9
C) 10
D) None of the above
سؤال
Which of the following statements declare the variables a and b as type Integer?

A) a = 0: b = 0
B) Dim a, b
C) Dim a & b As Integer
D) Dim a, b As Integer
سؤال
The function Math.Int will always round mixed numbers down to the next lowest integer.
سؤال
The type of error that is normally spotted by the Code Editor is:

A) runtime
B) logic
C) syntax
D) user
سؤال
What value will be assigned to the numeric variable x when the following statement is executed? x = 2 + 3 * 4

A) 20
B) 14
C) 92
D) 234
سؤال
Which of the following arithmetic operations has the highest level of precedence?

A) +-
B) */
C) ^
D) ( )
سؤال
When declaring a variable that will refer to a submarine, a good name for the variable is sub.
سؤال
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) 1
B) 2
C) 3
D) None of the above
سؤال
Keywords in Visual Basic are words that

A) should be used when naming variables.
B) are used to name controls, such as TextBox1, Command2, etc.
C) have special meaning and should not be used when naming variables.
D) are used as prefixes for control names (such as txt, btn, lbl, and lst).
سؤال
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
سؤال
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) 123.4567
B) 123.457
C) 123.45
D) 123.46
سؤال
What will be the contents of the variable x after the following statement is executed? x = Math.Sqrt(((9 + 7) / (4 * 2)) + 2)

A) 1
B) 2
C) 3
D) 4
E) None of the above
سؤال
When using the equal sign to assign values, the variable on the left hand side of the equal sign will always receive the value.
سؤال
The variables firstName and firstNAME are identical.
سؤال
Which of the following is the same as 2 ^ 3?

A) 2 * 2 * 2
B) 2 * 3
C) 2 + 2 + 2
D) 3 * 3
سؤال
The value of (11 Mod 2) is 1.
سؤال
The following statement is valid.
y = y + 72
سؤال
Which of the following statements will NOT display the number 5 in the text box?

A) txtBox.Text = 5
B) txtBox.Text = "5"
C) txtBox.Text = CStr("5")
D) txtBox.Text = CStr(5)
سؤال
The following statement assigns 6 times the value of y to x.
x = 6y
سؤال
The exponential notation used in Visual Basic is exactly the same as standard mathematical notation.
سؤال
Which statement will display the words "Hello World" in a text box?

A) txtBox.Text = Hello & World
B) txtBox.Text = "Hello " & World
C) txtBox.Text = Hello & " World"
D) txtBox.Text = "Hello" & " World"
سؤال
The statement a + b = c assigns to c the sum of the values of a and b.
سؤال
You can use a variable name in almost any place you could use a literal value.
سؤال
An assignment statement is used to assign a value to a variable or property.
سؤال
The lstBox.Items.Clear statement is used to empty the contents of a list box.
سؤال
Numeric variables can be initialized to zero or any other number, but once they are initialized, they cannot be changed.
سؤال
Which of the following statements is a valid assignment statement?

A) txtBox = "Hello World"
B) "Hello World" = txtBox.Text
C) txtBox.Text = "Hello World"
D) Text.txtBox = "Hello World"
سؤال
The following two statements are equivalent, where numVar is a numeric variable.
numVar = numVar + 1
numVar += 1
سؤال
The value of (11 \ 2) is 1.
سؤال
Visual Basic always displays numbers in decimal format.
سؤال
What is the correct syntax for displaying the value of the String variable myString in a text box?

A) txtBox.Text = "myString"
B) txtBox.Text = myString
C) txtBox.Text.myString
D) txtBox.Text = Str(myString)
سؤال
Which of the following code statements generates an error?

A) txtFirst.Text = "Hello"
B) txtFirst.Text = Hello
C) txtFirst.Text = "My Text"
D) txtFirst.Text = Me.Text
سؤال
The following two statements are equivalent.
var1 = var2
var2 = var1
سؤال
A numeric variable that has not been assigned a value has the default value zero.
سؤال
The following statement is valid.
Dim x As Double = 3,542.36
سؤال
What is the value of ("12/15/09").Substring(3,2)?

A) /15
B) 15
C) /15/
D) 12/15/09
سؤال
The following statement contains what type of error?
txtAverage.Txt = CStr(CDbl(txtNum1.Text) + CDbl(txtNum2.Text) / 2)

A) a syntax error only
B) a logic error only
C) both a syntax error and a logic error
D) no errors
سؤال
The joining of two strings together to form a new string is called

A) concatenation.
B) addition.
C) compaction.
D) substrings.
سؤال
What will be the output of the following statement?
txtBox.Text = CStr(Math.Round(17 / 2))

A) 8
B) 9
C) 8.5
D) 17.00
سؤال
What will be displayed when the following lines are executed?
Dim x As Double = 2
'x = 3
txtBox.Text = CStr(x)

A) 3
B) 0
C) 2
D) None of the above
سؤال
Which of the following expressions will yield the string "John Doe", where name1 = "John Blake" and name2 = "Janet Doe"?

A) name1.Substring(0, 4) & name2.Substring(6, 8)
B) name1.Substring(0, 4) & name2.Substring(0, 3)
C) name1.Substring(0, 5) & name2.Substring(6, 3)
D) None of the above
سؤال
What character is used to signify the beginning of a comment statement?

A) asterisk
B) exclamation mark
C) apostrophe
D) backslash
سؤال
The symbol for the string concatenation operator is

A) @
B) &
C) %
D) #
سؤال
Which of the following expressions has as its value the value of strVar with its leading and trailing spaces removed?

A) strVar.Length
B) strVar.ToUpper
C) strVar.Ctrim
D) strVar.Trim
سؤال
What will be displayed when the following lines are executed?Dim a,ba , b , c As String
a = "THE WHOLE"
b=\mathbf { b } = "PART"
c=ac = a . Substring (CInt (Math.Sqrt (4)), b. Length)
txtBox. Text == cStr (c)( c )
(A) THE WHOLE PART
(B) 6
(C) E\mathrm { E } ?H (D) HE\mathrm { HE } W

A) THE WHOLE PART
B) 6
C) E WH
D) HE W
سؤال
What will be the value of numVar when the following code is executed? Dim strVar As String, numVar As Integer
strvar == "Now is the time for all good men"
numVar == strVar. Indexof ("the time for")

A) "Now is all good men"
B) "12"
C) 7
D) 8
سؤال
Which statement can be used to clear the contents of a text box?

A) txtBox.Empty = True
B) txtBox = ""
C) txtBox.Text = ""
D) txtBox.Wipe
سؤال
The following lines are valid.
Dim h As String = "Hello"
txtBox.Text = CStr(h.IndexOf("h"))
سؤال
All comment statements must be placed at the beginning of a program.
سؤال
Given the data assigned to the string variable str2 shown below, which of the following statements will assign the value ALL to the string variable str1?
str2 = "WHEN ALL ELSE FAILS, READ THE DIRECTIONS"

A) str1 = str2.Substring(5)
B) str1 = str2.Indestr1OfStr("ALL")
C) str1 = str2.Substring(6, 3)
D) str1 = str2.Substring(5, 3)
سؤال
The statement lstBox.Items.Add("") clears all the text from the list box.
سؤال
What will be the output of the following lines? Dim alphabet, soup As string
alphabet - "abcdefghijklmnopqrstuvwxyz"
soup = alphabet. ToUpper
txtBox.Text - alphabet.Substring (0,5)&( 0,5 ) \& soup. Sabstring (0,5)( 0,5 )

A) abcdeABCDE
B) ABCDEABCDE
C) eE
D) EE
سؤال
What will be the output of the following line?
txtBox.Text = "2" & 3

A) 23
B) 2 3
C) 5
D) Syntax error
سؤال
The value of strVar.Length is the number of characters in the value of strVar.
سؤال
If strVar.Length is 5, then the value of
strVar.Substring(4, 1)
is the last character of the
value of strVar.
سؤال
The statement txtBox = "Hello" is an example of a syntax error.
سؤال
A variable declared inside an event procedure cannot have the same name as a variable declared inside another procedure.
سؤال
A statement of the form dblVar = intVar is a narrowing assignment statement.
سؤال
With Option Strict On, a statement of the form intVar = dblVar is not valid.
سؤال
A variable declared inside an event procedure is said to have local scope.
سؤال
A string literal is a sequence of characters that is treated as a single entity.
سؤال
The following statements assign the lowercase letters to the string variable alphabet.
Dim alphabet As String
alphabet = abcdefghijklmnopqrstuvwxyz
سؤال
The Substring method is used to extract a portion of a string.
سؤال
What is the proper syntax when using a message dialog box?

A) MessageBox.Show("Hi there", "Hi")
B) MessageBox.Show(Hi there, Hi)
C) MessageBox.Show "Hi There", "Hi"
D) MessageBox.Show Hi There, Hi
سؤال
The following statement is valid where dog and cat are variables of the same type.
dog = cat
سؤال
Option Explicit requires you to declare every variable before its use.
سؤال
The Trim method is used to remove all blank space before and after a string.
سؤال
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.
سؤال
Typecasting is used to convert a value to a different data type.
سؤال
A variable declared outside of an event procedure is said to have class-level scope.
سؤال
When declaring a variable of type String, you must specify a length for the string.
سؤال
After the statement txtBox.Text = "" is executed, the text box will be clear and the cursor will appear inside the text box.
سؤال
An assignment statement of the form intVar = 8 / 4 is not valid.
سؤال
The empty string is the same as a string that contains one space.
سؤال
Which of the following is not used to assign a value to a variable?

A) InputBox statement
B) Dim statement
C) an assignment statement
D) MessageBox.Show statement
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/101
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 3: Variables, Input, and Output
1
Which of the following is a valid name for a variable?

A) Two_One
B) 2One
C) Two One
D) Two.One
A
2
Which of the numbers below is equivalent to 0.000017489?

A) 1.7489E+05
B) 17489E+06
C) 1.7489E-06
D) 1.7489E-05
D
3
What is the value of Int(8.9)?

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

A) Dim numPeople = 100
B) Dim numPeople = Int(100)
C) numPeople = 100
D) Dim numPeople As Integer = 100
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 101 في هذه المجموعة.
فتح الحزمة
k this deck
5
Which of the following statements removes all text from lstBox?

A) lstBox.Clear
B) lstBox.Items.Clear
C) lstBox.Text.Clear
D) lstBox.Items.Add("")
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 101 في هذه المجموعة.
فتح الحزمة
k this deck
6
What will be displayed when the following lines are executed? Dim xx As Double =3,y= 3 , y As Double =1= 1
Dim z As Double
z=x+(yx)x=yz=x+z\begin{array} { l } \mathrm { z } = \mathrm { x } + ( \mathrm { y } \star \mathrm { x } ) \\\mathrm { x } = \mathrm { y } \\\mathrm { z } = \mathrm { x } + \mathrm { z }\end{array}
lstBox. Items. Add (x+y+z)( x + y + z )

A) 4
B) 9
C) 10
D) None of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 101 في هذه المجموعة.
فتح الحزمة
k this deck
7
Which of the following statements declare the variables a and b as type Integer?

A) a = 0: b = 0
B) Dim a, b
C) Dim a & b As Integer
D) Dim a, b As Integer
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 101 في هذه المجموعة.
فتح الحزمة
k this deck
8
The function Math.Int will always round mixed numbers down to the next lowest integer.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 101 في هذه المجموعة.
فتح الحزمة
k this deck
9
The type of error that is normally spotted by the Code Editor is:

A) runtime
B) logic
C) syntax
D) user
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 101 في هذه المجموعة.
فتح الحزمة
k this deck
10
What value will be assigned to the numeric variable x when the following statement is executed? x = 2 + 3 * 4

A) 20
B) 14
C) 92
D) 234
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 101 في هذه المجموعة.
فتح الحزمة
k this deck
11
Which of the following arithmetic operations has the highest level of precedence?

A) +-
B) */
C) ^
D) ( )
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 101 في هذه المجموعة.
فتح الحزمة
k this deck
12
When declaring a variable that will refer to a submarine, a good name for the variable is sub.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 101 في هذه المجموعة.
فتح الحزمة
k this deck
13
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) 1
B) 2
C) 3
D) None of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 101 في هذه المجموعة.
فتح الحزمة
k this deck
14
Keywords in Visual Basic are words that

A) should be used when naming variables.
B) are used to name controls, such as TextBox1, Command2, etc.
C) have special meaning and should not be used when naming variables.
D) are used as prefixes for control names (such as txt, btn, lbl, and lst).
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 101 في هذه المجموعة.
فتح الحزمة
k this deck
15
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 101 في هذه المجموعة.
فتح الحزمة
k this deck
16
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) 123.4567
B) 123.457
C) 123.45
D) 123.46
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 101 في هذه المجموعة.
فتح الحزمة
k this deck
17
What will be the contents of the variable x after the following statement is executed? x = Math.Sqrt(((9 + 7) / (4 * 2)) + 2)

A) 1
B) 2
C) 3
D) 4
E) None of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 101 في هذه المجموعة.
فتح الحزمة
k this deck
18
When using the equal sign to assign values, the variable on the left hand side of the equal sign will always receive the value.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 101 في هذه المجموعة.
فتح الحزمة
k this deck
19
The variables firstName and firstNAME are identical.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 101 في هذه المجموعة.
فتح الحزمة
k this deck
20
Which of the following is the same as 2 ^ 3?

A) 2 * 2 * 2
B) 2 * 3
C) 2 + 2 + 2
D) 3 * 3
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 101 في هذه المجموعة.
فتح الحزمة
k this deck
21
The value of (11 Mod 2) is 1.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 101 في هذه المجموعة.
فتح الحزمة
k this deck
22
The following statement is valid.
y = y + 72
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 101 في هذه المجموعة.
فتح الحزمة
k this deck
23
Which of the following statements will NOT display the number 5 in the text box?

A) txtBox.Text = 5
B) txtBox.Text = "5"
C) txtBox.Text = CStr("5")
D) txtBox.Text = CStr(5)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 101 في هذه المجموعة.
فتح الحزمة
k this deck
24
The following statement assigns 6 times the value of y to x.
x = 6y
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 101 في هذه المجموعة.
فتح الحزمة
k this deck
25
The exponential notation used in Visual Basic is exactly the same as standard mathematical notation.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 101 في هذه المجموعة.
فتح الحزمة
k this deck
26
Which statement will display the words "Hello World" in a text box?

A) txtBox.Text = Hello & World
B) txtBox.Text = "Hello " & World
C) txtBox.Text = Hello & " World"
D) txtBox.Text = "Hello" & " World"
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 101 في هذه المجموعة.
فتح الحزمة
k this deck
27
The statement a + b = c assigns to c the sum of the values of a and b.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 101 في هذه المجموعة.
فتح الحزمة
k this deck
28
You can use a variable name in almost any place you could use a literal value.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 101 في هذه المجموعة.
فتح الحزمة
k this deck
29
An assignment statement is used to assign a value to a variable or property.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 101 في هذه المجموعة.
فتح الحزمة
k this deck
30
The lstBox.Items.Clear statement is used to empty the contents of a list box.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 101 في هذه المجموعة.
فتح الحزمة
k this deck
31
Numeric variables can be initialized to zero or any other number, but once they are initialized, they cannot be changed.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 101 في هذه المجموعة.
فتح الحزمة
k this deck
32
Which of the following statements is a valid assignment statement?

A) txtBox = "Hello World"
B) "Hello World" = txtBox.Text
C) txtBox.Text = "Hello World"
D) Text.txtBox = "Hello World"
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 101 في هذه المجموعة.
فتح الحزمة
k this deck
33
The following two statements are equivalent, where numVar is a numeric variable.
numVar = numVar + 1
numVar += 1
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 101 في هذه المجموعة.
فتح الحزمة
k this deck
34
The value of (11 \ 2) is 1.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 101 في هذه المجموعة.
فتح الحزمة
k this deck
35
Visual Basic always displays numbers in decimal format.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 101 في هذه المجموعة.
فتح الحزمة
k this deck
36
What is the correct syntax for displaying the value of the String variable myString in a text box?

A) txtBox.Text = "myString"
B) txtBox.Text = myString
C) txtBox.Text.myString
D) txtBox.Text = Str(myString)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 101 في هذه المجموعة.
فتح الحزمة
k this deck
37
Which of the following code statements generates an error?

A) txtFirst.Text = "Hello"
B) txtFirst.Text = Hello
C) txtFirst.Text = "My Text"
D) txtFirst.Text = Me.Text
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 101 في هذه المجموعة.
فتح الحزمة
k this deck
38
The following two statements are equivalent.
var1 = var2
var2 = var1
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 101 في هذه المجموعة.
فتح الحزمة
k this deck
39
A numeric variable that has not been assigned a value has the default value zero.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 101 في هذه المجموعة.
فتح الحزمة
k this deck
40
The following statement is valid.
Dim x As Double = 3,542.36
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 101 في هذه المجموعة.
فتح الحزمة
k this deck
41
What is the value of ("12/15/09").Substring(3,2)?

A) /15
B) 15
C) /15/
D) 12/15/09
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 101 في هذه المجموعة.
فتح الحزمة
k this deck
42
The following statement contains what type of error?
txtAverage.Txt = CStr(CDbl(txtNum1.Text) + CDbl(txtNum2.Text) / 2)

A) a syntax error only
B) a logic error only
C) both a syntax error and a logic error
D) no errors
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 101 في هذه المجموعة.
فتح الحزمة
k this deck
43
The joining of two strings together to form a new string is called

A) concatenation.
B) addition.
C) compaction.
D) substrings.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 101 في هذه المجموعة.
فتح الحزمة
k this deck
44
What will be the output of the following statement?
txtBox.Text = CStr(Math.Round(17 / 2))

A) 8
B) 9
C) 8.5
D) 17.00
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 101 في هذه المجموعة.
فتح الحزمة
k this deck
45
What will be displayed when the following lines are executed?
Dim x As Double = 2
'x = 3
txtBox.Text = CStr(x)

A) 3
B) 0
C) 2
D) None of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 101 في هذه المجموعة.
فتح الحزمة
k this deck
46
Which of the following expressions will yield the string "John Doe", where name1 = "John Blake" and name2 = "Janet Doe"?

A) name1.Substring(0, 4) & name2.Substring(6, 8)
B) name1.Substring(0, 4) & name2.Substring(0, 3)
C) name1.Substring(0, 5) & name2.Substring(6, 3)
D) None of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 101 في هذه المجموعة.
فتح الحزمة
k this deck
47
What character is used to signify the beginning of a comment statement?

A) asterisk
B) exclamation mark
C) apostrophe
D) backslash
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 101 في هذه المجموعة.
فتح الحزمة
k this deck
48
The symbol for the string concatenation operator is

A) @
B) &
C) %
D) #
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 101 في هذه المجموعة.
فتح الحزمة
k this deck
49
Which of the following expressions has as its value the value of strVar with its leading and trailing spaces removed?

A) strVar.Length
B) strVar.ToUpper
C) strVar.Ctrim
D) strVar.Trim
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 101 في هذه المجموعة.
فتح الحزمة
k this deck
50
What will be displayed when the following lines are executed?Dim a,ba , b , c As String
a = "THE WHOLE"
b=\mathbf { b } = "PART"
c=ac = a . Substring (CInt (Math.Sqrt (4)), b. Length)
txtBox. Text == cStr (c)( c )
(A) THE WHOLE PART
(B) 6
(C) E\mathrm { E } ?H (D) HE\mathrm { HE } W

A) THE WHOLE PART
B) 6
C) E WH
D) HE W
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 101 في هذه المجموعة.
فتح الحزمة
k this deck
51
What will be the value of numVar when the following code is executed? Dim strVar As String, numVar As Integer
strvar == "Now is the time for all good men"
numVar == strVar. Indexof ("the time for")

A) "Now is all good men"
B) "12"
C) 7
D) 8
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 101 في هذه المجموعة.
فتح الحزمة
k this deck
52
Which statement can be used to clear the contents of a text box?

A) txtBox.Empty = True
B) txtBox = ""
C) txtBox.Text = ""
D) txtBox.Wipe
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 101 في هذه المجموعة.
فتح الحزمة
k this deck
53
The following lines are valid.
Dim h As String = "Hello"
txtBox.Text = CStr(h.IndexOf("h"))
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 101 في هذه المجموعة.
فتح الحزمة
k this deck
54
All comment statements must be placed at the beginning of a program.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 101 في هذه المجموعة.
فتح الحزمة
k this deck
55
Given the data assigned to the string variable str2 shown below, which of the following statements will assign the value ALL to the string variable str1?
str2 = "WHEN ALL ELSE FAILS, READ THE DIRECTIONS"

A) str1 = str2.Substring(5)
B) str1 = str2.Indestr1OfStr("ALL")
C) str1 = str2.Substring(6, 3)
D) str1 = str2.Substring(5, 3)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 101 في هذه المجموعة.
فتح الحزمة
k this deck
56
The statement lstBox.Items.Add("") clears all the text from the list box.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 101 في هذه المجموعة.
فتح الحزمة
k this deck
57
What will be the output of the following lines? Dim alphabet, soup As string
alphabet - "abcdefghijklmnopqrstuvwxyz"
soup = alphabet. ToUpper
txtBox.Text - alphabet.Substring (0,5)&( 0,5 ) \& soup. Sabstring (0,5)( 0,5 )

A) abcdeABCDE
B) ABCDEABCDE
C) eE
D) EE
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 101 في هذه المجموعة.
فتح الحزمة
k this deck
58
What will be the output of the following line?
txtBox.Text = "2" & 3

A) 23
B) 2 3
C) 5
D) Syntax error
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 101 في هذه المجموعة.
فتح الحزمة
k this deck
59
The value of strVar.Length is the number of characters in the value of strVar.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 101 في هذه المجموعة.
فتح الحزمة
k this deck
60
If strVar.Length is 5, then the value of
strVar.Substring(4, 1)
is the last character of the
value of strVar.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 101 في هذه المجموعة.
فتح الحزمة
k this deck
61
The statement txtBox = "Hello" is an example of a syntax error.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 101 في هذه المجموعة.
فتح الحزمة
k this deck
62
A variable declared inside an event procedure cannot have the same name as a variable declared inside another procedure.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 101 في هذه المجموعة.
فتح الحزمة
k this deck
63
A statement of the form dblVar = intVar is a narrowing assignment statement.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 101 في هذه المجموعة.
فتح الحزمة
k this deck
64
With Option Strict On, a statement of the form intVar = dblVar is not valid.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 101 في هذه المجموعة.
فتح الحزمة
k this deck
65
A variable declared inside an event procedure is said to have local scope.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 101 في هذه المجموعة.
فتح الحزمة
k this deck
66
A string literal is a sequence of characters that is treated as a single entity.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 101 في هذه المجموعة.
فتح الحزمة
k this deck
67
The following statements assign the lowercase letters to the string variable alphabet.
Dim alphabet As String
alphabet = abcdefghijklmnopqrstuvwxyz
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 101 في هذه المجموعة.
فتح الحزمة
k this deck
68
The Substring method is used to extract a portion of a string.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 101 في هذه المجموعة.
فتح الحزمة
k this deck
69
What is the proper syntax when using a message dialog box?

A) MessageBox.Show("Hi there", "Hi")
B) MessageBox.Show(Hi there, Hi)
C) MessageBox.Show "Hi There", "Hi"
D) MessageBox.Show Hi There, Hi
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 101 في هذه المجموعة.
فتح الحزمة
k this deck
70
The following statement is valid where dog and cat are variables of the same type.
dog = cat
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 101 في هذه المجموعة.
فتح الحزمة
k this deck
71
Option Explicit requires you to declare every variable before its use.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 101 في هذه المجموعة.
فتح الحزمة
k this deck
72
The Trim method is used to remove all blank space before and after a string.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 101 في هذه المجموعة.
فتح الحزمة
k this deck
73
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 101 في هذه المجموعة.
فتح الحزمة
k this deck
74
Typecasting is used to convert a value to a different data type.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 101 في هذه المجموعة.
فتح الحزمة
k this deck
75
A variable declared outside of an event procedure is said to have class-level scope.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 101 في هذه المجموعة.
فتح الحزمة
k this deck
76
When declaring a variable of type String, you must specify a length for the string.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 101 في هذه المجموعة.
فتح الحزمة
k this deck
77
After the statement txtBox.Text = "" is executed, the text box will be clear and the cursor will appear inside the text box.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 101 في هذه المجموعة.
فتح الحزمة
k this deck
78
An assignment statement of the form intVar = 8 / 4 is not valid.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 101 في هذه المجموعة.
فتح الحزمة
k this deck
79
The empty string is the same as a string that contains one space.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 101 في هذه المجموعة.
فتح الحزمة
k this deck
80
Which of the following is not used to assign a value to a variable?

A) InputBox statement
B) Dim statement
C) an assignment statement
D) MessageBox.Show statement
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 101 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 101 في هذه المجموعة.