Olete.in
Articles
Mock Tests
🧪 VBScript MCQ Quiz Hub
VBScript Mcq Question Set 1
Choose a topic to test your knowledge and improve your VBScript skills
1. How will you trim the leading as well as trailing spaces of a string using VBScript?
Using Trim function
Using Len function
Using Replace function
Using Space function
2. Where to Put the VBScript code
Head section
Body Section
Both body and head section
None of these
3. What does the Option Explicit directive do?
It forces you to declare all of your variables
It forces you to call the method
It forces you to declare all of your static variables
It forces you to declare all of your global variables
4. Which VBScript function converts an input string to all lowercase?
LCase
LowerCase
Lower
There is no such function to directly convert to lowercase
5. Extension of ActiveX designers
.dsr
.axd
.adx
none of the mentioned
6. VBScript was launched in
1995
1996
1994
1997
7. VBScript is developed by
Netscape
Opera
Sun
Microsoft
8. Which browser has built-in support for executing VBScript?
Internet Explorer
Mozilla Firefox
Opera
None of these
9. In the Select Case statement, which case is used for unknown cases?
Else
Default
Unknown
Not possible
10. How to take request using get bmethod?
Using Request.form
Using Response.write
Using Request.Querystring
Using Request.Servarvariables
11. _______ is used for finding out about objects, properties and methods.
Object browser
Form layout window
Code editor window
none of the above
12. The Visual Basic Code Editor will automatically detect certain types of errors as you are entering code.
True
False
all of the above
None of the mentioned
13. Keywords are also referred to as reserved words.
True
False
all of the above
None of the mentioned
14. The divide-and-conquer-method of problem solving breaks a problem into large, general pieces first, then refines each piece until the problem is manageable.
True
False
all of the above
None of the mentioned
15. Visual Basic responds to events using which of the following?
a code procedure
an event procedure
a form procedure
a property
16. When the user clicks a button, _________ is triggered.
an event
a method
a setting
a property
17. What property of controls tells the order they receive the focus when the tab key is pressed during run time?
Focus order
Focus number
Tab index
Control order
18. Sizing Handles make it very easy to resize virtually any control when developing applications with Visual Basic. When working in the Form Designer, how are these sizing handles displayed?
A rectangle with 4 arrows, one in each corner, around your control.
A 3-D outline around your control.
A rectangle with small squares around your control.
None of the above.
19. The Properties window plays an important role in the development of Visual Basic applications. It is mainly used
to change how objects look and feel.
when opening programs stored on a hard drive.
to allow the developer to graphically design program components.
to set program related options like Program Name, Program Location, etc.
20. When creating a new application in Visual Basic, you are asked to supply a name for the program. If you do not specify a name, a default name is XXXXX XXXXX is this default name?
Wapplication followed by a number.
Application followed by a number.
WindowsApplication.
WindowsApplication followed by a number.
21. Which of the properties in a control’s list of properties is used to give the control a meaningful name?
Text
ContextMenu
ControlName
name
22. Pseudocode is
data that have been encoded for security.
the incorrect results of a computer program.
a program that doesn’t work.
a description of an algorithm similar to a computer language.
23. An algorithm is defined as:
a mathematical formula that solves a problem.
a tempo for classical music played in a coda.
a logical sequence of steps that solve a problem.
a tool that designs computer programs and draws the user interface.
24. A variable declared inside an event procedure is said to have local scope
True
False
all of the above
None of the mentioned
25. A variable declared outside of an event procedure is said to have class-level scope.
True
False
all of the above
None of the mentioned
26. Option Explicit requires you to declare every variable before its use.
True
False
all of the above
None of the mentioned
27. The value returned by InputBox is a string.
True
False
all of the above
None of the mentioned
28. What is the correct statement when declaring and assigning the value of 100 to an Integer variable called numPeople
Dim numPeople =
Dim numPeople = Int(100)
numPeople = 100
Dim numPeople As Integer = 100
29. Which of the following arithmetic operations has the highest level of precedence?
+ –
* /
^ exponentiation
( )
30. What value will be assigned to the numeric variable x when the following statement is executed? x = 2 + 3 * 4
20
14
92
234
31. Which of the following is a valid name for a variable?
Two_One
2One
Two One
Two.One
32. Keywords in Visual Basic are words that
should be used when naming variables.
are used to name controls, such as TextBox1, Command2, etc.
have special meaning and should not be used when naming variables.
are used as prefixes for control names (such as txt, btn, lbl, and lst).
33. To continue a long statement on another line, use:
an underscore character.
an ampersand character.
Ctrl + Enter.
a space followed by an underscore character.
34. What is the proper syntax when using a message dialog box?
MessageBox.Show(“Hi there”, “Hi”)
MessageBox.Show(Hi there, Hi)
MessageBox.Show “Hi There”, “Hi”
MessageBox.Show Hi There, Hi
35. What will be the output of the following statement? txtBox.Text = FormatCurrency(1234.567)
$1234.567
1,234.57
$1234.57
$1,234.57
36. The following lines of code are correct. If age >= 13 And < 20 Then txtOutput.Text = “You are a teenager.” End If
True
False
all of the above
None of the mentioned
37. Given that x = 7, y = 2, and z = 4, the following If block will display “TRUE”. If (x > y) Or (y > z) Then txtBox.Text = “TRUE” End If
True
False
all of the above
None of the mentioned
38. Asc(“A”) is 65. What is Asc(“C”)?
66
67
68
“C”
39. Asc(“A”) is 65. What is displayed by txtBox.Text = Chr(65) & “BC”?
ABC
A BC
656667
Not enough information is available.
40. Which of the following expressions has as its value the words “Hello World? surrounded by quotation marks?
“Hello World”
Chr(34) &amp; “Hello World”
Chr(34) &amp; Hello World &amp; Chr(34)
Chr(34) &amp; “Hello World” &amp; Chr(34)
41. Which of the following is true?
“Cat” = “cat”
“Cat” &lt; “cat”
“Cat” &gt; “cat”
Relational operators are only valid for numeric values.
42. Which of the following is a valid Visual Basic conditional statement?
2 &lt; n &lt; 5
2 &lt; n Or &lt; 5
2 &lt; n Or 5
(2 &lt; n) Or (n &lt; 5)
43. The three main logical operators are _____, ______, and ________.
And, Or, Not
And, Not, If
Or, Not, If
False, And, True
44. Which value for x would make the following condition true: x >= 5
x is equal to 7
x is equal to 5
x is equal to 5.001
All of the above
45. Which value for x would make the following condition true: Not (x >= 5)
x is equal to 7
x is equal to 4
x is equal to 5.001
x is equal to 5.001
46. Which value for x would make the following condition true: (x >= 5) And (x <= 6)
x is equal to 7
x is equal to 5
x is equal to 5.001
None of the mentioned
47. Constructs in which an If block is contained inside another If block are called:
multi-If blocks
nested If blocks
sequential If blocks
none of the above
48. One may use an If block within a Select Case block.
True
False
all of the above
None of the mentioned
49. One may use a Select Case block within an If block.
True
False
all of the above
None of the mentioned
50. Select Case choices are determined by the value of an expression called a selector.
True
False
all of the above
None of the mentioned
Submit