Choose a topic to test your knowledge and improve your VBScript skills
A single Case statement can contain multiple values.
You can specify a range of values in a Case clause by using the To keyword.
A variable declared inside a Select Case block cannot be referred to by code outside of the block.
Suppose that the selector in a Select Case block is the string variable myVar. Which of the following is NOT a valid Case clause?
Different items appearing in the same value list of a Select Case block must be separated by a ______
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?
Which Case clause will be true whenever the value of the selector in a Select Case block is greater than or equal to 7?
What type of items are valid for use in the value list of a Case clause?
What happens to a variable declared locally inside a Sub procedure after the procedure terminates?
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?
: 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?
The declaration statement for a class-level variable should be placed _____
Variables declared inside a procedure are said to have _____
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
Suppose the variable myName is declared in a Dim statement in two different Sub procedures. Which statement is true?
Which of the following statements is guaranteed to pass the variable numVar by value to the Sub procedure Tally?
The _________ of a Sub procedure are vehicles for passing numbers and strings to the Sub procedure.
Which of the following is NOT a reason for using procedures?
Which one of the following is true about arguments and parameters?
Each individual variable in the list student(0), student(1), student(2) is known as a(n)
The statement Const TAX_RATE As Doubleface=Calibri size=2> is not valid.
Function names should be suggestive of the role performed. The names also must conform to the rules for naming variables.
The input to a user-defined function can consist of one or more values.
Both the input and output of a Function procedure can consist of several values.
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.
Although a function can return a value, it cannot directly display information in a text box.
Function procedures can invoke other Function procedures.
A Function may return up to two values.
The input to a user-defined function can consist of:
Variables appearing in the header of a Function procedure are called ____
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?
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
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β
A Do While loop checks the While condition before executing the statements in the loop.
A Do?Loop Until block is always executed at least once
A counter variable is normally incremented or decremented by 1.
The value of the control variable should not be altered within the body of a For?Next loop.
The body of a Forβ¦Next loop in Visual Basic will always be executed once no matter what the initial and terminating values are.
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?