πŸ§ͺ VBScript MCQ Quiz Hub

VBScript Mcq Question Set 2

Choose a topic to test your knowledge and improve your VBScript skills

A single Case statement can contain multiple values.





βœ… Correct Answer: 1

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





βœ… Correct Answer: 1

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





βœ… Correct Answer: 1

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





βœ… Correct Answer: 4

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





βœ… Correct Answer: 2

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?





βœ… Correct Answer: 2

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





βœ… Correct Answer: 3

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





βœ… Correct Answer: 4

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





βœ… Correct Answer: 2

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?





βœ… Correct Answer: 1

: 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?





βœ… Correct Answer: 3

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





βœ… Correct Answer: 3

Variables declared inside a procedure are said to have _____





βœ… Correct Answer: 1

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





βœ… Correct Answer: 2

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





βœ… Correct Answer: 4

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





βœ… Correct Answer: 4

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





βœ… Correct Answer: 3

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





βœ… Correct Answer: 2

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





βœ… Correct Answer: 1

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





βœ… Correct Answer: 3

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





βœ… Correct Answer: 1

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





βœ… Correct Answer: 1

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





βœ… Correct Answer: 1

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





βœ… Correct Answer: 2

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.





βœ… Correct Answer: 2

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





βœ… Correct Answer: 2

Function procedures can invoke other Function procedures.





βœ… Correct Answer: 1

A Function may return up to two values.





βœ… Correct Answer: 2

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





βœ… Correct Answer: 4

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





βœ… Correct Answer: 2

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?





βœ… Correct Answer: 2

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





βœ… Correct Answer: 1

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”





βœ… Correct Answer: 4

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





βœ… Correct Answer: 2

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





βœ… Correct Answer: 1

A counter variable is normally incremented or decremented by 1.





βœ… Correct Answer: 1

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





βœ… Correct Answer: 2

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





βœ… Correct Answer: 2

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?





βœ… Correct Answer: 2