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 II

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

A - CDbl

B - CInt

C - CLng

D - CSng

Answer : D

Explaination

CSng function converts a given number of any variant subtype to Single.

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

A - Hex

B - CInt

C - CLng

D - CSng

Answer : A

Explaination

Hex function converts a given number of any variant subtype to Hexadecimal.

Q 3 - How will you format a number upto 3 decimal places in VBScript?

A - Using FormatNumber Function

B - Using FormatPercent function

C - Using Int function

D - Using Log function

Answer : A

Explaination

Using FormatNumber function, which would return an expression formatted as a number.

Q 4 - How will you format a number in percetage format in VBScript?

A - Using FormatNumber Function

B - Using FormatPercent function

C - Using Int function

D - Using Log function

Answer : B

Explaination

Using FormatPercent function, which would return an expression formatted as a percent.

Answer : C

Explaination

Using Int function, which returns the integer part of the given number.

Q 6 - How will you get the natural logarithm of the given number in VBScript?

A - Using FormatNumber Function

B - Using FormatPercent function

C - Using Int function

D - Using Log function

Answer : D

Explaination

Using Log function, which returns the natural logarithm of the given number.

Q 7 - How will you get the octal value of the given number in VBScript?

A - Using Oct function

B - Using Hex function

C - Using Rnd function

D - Using Sqr function

Answer : A

Explaination

Using Oct function, which returns the octal value of the given number.

Q 8 - How will you get the hexadecimal value of the given number in VBScript?

A - Using Oct function

B - Using Hex function

C - Using Rnd function

D - Using Sqr function

Answer : B

Explaination

Using Hex function, which returns the hexadecimal value of the given number.

Q 9 - How will you get a random number between 0 and 1 in VBScript?

A - Using Oct function

B - Using Hex function

C - Using Rnd function

D - Using Sqr function

Answer : C

Explaination

Using Rnd function,which returns a random number between 0 and 1.

Q 10 - How will you get the square root of the given number in VBScript?

A - Using Oct function

B - Using Hex function

C - Using Rnd function

D - Using Sqr function

Answer : D

Explaination

Using Sqr function, which returns the square root of the given number.

Q 11 - How will you get the absolute value of the given number in VBScript?

A - Using Abs function

B - Using Exp function

C - Using InStr function

D - Using InStrRev function

Answer : A

Explaination

Using Abs function, which returns the absolute value of the given number.

Q 12 - How will you get the exponent of the given number in VBScript?

A - Using Abs function

B - Using Exp function

C - Using InStr function

D - Using InStrRev function

Answer : B

Explaination

Using Exp function, which returns the value of e raised to the specified number.

Q 13 - How will you get the first occurrence of one string within another string using VBScript?

A - Using Abs function

B - Using Exp function

C - Using InStr function

D - Using InStrRev function

Answer : C

Explaination

Using InStr function, which returns the first occurrence of one string within another string. The search happens from left to right.

Q 14 - How will you get the last occurrence of one string within another string using VBScript?

A - Using Abs function

B - Using Exp function

C - Using InStr function

D - Using InStrRev function

Answer : D

Explaination

Using InStrRev function, which returns the first occurrence of one string within another string. The search happens from right to left.

Q 15 - How will you convert a string to lower case string using VBScript?

A - Using Lcase function

B - Using Ucase function

C - Using Ltrim function

D - Using Rtrim function

Answer : A

Explaination

Using Lcase function, which returns the lower case of the specified string.

Q 16 - How will you convert a string to upper case string using VBScript?

A - Using Lcase function

B - Using Ucase function

C - Using Ltrim function

D - Using Rtrim function

Answer : B

Explaination

Using Ucase function, which returns the upper case of the specified string.

Q 17 - How will you trim the spaces on the left of a string using VBScript?

A - Using Lcase function

B - Using Ucase function

C - Using Ltrim function

D - Using Rtrim function

Answer : C

Explaination

Using Ltrim function, which returns a string after removing the spaces on the left side of the specified string.

Q 18 - How will you trim the spaces on the right of a string using VBScript?

A - Using Lcase function

B - Using Ucase function

C - Using Ltrim function

D - Using Rtrim function

Answer : D

Explaination

Using Rtrim function, which returns a string after removing the spaces on the right side of the specified string.

Q 19 - How will you trim the leading as well as trailing spaces of a string using VBScript?

A - Using Trim function

B - Using Len function

C - Using Replace function

D - Using Space function

Answer : A

Explaination

Using Trim function, which returns a string value after removing both leading and trailing blank spaces.

Q 20 - How will you get length of a string using VBScript?

A - Using Trim function

B - Using Len function

C - Using Replace function

D - Using Space function

Answer : B

Explaination

Using Len function, which returns the length of the given string.

Q 21 - How will you replace a string with another string using VBScript?

A - Using Trim function

B - Using Len function

C - Using Replace function

D - Using Space function

Answer : C

Explaination

Using Replace function, which returns a string after replacing a string with another string.

Q 22 - How will you fill the string with the specified number of spaces using VBScript?

A - Using Trim function

B - Using Len function

C - Using Replace function

D - Using Space function

Answer : D

Explaination

Using Space function, which fills a string with the specified number of spaces.

Answer : A

Explaination

Using StrComp function, which returns an integer value after comparing the two specified strings.

Q 24 - What StrComp(String1, String2) returns if String1 is less than String2 in lexicographical order?

A - -1

B - 0

C - 1

D - None of the above.

Answer : A

Explaination

StrComp(String1, String2) returns -1 if String1 is less than String2 in lexicographical order.

Q 25 - What StrComp(String1, String2) returns if String1 is same as String2?

A - -1

B - 0

C - 1

D - None of the above.

Answer : B

Explaination

StrComp(String1, String2) returns 0 if String1 is same as String2.

Answer Sheet

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