EXAMINATION FOR THE DEGREE OF
BSC IT/BBIT
UNIT CODE: BIT 210 UNIT NAME: APPLICATION PROGRAMMING
DATE: DECEMBER 2018 TIME: 2 HOURS
INSTRUCTIONS:
ANSWER QUESTION ONE [COMPULSORY] AND ANY OTHER TWO QUESTIONS
SECTION ONE
Question One
a) Describe the following components found in the Common Language Runtime (CLR) of a .(DOT) NET
Framework
i) Common Language Specification (CLS)
ii) Common Type System (CTS)
[4 marks]
b) Explain the significance of the following windows in Visual Basic IDE:
i) Form Designer
ii) Solution Explorer Window
iii) ToolBox Window
[6 marks]
c) What will be displayed when the following set of lines are executed. Each set of statements are
executed independent of one another
i)
Dim Boy as String = “Jack”
Dim Girl as String = “Jill”
NamesTextBox.Text = Boy & “ and “ & Girl & “ went up the hill”
ii)
Dim x As Double = 3, y as Double = 1
Dim z As Double
z = x + (y * x)
x = y
z = x + z
ValuesListBox.Items.Add(x + y + z)
[4 marks]
d) Rewrite the following code segment using the With and End With statements
RegistrationTextBox.BackColor = Color.White
NamesTextBox.BackColor = Color.White
RegistrationTextBox.ForeColor = Color.Black
NamesTextBox. ForeColor = Color.Black
[2 marks]
e) Convert the following mathematical notation into the equivalent Visual Basic expressions
f) You are required to write a Visual Basic program that will enable user to calculate the sum, product,
division and difference of two numbers entered through textboxes after a click of the respective buttons.
The results should be displayed by use text box control. The program should enable the user to clear the
textboxes ready for the next input.
i) Sketch your graphical user interface assigning appropriate properties to your form and other
controls
[2 marks]
ii) Write the code for your program and declare you variables appropriately
[10 marks]
SECTION TWO
Question Two
a) Briefly explain the following categories of user interfaces
i) Command-line interfaces
ii) Form-based visual interfaces
[4 marks]
b) Describe the following principles of control design
i) Function grouping
ii) Consistent sizing
[2 marks]
c) Explain the significance of using the following controls in your Visual Basic applications
i) CheckBox controls
ii) MaskedTextBox Controls
[4 marks]
d) Distinguish between a Do While…Loop and Do Until…Loop
[2 marks]
e) Using nested loops, write a Visual Basic program to generate and display the following multiplication
table in an output window (debug window) after a click of a button control. Sketch your GUI
[8 marks]
Question Three
a) Differentiate between a combo box and list box.
[2 marks]
b) A GUI is required to allow the user calculate the area of a circle in Visual Basic. The user is to type
the value of the radius in a textbox. When the user clicks a command button, the volume is displayed
in a textbox control. Use the formula shown below for area calculation:
i) Sketch a suitable GUI for the above and write down the properties that you would set for all the
controls in the above GUI and their values.
[3 marks]
ii) Write code in a button to calculate and display the area in any appropriate control
[9
marks]]
c) Explain briefly the following data types as used in visual basic
i) Date
3
ii) Short
iii) Decimal
[6 marks]
Question Four
a) Describe the following types of ComboBox controls
i) DropDown ComboBox
ii) Simple ComboBox
iii) DropDownList ComboBox
[6 marks]
b) Using examples explain the following Array class members
i). GetLength
ii). Sort
iii). Average
[6 marks]
c) Describe the following terms as used with VB.net
8 marks
i) Object
ii) Class
iii) Methods
iv) Instance Variables
[8 marks]
Question Five
a) Describe the ActiveX Data Objects (ADO.NET)
[2 marks]
b) Using a diagram, to describe how the database is connected to the we/windows form.
[6 marks]
c) Explain the following properties of the Connection object
i) Table adapter
ii) DataSource
iii) Provider
[6 marks]
d) Write VB.net code that can be used to delete the current record from a table named tblEmployes.
[6 marks]