VBScript Mock Test


Advertisements


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 I

Answer : D

Explaination

All of the above options are correct.

Q 4 - Which of the following keyword is used to declare a variable in VBScript?

A - variant

B - var

C - dim

D - None of the above.

Answer : C

Explaination

Variables are declared using 'dim' keyword.

Q 5 - Is it required to specify the type of variable during declaration in VBScript?

A - true

B - false

Answer : B

Explaination

No! Since there is only ONE fundamental data type, all the declared variables are variant by default.

Q 6 - Which of the following is a valid scope in VBScript?

A - Dim

B - Public

C - Private

D - All of the above.

Answer : D

Explaination

All of the above are valid scopes in VBScript.

Q 7 - In Which of the following scope, variables are available to all the procedures across all the associated scripts in VBScript?

A - Dim

B - Public

C - Private

D - All of the above.

Answer : B

Explaination

In Public scope, variables are available to all the procedures across all the associated scripts.

Answer : C

Explaination

Variables declared using 'Dim' keyword at a Procedure level are available only within the same procedure. Variables declared using 'Dim' Keyword at script level are available to all the procedures within the same script.

Answer : C

Explaination

Variables declared using 'Public' Keyword are available to all the procedures across all the associated scripts. When declaring a variable of type 'public', Dim keyword is replaced by 'Public'.

Answer : C

Explaination

Variables that are declared as 'Private' have scope only within that script in which they are declared. When declaring a variable of type 'Private', Dim keyword is replaced by 'Private'.

Q 11 - Which of the following is used to create a constant in VBScript?

A - constant

B - const

C - final

D - None of the above.

Answer : B

Explaination

Constants are declared using 'const' keyword.

Answer : A

Explaination

The Public constants are available for all the scripts and procedures.

Answer : B

Explaination

The Private Constants are available within the procedure or Class.

Q 14 - Which of the following operator is supported in VBScript?

A - Arithmetic Operators

B - Comparison Operators

C - Logical Operators

D - All of the above.

Answer : D

Explaination

All of the above operators are supported in VBScript.

Q 15 - Which of the following operator can be used to get the modulus of two numbers in VBScript?

A - MOD

B - %

C - REMAINDER

D - None of the above.

Answer : A

Explaination

MOD opeator is used to get the modulus of two numbers.

Q 16 - Which of the following operator can be used to get the exponent of two numbers in VBScript?

A - EXP

B - ^

C - EXPONENT

D - None of the above.

Answer : B

Explaination

^ opeator is used to get the exponent of two numbers.

Q 17 - Which of the following operator can be used to check if two numbers are equal or not in VBScript?

A - !=

B - <>

C - not

D - None of the above.

Answer : B

Explaination

<> operator is used to check if two numbers are equal or not.

Q 18 - Which of the following operator can be used to do an XOR operation in VBScript?

A - ~

B - ^

C - XOR

D - None of the above.

Answer : C

Explaination

XOR is used to do an XOR operation.

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

A - 15

B - 510

Answer : A

Explaination

+ operator adds two Values as Variable Values are Numeric. So A + B will give 15.

Q 20 - Can you access Cookie using VBScript?

A - true

B - false

Answer : A

Explaination

Yes! VBScript can also manipulate cookies using the cookie property of the Document object.

Answer : A

Explaination

document.cookie = 'key1 = value1; key2 = value2; expires = date'; is the correct option.

Q 23 - Which of the following function of VBScript converts a given number of any variant subtype to Double?

A - CDbl

B - CInt

C - CLng

D - CSng

Answer : A

Explaination

CDbl function converts a given number of any variant subtype to Double.

Q 24 - Which of the following function of VBScript converts a given number of any variant subtype to Integer?

A - CDbl

B - CInt

C - CLng

D - CSng

Answer : B

Explaination

CInt function converts a given number of any variant subtype to Integer.

Q 25 - Which of the following function of VBScript converts a given number of any variant subtype to Long?

A - CDbl

B - CInt

C - CLng

D - CSng

Answer : C

Explaination

CLng function converts a given number of any variant subtype to Long.

Answer Sheet

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

vbscript_questions_answers.htm

Advertisements
E-Books Store