0% found this document useful (0 votes)
6 views5 pages

Visual Programming

This document is an examination paper for a Diploma in Information and Communication Technology, specifically focusing on Visual Programming. It consists of multiple sections with various questions covering topics such as object naming conventions, data types, logical operators, and Visual Basic programming concepts. Candidates are instructed to answer all questions in section A and any three from section B within a 2-hour timeframe.

Uploaded by

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

Visual Programming

This document is an examination paper for a Diploma in Information and Communication Technology, specifically focusing on Visual Programming. It consists of multiple sections with various questions covering topics such as object naming conventions, data types, logical operators, and Visual Basic programming concepts. Candidates are instructed to answer all questions in section A and any three from section B within a 2-hour timeframe.

Uploaded by

182vickie
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

DIPLOMA IN INFORMATION AND COMMUNICATION TECHNOLOGY

MODULE II
VISUAL PROGRAMMING
AUGUST 2026

TIME: 2 HOURS

INSTRUCTIONS TO CANDIDATE

1. This paper consists of TWO sections: A and B.


2. Answer ALL questions in section A and ANY THREE (3) questions in section B.
3. Marks for each question are indicated in the brackets.
4. Candidates are provided with a separate answer booklet
5. Do not write on the question paper.

Question One (30 marks)

a. State Object naming conversions of controls (prefix) for the following


i. Textbox
ii. Command button
iii. Form
iv. CheckBox
v. comboBox (5 marks)
b. Explain four data types found in visual basic programming (4 marks)
c. With aid of an example show how constants are declared in visual basic. (2marks)
d. Differentiate between public variable and local variable (4 marks)
e. Write a Visual Basic program that will compute the average of integers from 20 to 50
and output the result on a form. Use for loop. Attach the code to a command click event.

Page 1 of 5
(3 marks)

f. Table 1 shows the status of two expressions after execution in Visual Basic programming
language. Use it to answer the question that follows:

Table 1

Expression1 Expression2 OR AND


False False
False True
True False
True True

Page 2 of 5
Evaluate the effect of combing the two expressions through the use of logical operators OR and
AND. (4 marks)

g. Distinguish between the following as used in Visual Basic programming language:


(8marks)
i) DirListBox and FileListBox
ii) Data and OLE
iii) PictureBox and Frame
iv) Method and Event

Question TWO (20 marks)

a) Explain the meaning of the following text box properties (6 marks)

i) SelLength
ii) SelStart
iii) SelText

b) Distinguish between the following as used in visual basic programming language.

i) Label and command button

ii) ListBox and ComboBox

iii) checkbox and Option button (6 marks)

c) Using visual basic arithmetic operator give the results after evaluation in table1 (8marks)

Table 1

Operand and operator Results

5+5

10-5

25/5

20\3

Page 3 of 5
5*4

3^3

20 Mod 6

"George"&" "&"Bush"

Question Three (20 marks)

a) Write a code to add the following Nairobi, Nyeri, Embu, Muranga, Nyandarua and
Kiambu county in a combo box. (6 marks)
b) Assume you have to find the grade attained by a student for a course unit done in a given
semester using nested if write a code that will display the grade in a text box. Use table 2
to assign grades. (10 marks)

Average Grade
Above 70 A
Above 60 B
Above 50 C
Above 40 D
Below 40 E

c) Write the syntax of the Select…Case structure (4 marks)

Question Four (20 marks)

a) Distinguish between the Str () and Chr() functions as used in Visual Basic
programming language. (4 marks)
b) With the aid of a program flowchart, describe the following control structures as
used in programming languages:

Page 4 of 5
i. Sequence;
ii. Selection. (6 marks)

c) Write a Visual Basic program that will be able to count from 1 to 50 and display the
output in a form. Use a Do While...Loop. Attach the code to a command click
event.
(4 marks)
d) Explain the function of each of the following components in a Visual
Basic programming language:

i. Project Explorer Window


ii. Toolbox
iii. Object browser (6 marks)

Page 5 of 5

You might also like