InterviewSolution
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 51. |
How Will You Convert A String To Upper Case String Using Vbscript? |
|
Answer» USING Ucase function, which RETURNS the upper case of the SPECIFIED STRING. Using Ucase function, which returns the upper case of the specified string. |
|
| 52. |
How Will You Convert A String To Lower Case String Using Vbscript? |
|
Answer» Using Lcase FUNCTION, which returns the LOWER CASE of the SPECIFIED string. Using Lcase function, which returns the lower case of the specified string. |
|
| 53. |
How Will You Get The Last Occurrence Of One String Within Another String Using Vbscript? |
|
Answer» Using InStrRev FUNCTION, which RETURNS the first occurrence of one string within another string. The SEARCH happens from RIGHT to left. Using InStrRev function, which returns the first occurrence of one string within another string. The search happens from right to left. |
|
| 54. |
How Will You Get The First Occurrence Of One String Within Another String Using Vbscript? |
|
Answer» Using InStr function, which RETURNS the first occurrence of ONE string within ANOTHER string. The SEARCH happens from left to right. Using InStr function, which returns the first occurrence of one string within another string. The search happens from left to right. |
|
| 55. |
How Will You Get The Exponent Of The Given Number In Vbscript? |
|
Answer» Using EXP FUNCTION, which returns the value of e RAISED to the specified number. Example: Dim NUM : num = -645.998651<BR>document.write("Exp Result of num is : " & Exp(num))& "<br/>" '2.79479883633128E-281 Using Exp function, which returns the value of e raised to the specified number. Example: Dim num : num = -645.998651 |
|
| 56. |
How Will You Get The Absolute Value Of The Given Number In Vbscript? |
|
Answer» Using Abs function, which returns the absolute value of the GIVEN number. DIM num : num = -645.998651 Using Abs function, which returns the absolute value of the given number. Example: Dim num : num = -645.998651 |
|
| 57. |
How Will You Get The Square Root Of The Given Number In Vbscript? |
|
Answer» Using Sqr function, which returns the SQUARE root of the GIVEN number. Example: Dim num : num = -210 Using Sqr function, which returns the square root of the given number. Example: Dim num : num = -210 |
|
| 58. |
How Will You Get A Random Number Between 0 And 1 In Vbscript? |
|
Answer» Using Rnd function,which returns a RANDOM number between 0 and 1. Example: Dim NUM : num = -645.998651 Using Rnd function,which returns a random number between 0 and 1. Example: Dim num : num = -645.998651 |
|
| 59. |
How Will You Get The Hexadecimal Value Of The Given Number In Vbscript? |
|
Answer» Using Hex function, which returns the hexadecimal value of the GIVEN number. Example: Dim num : num = -645.998651<BR>document.write("Hex Result of num is : " & Hex(num))& "<br/>" 'FFFFFD7A Using Hex function, which returns the hexadecimal value of the given number. Example: Dim num : num = -645.998651 |
|
| 60. |
How Will You Get The Octal Value Of The Given Number In Vbscript? |
|
Answer» Using Oct FUNCTION, which returns the OCTAL value of the given number. Dim num : num = -645.998651 Using Oct function, which returns the octal value of the given number. Example: Dim num : num = -645.998651 |
|
| 61. |
How Will You Get The Natural Logarithm Of The Given Number In Vbscript? |
|
Answer» Using Log function, which returns the natural LOGARITHM of the given number. Example: DIM num : num = 210<BR>document.write("Log Result of NUM2 is : " & Log(num2))& "<br/>" '5.34710753071747 Using Log function, which returns the natural logarithm of the given number. Example: Dim num : num = 210 |
|
| 62. |
How Will You Get The Integer Part Of A Number In Vbscript? |
|
Answer» Using INT function, which returns the integer part of the GIVEN number. Example: DIM num : num = -645.998651<BR>document.write("int RESULT of num is : " & int(num))& "<br/>" '-646 Using Int function, which returns the integer part of the given number. Example: Dim num : num = -645.998651 |
|
| 63. |
How Will You Format A Number In Percetage Format In Vbscript? |
|
Answer» Using FormatPercent function, which would RETURN an EXPRESSION formatted as a percent. Example: Dim num : num = -645.998651<BR>document.write(FormatPercent(num, 2))& "<br/>" '-64,599.86% Using FormatPercent function, which would return an expression formatted as a percent. Example: Dim num : num = -645.998651 |
|
| 64. |
How Will You Format A Number Upto 3 Decimal Places In Vbscript? |
|
Answer» Using FormatNumber function, which would return an EXPRESSION formatted as a number. Example: Dim NUM : num = -645.998651<BR>document.write(FormatNumber(num, 3))& "<br/>" '-645.999 Using FormatNumber function, which would return an expression formatted as a number. Example: Dim num : num = -645.998651 |
|
| 65. |
How Will You Convert A Given Number To Hexadecimal In Vbscript? |
|
Answer» Using Hex FUNCTION, which CONVERTS a given number of any variant subtype to Hexadecimal. Example: X = 123 Using Hex function, which converts a given number of any variant subtype to Hexadecimal. Example: x = 123 |
|
| 66. |
How Will You Convert A Given Number To Single In Vbscript? |
|
Answer» Using CSng FUNCTION, which converts a given number of any VARIANT subtype to SINGLE. x = 123<BR>y = 123.882 Using CSng function, which converts a given number of any variant subtype to Single. Example: x = 123 |
|
| 67. |
How Will You Convert A Given Number To Long In Vbscript? |
|
Answer» Using CLng function, which CONVERTS a given NUMBER of any variant subtype to LONG. Example: x = 123 Using CLng function, which converts a given number of any variant subtype to Long. Example: x = 123 |
|
| 68. |
How Will You Convert A Given Number To Integer In Vbscript? |
|
Answer» Using CInt FUNCTION, which converts a given NUMBER of any VARIANT SUBTYPE to Integer. Example: x = 123 Using CInt function, which converts a given number of any variant subtype to Integer. Example: x = 123 |
|
| 69. |
How Will You Convert A Given Number To Double In Vbscript? |
|
Answer» Using CDbl function, which converts a GIVEN number of any VARIANT subtype to double. x = 123 Using CDbl function, which converts a given number of any variant subtype to double. Example: x = 123 |
|
| 70. |
How To Delete A Cookie Using Vbscript? |
|
Answer» Sometimes you will want to delete a cookie so that subsequent ATTEMPTS to READ the cookie return nothing. To do this, you just NEED to set the expiration date to a TIME in the PAST. Sometimes you will want to delete a cookie so that subsequent attempts to read the cookie return nothing. To do this, you just need to set the expiration date to a time in the past. |
|
| 71. |
How To Read A Cookie Using Vbscript? |
|
Answer» Reading a COOKIE is just as simple as writing ONE, because the value of the document.cookie object is the cookie. So you can USE this string WHENEVER you WANT to access the cookie. The document.cookie string will keep a list of name=value pairs separated by semicolons, where name is the name of a cookie and value is its string value. You can use strings' split() function to break the string into key and values. Reading a cookie is just as simple as writing one, because the value of the document.cookie object is the cookie. So you can use this string whenever you want to access the cookie. The document.cookie string will keep a list of name=value pairs separated by semicolons, where name is the name of a cookie and value is its string value. You can use strings' split() function to break the string into key and values. |
|
| 72. |
How To Create A Cookie Using Vbscript? |
|
Answer» The simplest WAY to create a cookie is to ASSIGN a string value to the document.cookie object, which looks like this: Syntax: document.cookie = "key1 = value1; key2 = value2; EXPIRES = date"; Here expires attribute is OPTIONAL. If you provide this attribute with a valid date or time then cookie will expire at the given date or time and after that COOKIES' value will not be accessible. The simplest way to create a cookie is to assign a string value to the document.cookie object, which looks like this: Syntax: document.cookie = "key1 = value1; key2 = value2; expires = date"; Here expires attribute is optional. If you provide this attribute with a valid date or time then cookie will expire at the given date or time and after that cookies' value will not be accessible. |
|
| 73. |
Can You Access Cookie Using Vbscript? |
|
Answer» VBScript can ALSO manipulate cookies USING the cookie PROPERTY of the Document object. JavaScript can read, create, modify, and delete the cookie or cookies that apply to the current web PAGE. VBScript can also manipulate cookies using the cookie property of the Document object. JavaScript can read, create, modify, and delete the cookie or cookies that apply to the current web page. |
|
| 74. |
What Is The Output Of A & B In Vbscript If A = "vb" And B = "script"? |
|
Answer» & OPERATOR CONCATENATES TWO VALUES. So A & B will GIVE VBScript. & operator concatenates two values. So A & B will give VBScript. |
|
| 75. |
What Is The Output Of A & B In Vbscript If A = 5 And B = 10? |
|
Answer» & operator concatenates TWO VALUES. So A + B will give 510. & operator concatenates two values. So A + B will give 510. |
|
| 76. |
What Is The Output Of A + B In Vbscript If A = "vb" And B = "script"? |
|
Answer» + operator concatenates TWO VALUES if values are string. So A + B will GIVE VBSCRIPT. + operator concatenates two Values if values are string. So A + B will give VBScript. |
|
| 77. |
What Is The Output Of A + B In Vbscript If A = 5 And B = 10? |
|
Answer» + operator ADDS two VALUES as Variable Values are Numeric. So A + B will GIVE 15. + operator adds two Values as Variable Values are Numeric. So A + B will give 15. |
|
| 78. |
Which Opearator Can Be Used To Do An Xor Operation In Vbscript? |
|
Answer» XOR Called LOGICAL Exclusion operator. It is USED to do an XOR OPERATION. A. DIM a : a = 5 XOR Called Logical Exclusion operator. It is used to do an XOR operation. Example: A. Dim a : a = 5 |
|
| 79. |
Which Opearator Can Be Used To Check If Two Numbers Are Equal Or Not In Vbscript? |
|
Answer» <> operator is USED to check if two NUMBERS are equal or not. Example: Dim a : a = 5 <> operator is used to check if two numbers are equal or not. Example: Dim a : a = 5 |
|
| 80. |
Which Opearator Can Be Used To Get The Exponent Of A Number In Vbscript? |
|
Answer» ^ OPEATOR is USED to get the EXPONENT of two numbers. Example: Dim a : a = 5 ^ opeator is used to get the exponent of two numbers. Example: Dim a : a = 5 |
|
| 81. |
Which Opearator Can Be Used To Get The Modulus Of Two Numbers In Vbscript? |
|
Answer» MOD opeator is used to GET the modulus of two NUMBERS. Example: Dim a : a = 5 MOD opeator is used to get the modulus of two numbers. Example: Dim a : a = 5 |
|
| 82. |
How Many Types Of Operators Vbscript Supports? |
|
Answer» VBScript LANGUAGE SUPPORTS following types of OPERATORS:
VBScript language supports following types of operators: |
|
| 83. |
What Is The Scopt Of Constant Declared Using Private? |
|
Answer» PRIVATE Constants are available WITHIN the procedure or CLASS. Private Constants are available within the procedure or Class. |
|
| 84. |
What Is The Scope Of A Constant Declared Using Public? |
|
Answer» The PUBLIC CONSTANTS are AVAILABLE for all the SCRIPTS and PROCEDURES. The Public constants are available for all the scripts and procedures. |
|
| 85. |
How Will You Declare A Constant In Vbscript? |
|
Answer» CONSTANTS are DECLARED USING "CONST" KEYWORD. Constants are declared using "const" keyword. |
|
| 86. |
What Is The Scope Of A Variable Declared Using Private? |
|
Answer» 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". 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". |
|
| 87. |
What Is The Scope Of A Variable Declared Using Public? |
|
Answer» 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". 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". |
|
| 88. |
What Is The Scope Of A Variable Declared Using Dim? |
|
Answer» 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. 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. |
|
| 89. |
What Are The Valid Scopes Of A Variable In Vbscript? |
|
Answer» FOLLOWING are the scopes of variable in VBSCRIPT: Following are the scopes of variable in VBScript: |
|
| 90. |
How To Assign A Date Value To A Variable? |
|
Answer» Date and TIME variables should be ENCLOSED WITHIN hash SYMBOL(#). Date and Time variables should be enclosed within hash symbol(#). |
|
| 91. |
How To Assign A String Value To A Variable? |
|
Answer» The STRING VALUES should be ENCLOSED WITHIN DOUBLEQUOTES("). The String values should be enclosed within doublequotes("). |
|
| 92. |
How To Assign A Numeric Value To A Variable? |
|
Answer» The NUMERIC VALUES should be ASSIGNED without double QUOTES. The numeric values should be assigned without double quotes. |
|
| 93. |
Do You Need To Specify The Type Of Variable During Declaration? |
|
Answer» No SINCE there is only ONE FUNDAMENTAL data type, all the DECLARED variables are variant by default. Hence, a user NEED NOT mention the type of data during declaration. No Since there is only ONE fundamental data type, all the declared variables are variant by default. Hence, a user NEED NOT mention the type of data during declaration. |
|
| 94. |
How Do You Declare A Variable In Vbscript? |
|
Answer» VARIABLES are DECLARED USING "DIM" KEYWORD. Variables are declared using "dim" keyword. |
|
| 95. |
What Are The Variable Naming Conventions In Vbscript? |
|
Answer» Variable is a named memory location used to hold a value that can be CHANGED during the script EXECUTION. VBScript has only ONE fundamental DATA type, VARIANT. Rules for Declaring Variables:
Variable is a named memory location used to hold a value that can be changed during the script execution. VBScript has only ONE fundamental data type, Variant. Rules for Declaring Variables: |
|
| 96. |
Is Vbscript Case Sensitive? |
|
Answer» 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. So identifiers int_counter, INT_Counter and INT_COUNTER have the same meaning within VBScript. 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. So identifiers int_counter, INT_Counter and INT_COUNTER have the same meaning within VBScript. |
|
| 97. |
What Are The Disadvantages Of Vbscript? |
|
Answer» Following are the disadvantages of VBScript:
Following are the disadvantages of VBScript: |
|
| 98. |
What Are The Advantages Of Vbscript? |
|
Answer» Following are the advantages of VBSCRIPT:
Following are the advantages of VBScript: |
|
| 99. |
What Is Vbscript? |
|
Answer» Microsoft VBScript (Visual Basic Script) is a general-purpose, lightweight and active scripting LANGUAGE DEVELOPED by Microsoft that is modelled on Visual Basic. Nowadays, VBScript is the primary scripting language for Quick Test PROFESSIONAL (QTP), which is a test automation tool. Microsoft VBScript (Visual Basic Script) is a general-purpose, lightweight and active scripting language developed by Microsoft that is modelled on Visual Basic. Nowadays, VBScript is the primary scripting language for Quick Test Professional (QTP), which is a test automation tool. |
|