BIT 2105  APPLICATION PROGRAMMING  KCA Past Paper

UNIVERSITY EXAMINATIONS: 2014/2015
ORDINARY EXAMINATION FOR THE BACHELOR OF SCIENCE
IN INFORMATION TECHNOLOGY
BIT 2105 APPLICATION PROGRAMMING
DATE: APRIL, 2015 TIME: 2 HOURS
INSTRUCTIONS: Answer Question ONE and any other TWO

QUESTION ONE (20 MARKS)
a) Menus often have hot keys. Describe how you can add a hot key to a menu in
VB.net using an example. [4 Marks]
b) The VB code segment shown below is incorrect. Identify the error and write the
correct code. [4 marks]
Illegal Syntax
If HoursDecimal <= 40D Then
RegularPayCheckBox.Checked = True
Else if RegularPayCheckBox.Checked = False
End If
c)
i) Draw a flow chart for the if statement shown below [ 8 marks]
If HoursDecimal <= 40D Then
‘Pay only regular time
GrossPayDecimal = Decimal.Round(HoursDecimal *
PayRateDecimal, 2)
Else
‘Pay regular time + overtime
GrossPayDecimal = Decimal.Round((40D *
PayRateDecimal) + _
((HoursDecimal – 40D) * PayRateDecimal *
1.5D), 2)
End If
ii) VB has two different types of constants. Describe them using examples to illustrate
[6
marks]
c) Describe how local variables and module level variables are declared in VB

[4marks]
d) Differentiate between list box, checked Listbox and combo box as used in VB.NET
[4marks]
QUESTION TWO (20 MARKS)
a) A firm needs to be able to quickly compute the value of any item in inventory.
Build a form that will enable inputting values into three textboxes: (1) product
description, (2) quantity on hand, and (3) product cost.
Clicking a Compute button should display the total value of the inventory
product to an output textbox. Clicking a Reset button will reset the form.
Clicking an Exit button will close the form. Set Option Strict On.
[20 marks]
QUESTION THREE [20MARKS]
a) b) Explain how the escape key on the keyboard can be mapped to the cancel button on
a form and the enter key is mapped o the ok button. [4 Marks]
Explain the following references to array elements: [4 Marks]
AmountDecimal(3)
StatesString(6)
c) Describe the two ways used to fill a List control in VB and explain situations where
each way is best suited. [5 Marks]
d) Define a MenuStrip control as used in VB. [3 Marks]
ii) Explain two ways used to display data from a database on a VB form. [4 Marks]
QUESTION FOUR [20MARKS]
a) Analyze this coding segment and determine which message box will display.
[10 Marks]
‘Assign a value to two strings and compare them
Name1String = “Donnie”
Name2String = “Doug”
If Name1String > nameString2 Then
MessageBox.Show(“Name: ” & Name1String & ” is
bigger”)
Else
MessageBox.Show(“Name: ” & Name2String & ” is
bigger”)
End If
b) Describe using examples how to define tool tips for buttons and other controls in
V.B.net. [6 Marks]
c) Explain the use of hot keys in VB .net [4 Marks]
QUESTION FIVE (20 MARKS)
a) Using examples to illustrate differentiate between the Parse method and the
Globalization enumeration as used in vb.net. [6 Marks]
b) Describe using an example in VB the use of ToUpper and Tolower methods.
[6Marks]
c) Using sample VB code declare a module-level array and store values to the array
immediately. [8 Marks]

(Visited 107 times, 1 visits today)
Share this:

Written by