0% found this document useful (0 votes)
20 views

CIT-2251-Event-Driven-Programming.doc-1

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views

CIT-2251-Event-Driven-Programming.doc-1

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

MERU UNIVERSITY OF SCIENCE AND TECHNOLOGY

P.O. Box 972-60200 – Meru-Kenya


Tel: +254(0) 799 529 958, +254(0) 799 529 959, + 254 (0) 712 524 293,
Website: [email protected] Email: [email protected]

University Examinations 2018/2019

SECOND YEAR SECOND SEMESTER EXAMINATION FOR THE DIPLOMA IN


INFORMATION TECHNOLOGY

CIT 2251: EVENT DRIVEN PROGRAMMING

DATE: AUGUST 2019 TIME: 11/2 HOURS

INSTRUCTIONS: Answer question one and any other two questions

QUESTION ONE (30 MARKS)

a) List three reasons why VB.net is a widely used professional language (3 marks)

b) Name three services that can be written on the .net framework platform (3 marks)

c) Explain the difference between a list box and combo box (4 marks)

d) Why is error handling essential? (2 marks)

e) Explain the typical uses of the following control tools as used in visual basic

(3 marks)

i. Label

ii. Textbox

iii. Button

f) Distinguish between the following methods in Visual Basic when forms (4 marks)

i. Hide () and close ()

ii. Load () and exit ()

iii. Write a statement that could be used to display a form called frmain (1 mark)

g) State any two rules to be followed when naming identifiers (2 marks)

Meru University of Science & Technology is ISO 9001:2015 Certified


Foundation of Innovations Page 1
h) Write down the syntax for declaring a variable in visual basic, then illustrate it using
an example (4 marks)

i) Name any four events available in visual basic (4 marks)

QUESTION TWO (20 MARKS)


a) Distinguish between the name and text property of an object as used in a visual basic
environment (4 marks)
b) Explain the use of the following properties assigned to a label at design time in a visual
basic program (3 marks)
i. Backcolor
ii. Forecolor
iii. Autosize

c) Write a VB program that allows a user to enter the strings ‘Alex’ and 1234 into
respective textboxes in a login screen. If the two are valid, a form named frmain is
opened, otherwise a message ‘invalid name or password’ is displayed on a message
box. Attach the code to a command button (7 marks)
d) State two examples of database supported by visual basic program (2 marks)
e) Outline the function of each of the following elements of the Integrated Development
Environment (IDE) in a visual basic program
i. Project form (1 mark)
ii. Menu bar (1 mark)
iii. Tool bar (1 mark)
iv. Code window (1 mark)

QUESTION THREE (20 MARKS)


a) The following is a message box function. Outline the function of each of the parts
labelled (i) (ii), (iii) (3 marks)

Meru University of Science & Technology is ISO 9001:2015 Certified


Foundation of Innovations Page 2
b) Distinguish between / and mod operators as used in visual basic (2 marks)
c) Distinguish between a load and double click events (2 marks)
d) The body mass index (BMI) of a person is computed based on the body weight in
weight
kilograms and the body height in metres using the formula . Write a VB
height 2
program that allows a user to enter the weight and the height in the text boxes. The
program should then compute the BMI and then display the BMI value with an
additional message depending on where the BMI value falls (6 marks)
Scale Message
0-18 You are underweight, watch your diet!
18-25 You are normal, keep it up!
25-30 You are overweight, please exercise
Over 30 You are obese, check diet and please exercise

e) Write a VB program that converts temperature from 0C to 0F.=32+9/5C. The code


should be attached to a command button (4 marks)
f) State a reason why each of the following visual conditions is wrong (3 marks)
i. Temperature >45 and <65
ii. Value 1 and value 2=5
iii. Case is 60 to 69
QUESTION FOUR (20 MARKS)
a) Explain the difference between a checkbox and a radiobutton as used in VB programs
(4 marks)
b) The figure below shows an interface information used to enter information into a list
box. Write a VB program that would implement each of the command buttons
(7 marks)

Meru University of Science & Technology is ISO 9001:2015 Certified


Foundation of Innovations Page 3
c) Rewrite the following mathematical expression to its equivalent during the actual
writing of the code (2 marks)
AB(1 + B ) N
P=
(1 + B )N −1
d) List two examples of event driven programming languages (2 marks)
e) Write a program that would display even numbers between 10 and 20 on a form. Use a
do....while statement. Attach the code to a command button (5 marks)

Meru University of Science & Technology is ISO 9001:2015 Certified


Foundation of Innovations Page 4

You might also like