Sit103 105502
Sit103 105502
DURATION: 2 HOURS
Instructions to candidates:
a) Briefly explain the following visual basic IDE components (10 marks)
i. Tool box
ii. Properties window
iii. Project explorer
iv. Form layout
v. Code window
b) Choose the most appropriate VB data type to store the following values. Explain why
your choice is the most appropriate.
i. A student registration number
ii. The amount of money paid as fees by students
iii. The number of students enrolled in a certain college.
iv. The interest rate charged if the account goes overdrawn to an accuracy of two decimal
places.
v. The name of a student.
vi. The number of students enrolled in all the colleges and universities in Kenya.
vii. The date a student was admitted.
viii. Whether a student is a male or not. (4 marks)
c) With the aid of diagrams describe the behaviour and the difference between a Do
while….LOOP and a DO….LOOP UNTI structures. (8marks)
d) Describe a situation under which checkbox controls and radio buttons may be used in an
application program. (4marks)
e) with aid of an example differentiate one dimensional and two dimensional arrays
(4marks)
2
develop an event procedure that performs the task. The calculation of the depreciation is
based on the reducing balance method whose algebraic expression is
fvalue=pvalue(1-r/100)n. (10marks)
Present value
Number of years
c) Sometimes an application user may accidentally click the Exit button of an application
and it is therefore wise to provide the application with a facility like the dialog box shown below.
Study it and develop an event procedure of the exit button that triggers the dialog box.
(8marks)
QUIT?
YES NO
3
QUESTION FOUR (20 MARKS)
a) With respect to classes and procedures distinguish between a variable scope and a
variable lifetime. (4marks)
b) An elaborate application program is required, it should accept from the user the radius
and height of a solid cylinder via two text-boxes, calculate, and display both the volume and the
total surface area of the cylinder respectively. The output should be via two label controls on
clicking a push-button control.
(Hint: Algebraically v= h and SA= h+ h)
i. Sketch a diagram of an appropriate GUI you would design for this program.(2marks)
ii. Write an event procedure for the click button. (8marks)
c) Describe the ordered steps to follow when creating VB.Net database application
program.(Assume an Ms Access database linking.) (6marks)