- VBScript Tutorial
- VBScript - Home
- VBScript - Overview
- VBScript - Syntax
- VBScript - Enabling
- VBScript - Placement
- VBScript - Variables
- VBScript - Constants
- VBScript - Operators
- VBScript - Decisions
- VBScript - Loops
- VBScript - Events
- VBScript - Cookies
- VBScript - Numbers
- VBScript - Strings
- VBScript - Arrays
- VBScript - Date
- VBScript Advanced
- VBScript - Procedures
- VBScript - Dialog Boxes
- VBScript - Object Oriented
- VBScript - Reg Expressions
- VBScript - Error Handling
- VBScript - Misc Statements
- VBScript Useful Resources
- VBScript - Questions and Answers
- VBScript - Quick Guide
- VBScript - Useful Resources
- VBScript - Discussion
VBScript Mock Test
This section presents you various set of Mock Tests related to VBScript Framework. You can download these sample mock tests at your local machine and solve offline at your convenience. Every mock test is supplied with a mock test key to let you verify the final score and grade yourself.
VBScript Mock Test III
Q 1 - What StrComp(String1, String2) returns if String1 is greater than String2 in lexicographical order?
Answer : C
Explaination
StrComp(String1, String2) returns 1 if String1 is greater than String2 in lexicographical order.
Q 2 - How will you get a string with the specified character the specified number of times in VBScript?
Answer : D
Explaination
Using String function, which returns a String with a specified character the specified number of times.
Q 3 - How will you reverse a String in VBScript?
Answer : A
Explaination
Using StrReverse function, which returns a String after reversing the sequece of the characters of the given string.
Q 4 - Which of the following is a correct way to declare array in VBScript?
Answer : D
Explaination
All of the above options are correct.
Q 5 - Which of the following is a correct way to assign a value to an array element in VBScript?
Answer : A
Explaination
arr(0) = "VBScript" is the correct way.
Q 6 - How will you increase the size of an array in VBScript?
Answer : A
Explaination
Using ReDim statement, we can declare dynamic-array variables and allocate or reallocate storage space.
Q 7 - How will you get the smallest subscript of an array in VBScript?
Answer : B
Explaination
Using LBound function, which returns an integer that corresponds to the smallest subscript of the given arrays.
Q 8 - How will you get the largest subscript of an array in VBScript?
Answer : C
Explaination
Using UBound function, which returns an integer that corresponds to the largest subscript of the given arrays.
Q 9 - How will you split a string into an array in VBScript?
Answer : D
Explaination
Using Split function, which returns an array that contains a specified number of values. Split will be based on a Delimiter.
Q 10 - How will you get a combined string from array of string in VBScript?
Answer : A
Explaination
Using Join function, which returns a String that contains a specified number of substrings in an array.
Q 11 - How will you get a subset of a array in VBScript?
Answer : B
Explaination
Using Filter function, returns a zero based array that contains a subset of a string array based on a specific filter criteria.
Q 12 - How will you check that a variable is an array in VBScript?
Answer : C
Explaination
Using IsArray function, which returns a boolean value that indicates whether or not the input variable is an array.
Q 13 - How will you release the memory acquired by an array variable in VBScript?
Answer : D
Explaination
Using Erase Function, which recovers the allocated memory for the array variables.
Q 14 - How to call a function in VBScript?
Answer : A
Explaination
To invoke a function in the script, you would simple need to write the name of that function with the Call keyword.
Q 15 - How to return a value from a function in VBScript?
Answer : B
Explaination
To return a value from a function, simply assign the value to the function name itself.
Answer : A
Explaination
Yes! A function can return multiple values separated by comma as an array assigned to the function name itself.
Q 17 - Which of the following is correct about subprocedures in VBScript?
A - Sub procedures do not return a value while functions may or may not return a value.
B - Sub procedures can be called without call keyword.
C - Sub procedures are always enclosed within Sub and End Sub statements.
Answer : D
Explaination
All of the above options are correct.
Q 18 - How to pass argument by value to a function in VBScript?
Answer : A
Explaination
If ByVal is specified, then the arguments are sent as by value when the function or procedure is called.
Q 19 - How to pass argument by reference to a function in VBScript?
Answer : B
Explaination
If ByRef is specified, then the arguments are sent as by reference when the function or procedure is called.
Q 20 - Which of the following statements creates an object in VBScript?
A - Set obj = CreateObject("Scripting.Dictionary")
Answer : A
Explaination
Set obj = CreateObject("Scripting.Dictionary") creates an object.
Q 21 - Which of the following statements destroys an object in VBScript?
Answer : B
Explaination
Set obj = Nothing destroys an object.
Q 22 - Which of the following is correct about classes in VBScript?
A - Class is a construct that is used to define a unique type.
Answer : D
Explaination
All of the above options are correct.
Q 23 - Which of the following is correct about classes in VBScript?
A - VBScript classes are enclosed within Class .... End Class
B - Classes can contain variables, which can be of private or public.
C - Variables within classes should follow VBScript naming conventions.
Answer : D
Explaination
All of the above options are correct.
Q 24 - Which of the following is correct about classes in VBScript?
A - By default, the variables in class are Public.
C - Property set, which assigns the new property value to the private object variable.
Answer : D
Explaination
All of the above options are correct.
Q 25 - Which of the following event is triggered when an object is instantiated in VBScript?
Answer : A
Explaination
Class_Initialize is triggered whenever you instantiate an object based on the class.
Answer Sheet
Question Number | Answer Key |
---|---|
1 | C |
2 | D |
3 | A |
4 | D |
5 | A |
6 | A |
7 | B |
8 | C |
9 | D |
10 | A |
11 | B |
12 | C |
13 | D |
14 | A |
15 | B |
16 | A |
17 | D |
18 | A |
19 | B |
20 | A |
21 | B |
22 | D |
23 | D |
24 | D |
25 | A |