Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 3

KITALE NATIONAL POLYTECHNIC.

INTERNAL EXAMS FOR MARCH 2024 SERIES.

DEPARTMENT:.........IT...........................................................................................................................

COURSE:...........DICT ............………….. CODE: dcs229 ……………………….

SUBJECT:.........vb................... CODE:..................................................................

DATE: ................................... TIME:..................................... SESSION: 2 hours

NO. OF COPIES:.......................................................20........................................................................

INSTRUCTIONS TO CANDIDATES.

Answer all questions.


1. Explain the functions of each of the following controls in visual basic program: (10 marks)
i. Label;
ii. text box;
iii. Option button;
iv. Check box;
v. Command button;
2. (a) Explain four elements of a control in visual basic program . (4 marks)
(b) Write a visual basic program that will convert student marks to student grades as per the table
below. (6 marks)
Student marks

Student marks grade

81-100 “ A”

76-80 “A-”

68-75 “B+”

58-67 “B”

48-57 “C+”

38-47 “C”

30-37 “C-”

29 AND BELOW FAIL

Any other marks Invalid marks

3. (a) Explain the term concatenation as used in visual basic program. (2 marks)
(b) Explain two symbols used for concatenation in visual basic program giving an example in
each case. (4 marks)
(c) With the use of a Function. Write a visual basic program that will calculate the area of a
circle. Attach the code to the command button. (4 marks)

4. Name the three types of logical operators that are used in visual basic. In each type give three
examples. (10 marks)
5. State whether each of the following variable declaration are valid or invalid giving a reason for
answer. (10 marks)
i. Dim myname as string
ii. Dim answer123 as integer
iii. Dim !number as integer
iv. Dim const num=3.14 as float
(b) Explain circumstance that would necessitate the use of each of the following statements when
declaring variables: (10 marks)

i. Dim;
ii. Option explicit;
iii. Public;

6. (a) Distinguish between caption and name as used in menu editor in visual basic program
(2 marks)
(b) With example; name and explain any four operators that are used in visual basic program
(4 marks)
(c) List and explain any four data type in visual basic program (4 marks)

You might also like