Event driven programming mock exam questions
1. Which control displays text that cannot be edited by the user?
a. Textbox
b. Label
c. Button
d. Groupbox
2. Which control allows users to choose between two mutually exclusive
options?
a. Listbox
b. Combobox
c. Radiobutton
d. Checkbox
3. What is the first step to connect to a database using ADO.NET?
a. Create a DataTable object.
b. Write SQL queries directly in code.
c. Define a connection string
d. Use the Open() method on a DataSet object
4. What is a DataReader object used for?
a. Update data in the database
b. Read data from a database in a forward-only manner.
c. Manage connections to the database
d. Represent a table in memory with editing capabilities
5. Which control acts like a container, letting a developer specify groups
of options for RadioButtons?
a. ButtonGroup
b. HashGroup
c. OptionGroup
d. GroupBox
6. Which control is best suited for displaying database records?
a. ListBox
b. DataGridView
c. ComboBox
d. TextBox
7. In a login form, the "Login" button should only be active after both
username and password fields are filled.
What property of the button should be modified?
a. Visible
b. Text
c. TabIndex
d. Enabled
8. What is Rapid Application Development (RAD)?
a. A development methodology that emphasizes events over functions
b. An approach to software development that focuses on quick
iterations and prototyping
c. A programming paradigm that uses a drag-and-drop interface
d. None of the above
9. Which of the following is a key characteristic of the Waterfall model?
a. Iterative and incremental
b. Phases can overlap
c. Each phase must be completed before the next begins
d. Focuses on risk analysis
10. The Spiral model is especially suitable for:
a. Small, simple projects
b. Projects with low risk
c. Projects with high risk and complexity
d. Projects requiring fast delivery
11. You are part of a team developing software for a critical space
mission. The requirements are extremely well-defined, and any
changes during the development process could have catastrophic
consequences. Strict documentation and sequential execution are
paramount.
Which software development model would be most appropriate for this
project, given the emphasis on well-defined requirements, sequential
execution, and low tolerance for changes?
a. Agile Model
b. Spiral Model
c. Prototype Model
d. Waterfall Model
12. Which of the following when turned on do not allow to use any
variable without proper declaration?
a. Option explicit
b. Option strict
c. Option implicit
d. Option all
13. Which of the following exception class is primarily used for
exceptions defined with the application by the programmer?
a. System.SystemException
b. System.StandardException
c. System.ApplicationException
d. System.DeveloperException
14. In structured exception handling, which block contains code that
will always execute, regardless of whether an exception occurs?
a. Try
b. Catch
c. End try
d. Finally
15. Which one of the following data provider object Serves as an
intermediary between
your DataSet and data source, providing the mapping instructions
between the two
a. Dataadapter
b. Datareader
c. Connection
d. Command
16. Which of the following represents the life cycle of software
development
a. Planning—define requirements—design ---test---development---
deployment---maintenance
b. Define requirements—planning—design—development—test—
deployment—maintenance
c. Planning—define requirements—design—development—test—
deployment—maintenance
d. Planning—define requirements—development—design—test—
deployment—maintenance
17. What is the difference between ByVal and ByRef in VB.NET?
a. ByVal passes a reference to the variable, while ByRef passes a copy
of the variable
b. ByVal passes a copy of the variable, while ByRef passes a copy of
the reference to the variable
c. ByRef is not a valid parameter passing method in VB.NET
d. There is no difference between ByVal and ByRef in VB.NET
18. What happens when you use the break statement inside a
nested loop?
a. It restart the inner loop from the beginning
b. It skips the current iteration of the outer loop
c. It breaks out of the current inner loop but continues the outer loop
d. It breaks out of both the inner and outer loop.
19. How many times will the MessageBox.Show method in the
following code be processed?
intCount = 0;
Do
MessageBox.Show("Hello")
intCount += 1
Loop While intCount > 3
a. 0
b. 1
c. 3
d. 4
20. What is the return type of the following function?
Function Hypotenuse(A As Integer, B As Integer) As Double
Return Math.Sqrt(A ^ 2 + B ^ 2)
End Function
a. Integer
b. Double
c. String
d. object