bidezones.com /VBScript/VBScript Mcq Question Set 2 Sample Test,Sample questions

Question:
 A Do?Loop Until block is always executed at least once

1. True

2.False

3.all of the above

4.None of the mentioned

Posted Date:-2022-02-11 09:44:52


Question:
 Suppose that the selector in a Select Case block is the string variable myVar. Which of the following is NOT a valid Case clause?

1.Case “Adams”

2.Case “739”

3.Case (myVar.Substring(0, 1)

4.Case myVar.Length

Posted Date:-2022-02-11 09:33:36


Question:
 The arguments appearing in a Call statement must match the parameters in the appropriate Sub or Function header in all but one of the following ways. Which one?

1.Number of arguments

2.Names of arguments

3. Data type of arguments

4. Order of arguments

Posted Date:-2022-02-11 09:43:25


Question:
 The declaration statement for a class-level variable should be placed _____

1. inside an event procedure

2. inside a general procedure

3. anywhere in the program region, except inside a procedure

4.above the statement Public Class frmName

Posted Date:-2022-02-11 09:36:41


Question:
 The input to a user-defined function can consist of one or more values.

1. True

2.False

3.all of the above

4.None of the mentioned

Posted Date:-2022-02-11 09:40:50


Question:
 The statement Const TAX_RATE As Doubleface=Calibri size=2> is not valid.

1. True

2.False

3.all of the above

4.None of the mentioned

Posted Date:-2022-02-11 09:40:15


Question:
: A
51. Suppose a variable is passed by value to a parameter of a Sub procedure, and the parameter has its value changed inside the Sub procedure. What will the value of the variable be after the Sub procedure has executed?

1.It will have the newly modified value from inside the Sub procedure.

2.Its value can?t be determined without more information

3.It will retain the value it had before the call to the Sub procedure

4.None of the above.

Posted Date:-2022-02-11 09:36:17


Question:
A counter variable is normally incremented or decremented by 1.

1.True

2.False

3.all of the above

4.None of the mentioned

Posted Date:-2022-02-11 09:45:07


Question:
A Do While loop checks the While condition before executing the statements in the loop.

1. True

2.False

3.all of the above

4.None of the mentioned

Posted Date:-2022-02-11 09:44:34


Question:
A Function may return up to two values.

1.True

2.False

3.all of the above

4.None of the mentioned

Posted Date:-2022-02-11 09:42:21


Question:
A single Case statement can contain multiple values.

1.True

2.False

3.all of the above

4.None of the mentioned

Posted Date:-2022-02-11 09:32:33


Question:
A variable declared inside a Select Case block cannot be referred to by code outside of the block.

1. True

2.False

3.all of the above

4.None of the mentioned

Posted Date:-2022-02-11 09:33:11


Question:
Although a function can return a value, it cannot directly display information in a text box.

1.True

2.False

3.all of the above

4.None of the mentioned

Posted Date:-2022-02-11 09:41:45


Question:
Both the input and output of a Function procedure can consist of several values.

1. True

2.False

3.all of the above

4.None of the mentioned

Posted Date:-2022-02-11 09:41:16


Question:
Different items appearing in the same value list of a Select Case block must be separated by a ______

1. semi colon

2. comma

3. colon

4. pair of quotation marks

Posted Date:-2022-02-11 09:33:56


Question:
Each individual variable in the list student(0), student(1), student(2) is known as a(n)

1. subscript

2. dimension

3.element

4.Type

Posted Date:-2022-02-11 09:40:00


Question:
Function names should be suggestive of the role performed. The names also must conform to the rules for naming variables.

1.True

2. False

3.all of the above

4.None of the mentioned

Posted Date:-2022-02-11 09:40:36


Question:
Function procedures can invoke other Function procedures.

1. True

2. False

3.all of the above

4.None of the mentioned

Posted Date:-2022-02-11 09:42:07


Question:
Suppose a variable is passed by reference to a parameter of a Sub procedure, and the parameter has its value changed inside the Sub procedure. What will the value of the variable be after the Sub procedure has executed?

1. It will have the newly modified value from inside the Sub procedure.

2.Its value can?t be determined without more information.

3.It will retain the value it had before the call to the Sub procedure

4.None of the above.

Posted Date:-2022-02-11 09:35:54


Question:
Suppose the variable myName is declared in a Dim statement in two different Sub procedures. Which statement is true?

1.The program will malfunction when it is executed.

2. When the value of myName is changed in one Sub procedure, it will also be changed in the other Sub procedure.

3.Visual Basic’s smart editor will alert you that this is an error before the program is executed.

4.The two variables will be local to their respective Sub procedures.

Posted Date:-2022-02-11 09:37:54


Question:
Suppose you want to write a procedure that takes three numbers, num1, num2, and num3; and returns their sum, product, and average. It is best to use a Function procedure for this task.

1.True

2.False

3.all of the above

4.None of the mentioned

Posted Date:-2022-02-11 09:41:31


Question:
The body of a For…Next loop in Visual Basic will always be executed once no matter what the initial and terminating values are.

1.True

2.False

3.all of the above

4.None of the mentioned

Posted Date:-2022-02-11 09:45:40


Question:
The body of a For…Next loop in Visual Basic will always be executed once no matter what the initial and terminating values are.  duplicate question?

1.True

2. False

3.all of the above

4.None of the mentioned

Posted Date:-2022-02-11 09:45:56


Question:
The input to a user-defined function can consist of:

1.a single value

2.one or more values

3.no values

4. All of the above

Posted Date:-2022-02-11 09:42:40


Question:
The value of the control variable should not be altered within the body of a For?Next loop.

1.True

2.False

3.all of the above

4.None of the mentioned

Posted Date:-2022-02-11 09:45:21


Question:
The _________ of a Sub procedure are vehicles for passing numbers and strings to the Sub procedure.

1. Call Statements

2.arguments

3.parameters

4. variables declared inside

Posted Date:-2022-02-11 09:38:45


Question:
Variables appearing in the header of a Function procedure are called ____

1.values of the function

2.parameters

3.coordinates

4.arguments

Posted Date:-2022-02-11 09:43:00


Question:
Variables declared inside a procedure are said to have _____

1. local scope

2.procedure-level scope

3.class-level scope

4.none of the above

Posted Date:-2022-02-11 09:37:02


Question:
What happens to a variable declared locally inside a Sub procedure after the procedure terminates?

1. It maintains its value even after the End Sub statement executes.

2.It ceases to exist after the End Sub statement executes.

3.It loses its value temporarily after the End Sub statement executes, but regains that value upon re-entry to the Sub procedure.

4.It is reset to its default value.

Posted Date:-2022-02-11 09:35:25


Question:
What is displayed when the button is clicked?
Private Sub btnDisplay_Click(…) Handles btnDisplay.Click
Dim a, b as String
Dim x as Integer
a = “How now brown cow.”
b = “brown”
x = FindIt(a, b)
txtBox.Text = CStr(x)
End Sub
Function FindIt(ByVal z1 as String, ByVal z2 as String) As Integer
Dim x as Integer
x = z1.IndexOf(z2)
End Function
“How now”

1. 8

2.0

3.An error

4. None of the above

Posted Date:-2022-02-11 09:44:21


Question:
What type of items are valid for use in the value list of a Case clause?

1. literals

2.variables

3.expressions

4.All of the above

Posted Date:-2022-02-11 09:35:02


Question:
What will be the output of the following program when the button is clicked?
Private Sub btnDisplay_Click(…) Handles btnDisplay.Click
Dim number As Double = 3
DoubleAndSquare(number)
txtBox.Text = CStr(number)
End Sub
Sub DoubleAndSquare(ByRef myVar As Double)
myVar = myVar + myVar
myVar = myVar * myVar

1. 3

2.36

3.6

4.0

Posted Date:-2022-02-11 09:37:29


Question:
What will be the output of the following program when the button is clicked?
Private Sub btnDisplay_Click(…) Handles btnDisplay.Click
Dim word, result As String
word = “Benjamin”
result = Rotate(word)
result = Rotate(result & word)
result = Rotate(result)
txtBox.Text = result
End Sub
Function Rotate(ByVal var As String) As String
Dim varlength As Integer
varlength = var.Length
Return var.Substring(1) & var.Substring(0, 1)
End Function

1. jaminBBenjaminen

2.BenjaminBenjamin

3.njaminBe

4.None of the above.

Posted Date:-2022-02-11 09:43:52


Question:
Which Case clause will be true whenever the value of the selector in a Select Case block is between 1 and 5 or is 8?

1.Case 1 To 8

2.Case 1 To 5, 8

3.Case 1 To 8, 5

4.Case 1 To 5; 8

Posted Date:-2022-02-11 09:34:18


Question:
Which Case clause will be true whenever the value of the selector in a Select Case block is greater than or equal to 7?

1. Case Is >7

2. Case Is = 8

3. Case Is >= 7

4. Case Is <= 8

Posted Date:-2022-02-11 09:34:39


Question:
Which of the following is NOT a reason for using procedures?

1. They break a complex problem down into smaller pieces.

2.They make a program run faster.

3. They can be reused easily.

4. They make it possible for a team of people to work together on a single program.

Posted Date:-2022-02-11 09:39:08


Question:
Which of the following statements is guaranteed to pass the variable numVar by value to the Sub procedure Tally?

1. Tally(numVar)

2.Tally(ByVal numVar)

3. Tally((numVar))

4. Tally(ByVal numVar As Double)

Posted Date:-2022-02-11 09:38:15


Question:
Which one of the following is true about arguments and parameters?

1.Arguments appear in Call statements; parameters appear in Sub statements.

2.Parameters appear in Call statements; arguments appear in Sub statements.

3.They are synonymous terms.

4. They are completely unrelated in a program.

Posted Date:-2022-02-11 09:39:38


Question:
You can specify a range of values in a Case clause by using the To keyword.

1.True

2.False

3.all of the above

4.None of the mentioned

Posted Date:-2022-02-11 09:32:54


More MCQS[bidezones.com ]

  1. VBScript Mcq Question Set 1
  2. VBScript Mcq Question Set 2