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.

Questions and Answers

VBScript Mock Test IV

Q 1 - Which of the following event is triggered when an object goes out of scope or when the object is set to Nothing in VBScript?

A - Class_Initialize

B - Class_Terminate

C - None of the above.

D - Both of the above.

Answer : B

Explaination

Class_Terminate is triggered when an object goes out of scope or when the object is set to Nothing.

Answer : A

Explaination

This class provides file system objects which help the developers to work with drives, folders and files.

Answer : C

Explaination

Both of the above options are correct.

Q 14 - Which of the following is used to capture a runtime Error in VBScript?

A - Err object.

B - Error object.

C - Both of the above.

D - None of the above.

Answer : A

Explaination

If we want to capture the error, then Err Object is used.

Q 15 - Which of the following is used to throw an error in VBScript?

A - Err.raise

B - throw Err.

C - Both of the above.

D - None of the above.

Answer : A

Explaination

Use Err.Raise to throw an error.

Q 16 - Which of the following is used to get error details in VBScript?

A - Err.Number

B - Err.Description

C - Both of the above.

D - None of the above.

Answer : C

Explaination

Err.Number gives the error number and Err.Description gives error description.

Q 17 - Which of the following is used to clear error in VBScript?

A - Err.Clear

B - Err.Delete

C - Both of the above.

D - None of the above.

Answer : A

Explaination

Err.Clear clear an error.

Q 18 - Is VBScript case sensitive?

A - True

B - false

Answer : B

Explaination

No! VBScript is a case-insensitive language. This means that language keywords, variables, function names and any other identifiers need NOT be typed with a consistent capitalization of letters.

Answer : A

Explaination

The numeric values should be assigned without double quotes.

Answer : B

Explaination

The string values should be enclosed within doublequotes.

Answer : C

Explaination

The date values should be enclosed within hash symbol.

Answer : C

Explaination

The time values should be enclosed within hash symbol.

Q 23 - What is the output of A + B in VBScript if A = "VB" and B = "Script"?

A - VBScript

B - Error

Answer : A

Explaination

+ operator concatenates two Values if values are string. So A + B will give VBScript.

Q 24 - What is the output of A & B in VBScript if A = 5 and B = 10?

A - 15

B - 510

Answer : B

Explaination

& operator concatenates two values. So A + B will give 510.

Q 25 - What is the output of A & B in VBScript if A = "VB" and B = "Script"?

A - VBScript

B - Error

Answer : A

Explaination

& operator concatenates two values. So A & B will give VBScript.

Answer Sheet

Question Number Answer Key
1 B
2 A
3 A
4 B
5 C
6 D
7 A
8 B
9 C
10 D
11 C
12 C
13 C
14 A
15 A
16 C
17 A
18 B
19 A
20 B
21 C
22 C
23 A
24 B
25 A
vbscript_questions_answers.htm
Advertisements