Está en la página 1de 47

Visual Programming techniques

BCA
IV Sem 
Multiple choice questions
1. Visual Basic is a tool that allows you to develop application in…………
a. Real time
b. Graphical User Interface
c. Menu Driven
d. None Of These
2. IDE stands for…………..
a. Internet Development Environment
b. Integrated Dual Environment
c. Integrated Development Environment
d. Integrated Desktop Environment
3. Which windows displays a list of all forms and modules making up your application
a. Project window
b. Properties window
c. Form layout window
d. All of the above
4. Properties can be viewed in two ways
a. Alphabetic and Categorized
b. Alphabetic and Numeric
c. Numeric and Alphanumeric
d. None of these
5. Which of the following windows is the central to the development of Visual Basic
applications
a. Project window
b. Form window
c. Properties window
d. All of the above
6. Which of the following provides quick access to commonly used commands in the
programming environment
a. Toolbox
b. Object browser
c. Toolbar
d. None of these
7. In ……………… window we can write code
a. Immediate window
b. Locals window
c. Code editor window
d. None of these

8. ………… is used for finding out about objects, properties and methods.
a. Object browser
b. Property window
c. Form layout window
d. Code editor window
9. The form module has file extension….
a. .frb
b. .fra
c. .frm
d. .fru
10. A text box can hold as many as ……. Characters for a single line text.
a. 2052
b. 2048
c. 2058
d. 2047
11. A text box can hold as many as ……… characters for a multi-line text
a. 42000
b. 48000
c. 23000
d. 32000
12. ……….. control is used to provide an identifiable grouping for other controls
a. Frame
b. Label
c. List box
d. Command button
13. ………. Property is used to set the maximum length of a text, a textbox can hold.
a. Length
b. Multiline
c. Maxlength
d. None of these
14. …………. Control is used to display text, but user cannot change it directly.
a. Textbox
b. Labelbox
c. Listbox
d. Commandbutton
15. The default datatype for Visual Basic is ………………
a. Integer
b. Boolean
c. Variant
d. String

16. In Visual Basic, a variable name cannot be more than ……… characters
a. 450
b. 255
c. 355
d. 500
17. We can preserve the value of a local variable by making the variable……….
a. Private
b. Public
c. Static
d. Implicit
18. ……….. cannot be declared in a form or class module
a. Public constants
b. Private constants
c. Static constants
d. None of these
19. ………. Arrays can be resized at anytime
a. Dynamic
b. Fixed
c. Multidimensional
d. Control array
20. …………. Is a block of code that is executed in response to an event.
a. Function procedure
b. Sub procedure
c. property procedures
d. All of the above
21. …………. Function is used to return a copy of a string without leading spaces.
a. Ltrim
b. Rtrim
c. Trim
d. Chr
22. All the following statements are true about variable scope except
a. Module
b. Global
c. Static
d. Local
23. The variables that does not change the value during execution of program is……
a. Numeric
b. Constant
c. String
d. All of the above

24. What is the output of the following code


MyString=”Hello World”
LeftString=left(MyString,3)
a. Hel
b. Hello World
c. World
d. Wor
25. …….. is a control related event
a. Keydown
b. Load
c. Terminate
d. GotFocus
26. When the form is first referenced in any manner by program,the triggered event is….
a. Load
b. Initialize
c. Activate
d. None of these
27. ………….. returns or sets the number of characters selected.
a. Sellength
b. Selstart
c. Seltext
d. None of the above
28. ………….. combines the features of the text box and list box
a. Picture box
b. Check box
c. Combo box
d. Option button
29. ………. Property is an integer value corresponding to the position of the scroll box in
the scroll bar.
a. Value
b. Change
c. Visible
d. None of the above
30. By default, the textbox control can hold text as ……..
a. Multiple lines
b. Single line
c. Password character
d. None of these

31. What is the default range of horizontal scroll bar.


a. 0 to 32767
b. -32768 to 32767
c. -32768 to 0
d. None of these
32. A………. displays a list of items from which user can select one or more items.
a. Combo box
b. List box
c. Check box
d. Scroll bar
33. ……… is a method which moves the focus to the specified control or form
a. Setfocus
b. Gotfocus
c. Lostfocus
d. None of these
34. ……. Modules can be reused in many different applications.
a. Form modules
b. Class modules
c. Standard modules
d. None of these
35. Storage size of Byte datatype is………..
a. 1 byte
b. 2 byte
c. 4 byte
d. None of these
36. The default property for a text box control is…….
a. Text
b. Password char
c. Multiline
d. Visible
37. ………. Property is used to return or sets a value that determines whether the control can
respond to user-generated events.
a. Autosize
b. Enable
c. Visible
d. Value
38. ………. Is a collection of files
a. Class
b. Group
c. Project
d. Form
e.
39. ………. Shows the value of any variables within the scope of the current procedure.
a. Immediate window
b. Locals window
c. Watches window
d. None of these
40. ………. Shows the property type as well as a short description of the property
a. Object box
b. Description pane
c. Form layout window
d. Code editor
41. …………… contains shortcuts to frequently performed actions.
a. Context menu
b. Menu bar
c. Tool bar
d. Tool box
42. Visual Basic maintains a project file with the extension…..
a. .frm
b. .vbp
c. .vbs
d. .cls
43. ……. Are objects that are placed on form objects.
a. GUI
b. IDE
c. Controls
d. Project
44. ………… indicates whether a particular condition is on or off.
a. Combo box
b. List box
c. Check box
d. None of these
45. In GUI , ……….. is a means of selecting one of several options.
a. Option button
b. Scroll bar
c. List box
d. Combo box
46. …………. Is a group of controls that share the same name and type.
a. Fixed array
b. Control array
c. Dynamic array
d. Multi dimensional array
47. ………….. do not return a value
a. Sub procedure
b. Function procedure
c. Property procedures
d. None of these
48. ……….. returns numeric code of a character.
a. Chr
b. Asc
c. Format
d. Space
49. …………. Allows us to control the flow of our program’s execution based on certain
condition.
a. Looping
b. Array
c. Property
d. Control structure
50. ……. Property designates the text appearing in the form’s title bar.
a. Text
b. Name
c. Caption
d. None of thses
51. The method, which loads the form into memory and displays it on screen
a. Load
b. Show
c. Display
d. All of these
52. ………… method is used to delete items from a list box.
a. Remove
b. Clear
c. Remove item
d. Delete
53. RTF stands for……..
a. Rich Text Format
b. Rich Title Format
c. Row Text Format
d. Rich Text Function
54. To load graphics on a control at runtime, we have to use the function………..
a. LoadImage
b. LoadPicture
c. LoadGraphics
d. None of these
55. The window in which the individual documents are displayed is called….. window.
a. Main
b. Child
c. Parent
d. All of the above
56. Which of the following keywords is used to keep track of active window.
a. Active
b. Current
c. Me
d. All of the above
57. ………… statement enables us to trap runtime error.
a. On Error
b. On runtime Error
c. Error
d. None of these
58. Which window shows information that results from debugging statements in our code
a. Watch window
b. Variables window
c. Locals window
d. Immediate window
59. ………… is the process of finding and removing errors
a. Check
b. Debugging
c. Quick watch
d. Break
60. A……… is a place in the code where the program temporarily stops
a. Break
b. Step over
c. Break point
d. Watch
61. MDI stands for…………
a. Multiple Document interpreter
b. Multiple Document Interface
c. Multi Document interval
d. None of these
62. The default datatype for VB is …………………..
a. Integer
b. Variant
c. String
d. Decimal
63. …………. Loop repeats a group of statements for each item in a collection of objects or
for each element of an array.
a. For loop
b. Do Until loop
c. For each loop
d. Do while loop

64. ……….. is an action recognized by a form or the control.


a. Property
b. Event
c. Method
d. Procedure
65. ……….. is one of the main building blocks in a VB application.
a. Form
b. Event
c. Procedure
d. Method
66. ………. Allows you to position the forms in your application using a small graphical
representation of the screen.
a. Debugging window
b. Form designer window
c. Property window
d. Form layout window
67. ………… is an example for control
a. Form
b. Event
c. Method
d. Code editor
68. Frame Control acts as a ………..
a. Method
b. Container
c. Event
d. None of these
69. ………… property is used to check whether the object is active or deactive.
a. Visible
b. Enabled
c. Name
d. Dragmode
70. Mouse down event takes place when you,
a. Click the left mouse button
b. Press the mouse button
c. Mouse is moved over the control
d. All of the above
71. A Boolean datatype can store……….bytes.
a. 2 byte
b. 4 byte
c. 1 byte
d. 8 byte
72. An object datatype can stroe…….. bytes
a. 1 byte
b. 2 byte
c. 4 byte
d. 8 byte
73. In …………….. there is no need to declare a variable before using it.
a. Implicit declaration
b. Explicit declaration
c. Option Explicit
d. General Declarations
74. In……….scope, variables are available only to the module in which they are declared.
a. Private
b. Public
c. Module
d. Static
75. ………….. is the extension of a form module.
a. .fra
b. .frm
c. .vbf
d. .fru
76. ……….. is the extension of a class module
a. .cls
b. .cla
c. .clss
d. None of these
77. ……… is the extension of the standard module
a. .bas
b. .bsi
c. .std
d. .stn
78. ……….. is a meaningful name that takes the place of a number or string that does not
change.
a. Variable
b. Constant
c. Event
d. Datatype
79. ……….. is a set of sequentially indexed elements having the same type of data.
a. Loop
b. Array
c. Variables
d. Objects
80. ……….. is a built in function to return lower bound of an array
a. Lbound()
b. LRbound()
c. Lower()
d. Lowbound()
81. ……….. is a built in function to return the upper bound of an array
a. Upper()
b. ToUpper()
c. Ubound()
d. URbound()
82. ………… statement is used to define a property procedure that assigns the value of a
property.
a. Property Let
b. Property Get
c. Property Set
d. None of these
83. If variables are not implicitly or explicitly type, they are assigned the type by default….
a. Character
b. Integer
c. Variant
d. None of these
84. All the following statements are true about variable names except
a. The first character must be a letter
b. They may include letters,numbers, and underscore(_)
c. Can be any length
d. You cannot use a reserved word.
85. …………. Are used by VB to hold information needed by an application.
a. Variables
b. Datatypes
c. Objects
d. Dim
86. The ……. Allows direct exit from a forloop, Do loop,Sub procedure, or Function
procedure.
a. Exit
b. Exit for
c. Exit Do
d. Exit Sub
87. If oyu declare an arry in a module and you want every procedures to access it, then
declare it as………
a. Private
b. Public
c. Private or public
d. None of these

88. When the form is first referenced in any manner by program,the triggered event is …….
a. Load
b. Initialize
c. Activate
d. None of these
89. What properties are required to be specified for a menu item
a. Name
b. Caption
c. Both a and b
d. None of these
90. ………… present a list of choices to the user.
a. Combo box
b. Rich text box
c. List box
d. None of these
91. …………. Displays the current drive and allows the user to select a different drive by
using a drop down arrow.
a. DirListBox
b. DriveListBox
c. FileListBox
d. All of these
92. ………… displays current directory with any subdirectories and allows the user to
change directory.
a. FileListBox
b. DirListBox
c. DriveListBox
d. Al of these
93. ………. Displays a list of the files in the current directory or sudirectory.
a. DriveListBox
b. FileListBox
c. DirListBox
d. None Of these
94. The TypeOf statement is used to find out……..
a. Type of picture displayed
b. Type of object accessed in control collection
c. Type of button clicked
d. All of the above
95. To attach a scroll bar to the textbox , the property of textbox should be set to:
a. Multiline=True
b. Scrollbar=True
c. SingleLine=False
d. None of these

96. The event occurs when certain key of keyboard is pressed


a. keyType
b. keyPress
c. KeyEnter
d. None of these
97. A………. is used to display information entered at design time, by a user at runtime ,or
assigned within the code
a. LabelBox
b. TextBox
c. ListBox
d. ComboBox
98. ………. Method adds a row to an MSHFlexGrid.
a. Add
b. New
c. Additem
d. None of these
99. ………. Method is used to clear the contents of MSHFlexGrid control.
a. Clr
b. Remove
c. RemoveItem
d. Clear
100. ……..files contains bitmaps,strings, and other data that we can change
without having to reedit and recompile the program code.
a. Class file
b. Resource file
c. Forms
d. None of these
101. Extension of ActiveX controls ……….
a. .acx
b. acv
c. .ocx
d. .oxc
102. Extension of ActiveX designers………..
a. .dsr
b. .axd
c. .adx
d. None of thse
103. …………… is used to select a particular record.
a. Dataprovider
b. Database
c. VDM
d. File pointer
104. …………. Is a collection of code which translates application request into
physical operation on datastore.
a. Database
b. Data provider
c. Interface
d. None of these
105. …….. is a Microsoft product for windows platform
a. Jet database engine
b. ODBC
c. OLEDB
d. None of these
106. ………. Allows access to the client server databases on a network
a. OLEDB
b. Jet database engine
c. ODBC
d. None of thse
107. ………… can access data from relational and non relational databases.
a. OLEDB
b. Jet database engine
c. ODBC
d. None of thse
108. …………. Method of recordset object can be used to allocate memory for
a new blank record.
a. Addnew
b. Add
c. Edit
d. Update
109. ……… is a special tool available in VB to access databases directly.
a. VDM
b. DAO
c. ADO
d. None of these
110. ………. Is the top level object in DAO hierarchy.
a. DB Engine
b. Database
c. Data provider
d. None of these
111. …………. Defines and manages the current user account.
a. Workspace
b. Filepointer
c. Group
d. None of these
112. ……….. represents a user account with particular access permission in a
particular workspace.
a. User
b. Workspace
c. Database
d. None of these
113. ……….. object contains information about an error occurred during a DAO
operation
a. Error
b. ERR
c. Debugging
d. None of these
114. Through the properties and methods of……….. object, we can set
validation rules and return information about linked tables in DAO model.
a. Table def
b. Query def
c. User
d. None of these
115. ………… object in DAO model represents objects like saved forms,
modules, reports etc:
a. Fields
b. Container
c. Query def
d. None of these
116. UDA stands for ………..
a. Uniform Data Access
b. Universal Data Address
c. Universal Data Access
d. Uniform Data Address
117. ………. Connectivity is independent of any DBMS or operating system
a. OLEDB
b. ODBC
c. DAO
d. None of these
118. …………… method used to load or import a text file or .rtf file into a rich
text box.
a. Load
b. Load file
c. Import
d. None of these
119. …………. Control provides all standard dialog boxes into our VB form
a. Common dialog control
b. Rich text box
c. Input box
d. All of these
120. ………. Are called design time entities
a. Form
b. Class
c. Control
d. None of these
121. ………… are called runtime entities.
a. Class
b. Object
c. Form
d. Control
122. In a class, …………is used to pass value to the property.
a. Property Let procedure
b. Property Get procedure
c. Property Set procedure
d. None of these
123. In a class, …………is used to store data in a property and returns the
property.
a. Property Let procedure
b. Property Get procedure
c. Property Set procedure
d. None of these
124. In a class, …………is used to pass object itself as a function argument.
a. Property Let procedure
b. Property Get procedure
c. Property Set procedure
d. None of these
125. ……….. is an event of a class
a. Initialize
b. Click
c. Got focus
d. None of these
126. ………… event occurs when an object of a class is created
a. Initialize
b. Click
c. Got focus
d. None of these
127. ………. Event occurs when last reference to the class goes out of scope.
a. Initialize
b. Terminate
c. Got focus
d. None of these
128. …….. keyword is used to create an object for the class.
a. New
b. Create
c. Allocate
d. None of these
129. ……….. is a group of objects gathered together as a single object.
a. Collection
b. Form
c. Array
d. None of these
130. By using …….. keyword we can create a collection.
a. New
b. Create
c. Allocate
d. None of these
131. To find out the total number of items in a collection we can use ……..
property
a. Count
b. Find
c. Add
d. None of these
132. ………. Is an important property of a file list box
a. Pattern
b. File
c. Drive
d. None of thse
133. …………. Is the important event of a timer control
a. Timer
b. Click
c. Change
d. Got focus
134. ………….. property is used to return the index of a selected item in a
listbox
a. New index
b. List index
c. Index
d. Sel index
135. ……….. control returns Boolean value
a. List box
b. Option button
c. Combo box
d. Scroll bar

136. Which is true about the name and text property of a control?
a.) They are the same when the control is first created.
b.) The text property changes to match any changes in the name property.
c.) The name property changes to match any changes in the text property.
d.) They are never the same unless the programmer makes it that way.

137. Which statement about objects is true?


a. One object is used to create one class.
b. One class is used to create one object.
c. One object can create many classes.
d. One class can create many objects.
138. In event-driven programming an event is generated by:
a. The system.
b. User’s action.
c. The program itself.
d. All of the above.
139. Which two controls combined to form the ComboBox control?
a. ListBox and TextBox
b. ListBox and InputBox
c. ListBox and MsgBox
d. Label and TextBox
140. ………….. automates much of work involved in creating and deploying
the files needed for our program to run on another computer
a. Package and deployment wizard
b. File systems
c. DLL
d. None of these
141. …….. is a compressed file that is well suited to distribution on either disks
or the internet.
a. .CAB
b. .CBA
c. .PCB
d. None of these
142. ………….. allows you to define exactly what the startmenu group contains
and what icons are used.
a. Package and deployment wizard
b. File systems
c. DLL
d. None of these
143. Through ………. Controls we can access information in the databases.
a. Data bound control
b. Data control
c. Wizard
d. Report
144. ……… type of recordset creates a dynamic set of records that represents a
database table or the results of a query containing fields from one or more tables.
a. Table type
b. Dynaset
c. Snapshot
d. All of the above
145. ………. Type of recordset creates a set of records that represent a single
database table that we can use to add change or delete records.
a. Table type
b. Dynaset
c. Snapshot
d. All of the above
146. ……….. type of recordset creates a static copy of a set of records that we
can use to find data or generate reports.
a. Table type
b. Dynaset
c. Snapshot
d. All of the above
147. ……… is a pointer in to a set of records.
a. Cursor
b. File
c. BOF
d. EOF
148. ………. Is the capability to wrap all aspects of functionality and user
interface into a single entity?
a. Encapsulation
b. Data hiding
c. Abstraction
d. None of these
149. All the features and benefits of using objects are wrapped up what
Microsoft calls ………….
a. COM
b. CAM
c. CAP
d. None of thsese
150. COM stands for ………….
a. Component Object Model
b. Class Object Model
c. Common Object Model
d. None of these
151. The main objective of the COM philosophy is ……..
a. Reliability
b. Reusability
c. Abstraction
d. None of these
152. The important property of a scroll bar is …….
a. Value
b. Scroll
c. Change
d. None of these
153. ………… method is used to forcibly set the cpu focus to a particular
control.
a. Setfocus
b. Gotfocus
c. Lostfocus
d. All of tha above
154. …….. event occurs when the user presses a key from the keyboard.
a. Keydown
b. Keypress
c. Keyup
d. All of the above
155. The button parameter used to identify the left mouse button is ………..
a. 1
b. 2
c. 3
d. 4
156. The button parameter used to identify the right mouse button is ………..
a. 1
b. 2
c. 3
d. 4
157. ……………event occurs when the content of a control changes.
a. Load
b. Change
c. Got focus
d. None of these
158. The default event of a text box is ……..
a. Load
b. Change
c. Click
d. Gotfocus
159. …….. keyword is used to preserve the previously stored values of a
dynamic array.
a. Preserve
b. Redim
c. Dim
d. Static
160. ……….. procedures have return values
a. Function
b. General
c. Sub
d. Event
161. ……….. event occurs when a form loaded into the memory
a. Load
b. Initialize
c. Activate
d. All of the above
162. ……….. event occurs when the form is set to nothing.
a. Terminate
b. Initialize
c. Activate
d. All of the above
163. In VB, arguments are passed by default by ……..
a. Reference
b. Value
c. Object
d. None of these
164. VDM is available from ……….. menu
a. Project
b. Tools
c. AddIns
d. None of these
165. …………. Method is used to retrieve a particular record on the basis ofa
criteria
a. Move
b. Find
c. Add
d. None of these
166. When …… is true then the file pointer will be above the the first record
a. EOF
b. BOF
c. File
d. None of these
167. Which is not a valid Exit statement?
a. Exit Do
b. Exit For
c. Exit Sub
d. Exit Form
168. Which function should be used to validate that input is not a string before
performing arithmetic operations?
a. IsArithmetic
b. IsNotString
c. IsNumeric
d. IsString
169. What is the most number of states a CheckBox can have?
a. 0
b. 1
c. 2
d. 3
170. The scope of a variable refers to:
a. The length of the variable.
b. The name of the variable.
c. The accessibility of the variable.
d. The datatype of the variable.
171. In the statement, Dim Days(7) as String, what part of the array does the
number 7 refer to?
a. Array name
b. Datatype
c. Lowerbound
d. Upperbound
172. Which menu object property places a check mark in the display of the menu
text?
a. Check
b. Checked
c. CheckMark
d. CheckOn
173. Which symbol creates an access key in the text of a menu item?
a. @
b. &
c. $
d. %
174. Which is not a standard dialog box?
a. ColorDialog
b. FontDialog
c. OpenDialog
d. ZoomDialog
175. Where is a single element of data stored?
a. Field
b. Record
c. Table
d. Both a and b.
176. Where is a collection of related data elements stored?
a. Field
b. Record
c. Table
d. Both a and b.
177. Which statement about objects is true?
a. One object is used to create one class.
b. One class is used to create one object.
c. One object can create many classes.
d. One class can create many objects.
178. Which is not a property of the Common control class?
a. Show
b. BackColor
c. Font
d. ForeColor
179. In event-driven programming an event is generated by:
a. The system.
b. A user’s action.
c. The program itself.
d. All of the above
180. The important property of a timer control is …………
a. Interval
b. Name
c. Timer
d. Time
181. The only object that is not a collection and is not contained within another
container in the DAO is …………
a. Table def
b. DB Engine
c. Group
d. Workspace
182. ………….. control is used to represent the items in a hierarchical manner.
a. Tree view
b. Grid view
c. Progress bar
d. None of these
183. Inorder to add a new node into a tree view control we must use ………
method.
a. Add
b. Additem
c. Addnode
d. None of these
184. ……… represents the immediate parent node for the new node in a tree
view control.
a. Key
b. Relationship
c. Relative
d. Image
185. ………. Control specifies the progress of an operation based on some time
limits.
a. Status bar
b. Progress bar
c. Grid
d. None of these
186. ……… control specifies current status of the form.
a. Status bar
b. Progress bar
c. Grid
d. None of these
187. By using ……….. property of a progress bar, we can display the progress
of an operation.
a. Time
b. Interval
c. Value
d. Progress
188. ……….. control displays current directory with any sub directories and
allows the user to change directly.
a. Directory list box
b. Drive list box
c. File list box
d. All of the above
189. ………….. control is used to execute a set of programs automatically at
regular intervals without the interaction of user.
a. Scroll bar
b. Progress bar
c. Timer
d. File controls
190. ………. Can act as a container for other controls
a. Picture box
b. Image box
c. List box
d. Combo box
191. By using ……… property of Drive list box we can access the selected
drive.
a. Pattern
b. Path
c. Drive
d. File
192. …………. Event occurs while the scroll box is moved by dragging the
mouse.
a. Change
b. Scroll
c. Mouse move
d. None of these
193. To insert a picture into a picturebox we can use ………. Method.
a. Load
b. Load image
c. Load picture
d. None of these
194. ………….. is the property of a flexgrid to access the index of current row.
a. Index
b. New index
c. Row
d. Rowsel
195. ……………. Is used to display the data in a tabular format on the form
a. List
b. Table
c. Flexgrid
d. All of the above
196. One of the important method of a flexgrid control is ……..
a. AddItem
b. Add
c. Remove
d. All of the above
197. …………. Is the temporary buffer area which is used to store data
temporarily.
a. Rich text
b. Text
c. Clipboard
d. Cursor
198. ………..Method is used to retrieve the stored text from the clipboard.
a. Settext
b. Gettext
c. Input
d. Add
199. …………. Method is used to store the selected text into clipboard.
a. Settext
b. Gettext
c. Input
d. Add
200. The method which is used to clear a form control is……..
a. Clr
b. Clear
c. Cls
d. Null
1. Using a ________ variable does not enable us to create read-only
properties that are often required by a class.
A. public
B. private
C. protected
D. friend

2. A ___________ performs invisible tasks even if you write no code.


A. destructor
B. private method
C. constructor
D. function

3. The ___________________________________ does not describe


inherited member functions, inherited operators, and overridden virtual
member functions.
A. Class Library Reference
B. Library
C. Objects
D. Classes

4. The ______________________ group classes according to their common


services.
A. objects
B. inheritance
C. Namespaces
D. programs

5. Whenever an application is created, a ______ is added.


A. Form
B. Class
C. Property
D. Object
6. _________ are interactive objects that you place in dialog boxes or other
windows to carry out user actions.
A. Controls
B. Objects
C. Classes
D. Forms

7. The _______________ class provides static methods to start, stop, or


filter Windows messages in an application.
A. Forms
B. Windows
C. Application
D. Control

8. The ___________is a systematic class framework used for the


development of system tools and utilities.
A. .Net Framework Class Library (FCL)
B. .Net tools
C. Visual Basic 2005
D. Visual Basic 6

9. The ______________ method converts the value of this instance to a


double representing the OLE automation date.
A. From OA Date
B.TO OA Date
C. Today
D. Now

10. The _________________ enable us to pass data between a program


and a class.
A. Functions
B. Properties
C. Procedures
D. Variables
1. Which of the following Loop structure does not supported by VB.Net?
A. Do ................ Loop
B) For ................... Next
C) Do ................ While
D) For Each ............ While

2. The _____ model does not offer a model for source code reuse.
A. COM+
B. DCOM
C. COM
D. .Net

3. _____ allow custom items of information about a program element to be


stored with an assembly's metadata.
A. Properties
B. Attributes
C. Methods
D. Classes

4. The corresponding .Net FCL type for Short is ___________.


A. System.Int32
B. System.Int64
C. System.Int16
D. System.Object

5. The member "clear" of the Array class that sets a range of array elements
to zero, false or null reference is a _____________ method.
A. Shared
B. Method
C. Class
D. Object
6. The ___________ method converts an OLE automation date value to a
DateTime Instance.
A. Today
B. TimeOfDay
C. Now
D. FromOADate

7. The function procedures are ___________ by default.


A. public
B. private
C. protected
D. inherited

8. Every optional argument in the procedure definition must specify a


_________ value which must be a constant expression.
A. constant
B. default
C. integer
D. character

9. Type casting in VB.Net is implemented by means of ____________


statement.
A. Type()
B. TypeDef()
C. Btype()
D. Ctype()

10. State whether the statement true or false.


i) Function procedures are public by default.
ii) Function procedure return values whereas sub procedures cannot return a
value to the calling procedure.
A. True, True
B. True, False
C) False, True
D) False, False
Sr. no

Que1Which language is not a true object-oriented programming language?

(a.) VB.NET
(b.) VB 6
(c.) C++
(d.) JAVA

2A GUI

(a.) uses buttons, menus, and icons.


(b.) should be easy for a user to manipulate.
(c.) stands for Graphic Use Interaction.
(d.) Both a and b.

3Visual Studio .NET provides which feature:

(a.) debugging
(b.) application deployment
(c.) syntax checking
(d.) All of the above

4What does IDE stand for?

(a.) Integrated Development Environment


(b.) Integrated Design Environment
(c.) Interior Development Environment
(d.) Interior Design Environment

5Which type of project can a developer choose in the New Project dialog box?

(a.) Visual Basic Projects


(b.) Visual C# Projects
(c.) Visual C++ Projects
(d.) All of the above.

6Which is not a main component of the Visual Studio IDE?

(a.) Solution Explorer


(b.) Tool box
(c.) start menu
(d.) designer window

7Which does the solution explorer not display?


(a.) Form Properties
(b.) Reference Folder
(c.) Form File
(d.) Assemble File

8Which is true about the name and text property of a control?

(a.) They are the same when the control is first created.
(b.) The text property changes to match any changes in the name property.
(c.) The name property changes to match any changes in the text property.
(d.) They are never the same unless the programmer makes it that way.

9For which task does the IDE provide multiple ways to accomplish the task?

(a.) Putting a control on the form


(b.) Running the program
(c.) Activating the property window for a control
(d.) All of the above.

10Which are the standard prefixes for the Button and Combo box controls respectively?

(a.) btn and chb


(b.) btn and cbo
(c.) bto and chb
(d.) bto and cbo

11Which are the standard prefixes for the text box and label controls respectively?

(a.) tex and lbl


(b.) tex and lab
(c.) txb and lbl
(d.) txb and lab

12Which task is accomplished in the Code editor?

(a.) Adding forms to the project


(b.) Adding controls to the form
(c.) Adding event procedures to the form
(d.) All of the above.

13Which is not a feature of a GUI that makes learning a program easy for users?

(a.) Online help


(b.) WYSIWYG formatting
(c.) Dialog boxes
(d.) Detailed key strokes and commands
14An object is composed of:(a.) properties.
(b.) methods.
(c.) events.
(d.) All of the above.15Which statement about objects is true?

(a.) One object is used to create one class.


(b.) One class is used to create one object.
(c.) One object can create many classes.
(d.) One class can create many objects.

16Which is not true about forms and controls in Visual Basic?

(a.) They are pre-built.


(b.) They are graphical objects.
(c.) New versions of the classes must be created with each project.
(d.) Buttons can be created with the drag and drop method.

17Which is an example of Visual Basic Objects?

(a.) Control objects


(b.) ASP.NET
(c.) ADO.NET
(d.) All of the above.

18The .Net class library:

(a.) contains over 25,000 classes.


(b.) uses namespaces to manage all of the classes.
(c.) has the System.Form namespace for classes used in Windows-based application.
(d.) Both a and b.

19Which is not a property of the Common control class?

(a.) show
(b.) BackColor
(c.) Font
(d.) ForeColor

20Which property determines whether a control is displayed to the user?

(a.) Hide
(b.) Show
(c.) Visible
(d.) Enabled

21The Button control can be activated:


(a.) programmatically through the click event.
(b.) by clicking the button with the mouse.
(c.) with the form’s DefaultButton property.
(d.) Both a and b.

22The CancelButton property belongs to which object?

(a.) Button
(b.) Form
(c.) Label
(d.) TextBox

23A click event procedure stud for the label control can be created by:

(a.) selecting the object and event from the code editor window’s drop-down boxes.
(b.) typing the code in the code editor window.
(c.) by double clicking the control.
(d.) All of the above.

24In event-driven programming an event is generated by:

(a.) the system.


(b.) a user’s action.
(c.) the program itself.
(d.) All of the above.

25Which is not a common control event?

(a.) Click
(b.) SingleClick
(c.) DoubleClick
(d.) MouseMove

26The Tick event is found only in which object?

(a.) Form
(b.) Button
(c.) TextBox
(d.) Timer

27The Activated event is found only in which object?

(a.) Form
(b.) Button
(c.) TextBox
(d.) Label

28The Rnd statement will generate a(n):

(a.) decimal value between 0.01 and 1.00.


(b.) integer value between 0.01 and 1.00.
(c.) decimal value between 0.0 and 1.0.
(d.) decimal value between 0.0 and up to 1.0, but not including 1.0.

29The analysis phase of software development involves:

(a.) collecting the requirements about what the program will accomplish.
(b.) creating a detailed plan on how the program will accomplish the requirements.
(c.) writing the software with a program such as VB.NET.
(d.) Both a and b.

30Which phase of project development typically costs the most?

(a.) Analysis
(b.) Design
(c.) Implementation
(d.) Maintenance

31Which is not an integer data type?

(a.) Single
(b.) Byte
(c.) Short
(d.) Integer

32Which is a numeric data type?

(a.) Floating Point


(b.) Integer
(c.) Boolean
(d.) Both a and b

33Which sequence of char data types is listed from lowest to highest?

(a.) a, A, z, Z
(b.) a, z, A, Z
(c.) A, a, Z, z
(d.) A, Z, a, z
34The Date data type does not hold which type of information.

(a.) Seconds
(b.) Hours
(c.) Days
(d.) Quarters

35The Boolean data type:

(a.) is unsigned.
(b.) has two states.
(c.) is displayed by the program as yes or no.
(d.) Both a and b.

36Which is a valid statement for declaring a variable?

(a.) Const Form As Integer


(b.) Const myForm As Integer
(c.) Dim Form As Integer
(d.) Dim myForm As Integer

37VB.Net identifiers:

(a.) are case sensitive.


(b.) can begin with an underscore.
(c.) can begin with a number.
(d.) All of the above.

38The name of a constant:

(a.) does not have to begin with a letter but must be all upper case.
(b.) can begin with an underscore.
(c.) must begin with a letter but can be upper or lower case.
(d.) does not have to begin with a letter and be either upper or lower case.

39The proper operator precedence, from first to last, is:

(a.) logical, comparison, and arithmetic.


(b.) arithmetic, comparison, and logical.
(c.) arithmetic, logical, and comparison.
(d.) comparison, arithmetic, and logical.

40With A = False and B = True, which statement evaluates as True?


(a.) A AND A
(b.) A AND B
(c.) B AND A
(d.) B AND B

41With A = False and B = True, which statement evaluates as False?

(a.) A OR A
(b.) A OR B
(c.) B OR A
(d.) B OR B

42Which operator is evaluated first?

(a.) NOT
(b.) AND
(c.) XOR
(d.) OR

43The left side of an assignment statement will hold:

(a.) a variable.
(b.) an object property.
(c.) an expression.
(d.) Both a and b.
Visual Basic Multiple Choice Questions and Answers
True 1. The Visual Basic Code Editor will automatically detect certain types of errors as you are entering
code.
A. True
B. False

True 2. Keywords are also referred to as reserved words.


A. True
B. False

True 3. 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.
A. True
B. False

an event procedure 4. Visual Basic responds to events using which of the following?
A. a code procedure
B. an event procedure
C. a form procedure
D. a property

an event 5. When the user clicks a button, _________ is triggered.


A. an event
B. a method
C. a setting
D. a property

tab index 6. What property of controls tells the order they receive the focus when the tab key is pressed
during run time?
A. Focus order
B. Focus number
C. Tab index
D. Control order

A rectangular with small squares around your control 7. 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. A rectangle with 4 arrows, one in each corner, around your control.
B. A 3-D outline around your control.
C. A rectangle with small squares around your control.
D. None of the above.

To change how objects look and feel 8. The Properties window plays an important role in the
development of Visual Basic applications. It is mainly used
A.to change how objects look and feel.
B. when opening programs stored on a hard drive.
C. to allow the developer to graphically design program components.
D. to set program related options like Program Name, Program Location, etc.

C and B 9. 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?
A. Wapplication followed by a number.
B. Application followed by a number.
C. WindowsApplication.
D. WindowsApplication followed by a number.
Name 10. Which of the properties in a control’s list of properties is used to give the control a meaningful
name?
A. Text
B. ContextMenu
C. ControlName
D. Name

A description of an algrorithm similar to a computer language 11. Pseudocode is


A. data that have been encoded for security.
B. the incorrect results of a computer program.
C. a program that doesn’t work.
D. the obscure language computer personnel use when speaking.
E. a description of an algorithm similar to a computer language.

A logical sequence of steps that solve a problem 12. An algorithm is defined as:
A. a mathematical formula that solves a problem.
B. a tempo for classical music played in a coda.
C. a logical sequence of steps that solve a problem.
D. a tool that designs computer programs and draws the user interface.

True 13. A variable declared inside an event procedure is said to have local scope
A. True
B. False

True 14. A variable declared outside of an event procedure is said to have class-level scope.
A. True
B. False

True 15. Option Explicit requires you to declare every variable before its use.
A. True
B. False

True 16. The value returned by InputBox is a string.


A. True
B. False

17. What is the correct statement when declaring and assigning the value of 100 to an Integer variable
called numPeople
A. Dim numPeople =
B. Dim numPeople = Int(100)
C. numPeople = 100
D. Dim numPeople As Integer = 100
Ans: D
18. Which of the following arithmetic operations has the highest level of precedence?
A. + –
B. * /
C. ^ exponentiation
D. ( )
Ans: C
19. What value will be assigned to the numeric variable x when the following statement is executed? x =
2+3*4
A. 20
B. 14
C. 92
D. 234
Ans: B
20. Which of the following is a valid name for a variable?
A. Two_One
B. 2One
C. Two One
D. Two.One
Ans: A
21. Keywords in Visual Basic are words that
A. should be used when naming variables.
B. are used to name controls, such as TextBox1, Command2, etc.
C. have special meaning and should not be used when naming variables.
D. are used as prefixes for control names (such as txt, btn, lbl, and lst).
Ans: C
22. To continue a long statement on another line, use:
A. an underscore character.
B. an ampersand character.
C. Ctrl + Enter.
D. a space followed by an underscore character.
Ans: A
23. What is the proper syntax when using a message dialog box?
A. MessageBox.Show(“Hi there”, “Hi”)
B. MessageBox.Show(Hi there, Hi)
C. MessageBox.Show “Hi There”, “Hi”
D. MessageBox.Show Hi There, Hi
Ans: A
24. What will be the output of the following statement? txtBox.Text = FormatCurrency(1234.567)
A. $1234.567
B. 1,234.57
C. $1234.57
D. $1,234.57
Ans: D
25. The following lines of code are correct. If age >= 13 And < 20 Then txtOutput.Text = “You are a
teenager.” End If
A. True
B. False
Ans: B
26. 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
A. True
B. False
Ans: A
27. Asc(“A”) is 65. What is Asc(“C”)?
A. 66
B. 67
C. 68
D. “C”
Ans: B
28. Asc(“A”) is 65. What is displayed by txtBox.Text = Chr(65) & “BC”?
A. ABC
B. A BC
C. 656667
D. Not enough information is available.
Ans: A
29. Which of the following expressions has as its value the words “Hello World? surrounded by quotation
marks?
A. “Hello World”
B. Chr(34) & “Hello World”
C. Chr(34) & Hello World & Chr(34)
D. Chr(34) & “Hello World” & Chr(34)
Ans: A
30. Which of the following is true?
A. “Cat” = “cat”
B. “Cat” < “cat”
C. “Cat” > “cat”
D. Relational operators are only valid for numeric values.
Ans: B
31. Which of the following is a valid Visual Basic conditional statement?
A. 2 < n < 5
B. 2 < n Or < 5
C. 2 < n Or 5
D. (2 < n) Or (n < 5)
Ans: D
32. The three main logical operators are ________, _________, and ________.
A. And, Or, Not
B. And, Not, If
C. Or, Not, If
D. False, And, True
Ans: A
33. Which value for x would make the following condition true: x >= 5
A. x is equal to 7
B. x is equal to 5
C. x is equal to 5.001
D. all of the above
Ans: D
34. Which value for x would make the following condition true: Not (x >= 5)
A. x is equal to 7
B. x is equal to 4
C. x is equal to 5.001
D. x is equal to 5.001
Ans: B
35. Which value for x would make the following condition true: (x >= 5) And (x <= 6)
A. x is equal to 7
B. x is equal to 5
C. x is equal to 5.001
Ans: B,C
36. Constructs in which an If block is contained inside another If block are called:
A. multi-If blocks
B. nested If blocks
C. sequential If blocks
D. none of the above
Ans: B
37. One may use an If block within a Select Case block.
A. True
B. False
Ans: A
38. One may use a Select Case block within an If block.
A. True
B. False
Ans: A
39. Select Case choices are determined by the value of an expression called a selector.
A. True
B. False
Ans: A
40. Items in the value list must evaluate to a literal of the same type as the selector
A. True
B. False
Ans: A
41. A single Case statement can contain multiple values.
A. True
B. False
Ans: A
42. You can specify a range of values in a Case clause by using the To keyword.
A. True
B. False
Ans: A
43. A variable declared inside a Select Case block cannot be referred to by code outside of the block.
A. True
B. False
Ans: A
44. Suppose that the selector in a Select Case block is the string variable myVar. Which of the following
is NOT a valid Case clause?
A. Case “Adams”
B. Case “739”
C. Case (myVar.Substring(0, 1)
D. Case myVar.Length
Ans: D
45. Different items appearing in the same value list of a Select Case block must be separated by a
____________.
A. semi colon
B. comma
C. colon
D. pair of quotation marks
Ans: B
46. Which Case clause will be true whenever the value of the selector in a Select Case block is between 1
and 5 or is 8?
A. Case 1 To 8
B. Case 1 To 5, 8
C. Case 1 To 8, 5
D. Case 1 To 5; 8
Ans: B
47. Which Case clause will be true whenever the value of the selector in a Select Case block is greater
than or equal to 7?
A. Case Is >7
B. Case Is = 8
C. Case Is >= 7
D. Case Is <= 8
Ans: C
48. What type of items are valid for use in the value list of a Case clause?
A. literals
B. variables
C. expressions
D. all of the above
Ans: D
49. What happens to a variable declared locally inside a Sub procedure after the procedure terminates?
A. It maintains its value even after the End Sub statement executes.
B. It ceases to exist after the End Sub statement executes.
C.It loses its value temporarily after the End Sub statement executes, but regains that value upon re-entry
to the Sub procedure.
D. It is reset to its default value.
Ans: B
50. Suppose a variable is passed by reference to a parameter of a Sub procedure, and the parameter has its
value changed inside the Sub procedure. What will the value of the variable be after the Sub procedure
has executed?
A. It will have the newly modified value from inside the Sub procedure.
B. Its value can?t be determined without more information.
C. It will retain the value it had before the call to the Sub procedure
D. None of the above.
Ans: A
51. Suppose a variable is passed by value to a parameter of a Sub procedure, and the parameter has its
value changed inside the Sub procedure. What will the value of the variable be after the Sub procedure
has executed?
A. It will have the newly modified value from inside the Sub procedure.
B. Its value can?t be determined without more information
C. It will retain the value it had before the call to the Sub procedure
D. None of the above.
Ans: C
52. The declaration statement for a class-level variable should be placed __________.
A. inside an event procedure
B. inside a general procedure
C. anywhere in the program region, except inside a procedure
D. above the statement Public Class frmName
Ans: C
53. Variables declared inside a procedure are said to have ________________.
A. local scope
B. procedure-level scope
C. class-level scope
D. none of the above
Ans: A
54. What will be the output of the following program when the button is clicked?
Private Sub btnDisplay_Click(…) Handles btnDisplay.Click
Dim number As Double = 3
DoubleAndSquare(number)
txtBox.Text = CStr(number)
End Sub
Sub DoubleAndSquare(ByRef myVar As Double)
myVar = myVar + myVar
myVar = myVar * myVar
A. 3
B. 36
C. 6
D. 0
Ans: B
55. Suppose the variable myName is declared in a Dim statement in two different Sub procedures. Which
statement is true?
A. The program will malfunction when it is executed.
B. When the value of myName is changed in one Sub procedure, it will also be changed in the other Sub
procedure.
C. Visual Basic’s smart editor will alert you that this is an error before the program is executed.
D. The two variables will be local to their respective Sub procedures.
Ans: D
56. Which of the following statements is guaranteed to pass the variable numVar by value to the Sub
procedure Tally?
A. Tally(numVar)
B. Tally(ByVal numVar)
C. Tally((numVar))
D. Tally(ByVal numVar As Double)
Ans: D
57. The ______________ of a Sub procedure are vehicles for passing numbers and strings to the Sub
procedure.
A. Call Statements
B. arguments
C. parameters
D. variables declared inside
Ans: C
58. Which of the following is NOT a reason for using procedures?
A. They break a complex problem down into smaller pieces.
B. They make a program run faster.
C. They can be reused easily.
D. They make it possible for a team of people to work together on a single program.
Ans: B
59. Which one of the following is true about arguments and parameters?
A. Arguments appear in Call statements; parameters appear in Sub statements.
B. Parameters appear in Call statements; arguments appear in Sub statements.
C. They are synonymous terms.
D. They are completely unrelated in a program.
Ans: A
60.Each individual variable in the list student(0), student(1), student(2) is known as a(n)
A. subscript
B. dimension
C. element
D. type
Ans: C
62. The statement Const TAX_RATE As Doubleface=Calibri size=2> is not valid.
A. True
B. False
Ans: A
63. Function names should be suggestive of the role performed. The names also must conform to the rules
for naming variables.
A. True
B. False
Ans: A
64. The input to a user-defined function can consist of one or more values.
A. True
B. False
Ans: A
65. Both the input and output of a Function procedure can consist of several values.
A. True
B. False
Ans: B
66. Suppose you want to write a procedure that takes three numbers, num1, num2, and num3; and returns
their sum, product, and average. It is best to use a Function procedure for this task.
A. True
B. False
Ans: B
67. Although a function can return a value, it cannot directly display information in a text box.
A. True
B. False
Ans: B
68. Function procedures can invoke other Function procedures.
A. True
B. False
Ans: A
69. A Function may return up to two values.
A. True
B. False
Ans: B
70. The input to a user-defined function can consist of:
A. a single value
B. one or more values
C. no values
D. All of the above
Ans: D
71. Variables appearing in the header of a Function procedure are called ____________.
A. values of the function
B. parameters
C. coordinates
D. arguments
Ans: B
72. The arguments appearing in a Call statement must match the parameters in the appropriate Sub or
Function header in all but one of the following ways. Which one?
A. Number of arguments
B. Names of arguments
C. Data type of arguments
D. Order of arguments
Ans: B
73. What will be the output of the following program when the button is clicked?
Private Sub btnDisplay_Click(…) Handles btnDisplay.Click
Dim word, result As String
word = “Benjamin”
result = Rotate(word)
result = Rotate(result & word)
result = Rotate(result)
txtBox.Text = result
End Sub
Function Rotate(ByVal var As String) As String
Dim varlength As Integer
varlength = var.Length
Return var.Substring(1) & var.Substring(0, 1)
End Function
A. jaminBBenjaminen
B. BenjaminBenjamin
C. njaminBe
D. None of the above
Ans: A
74. What is displayed when the button is clicked?
Private Sub btnDisplay_Click(…) Handles btnDisplay.Click
Dim a, b as String
Dim x as Integer
a = “How now brown cow.”
b = “brown”
x = FindIt(a, b)
txtBox.Text = CStr(x)
End Sub
Function FindIt(ByVal z1 as String, ByVal z2 as String) As Integer
Dim x as Integer
x = z1.IndexOf(z2)
End Function
“How now”
A. 8
B. 0
C. An error
D. None of the above
Ans: D
75. A Do While loop checks the While condition before executing the statements in the loop.
A. True
B. False
Ans: A
76. A Do?Loop Until block is always executed at least once
A. True
B. False
Ans: A
77. A counter variable is normally incremented or decremented by 1.
A. True
B. False
Ans: A

78. The value of the control variable should not be altered within the body of a For?Next loop.
A. True
B. False
Ans: B
79. The body of a For…Next loop in Visual Basic will always be executed once no matter what the initial
and terminating values are.
A. True
B. False
Ans: B
80. The body of a For…Next loop in Visual Basic will always be executed once no matter what the initial
and terminating values are. duplicate question?
A. True
B. False
Ans: B

También podría gustarte