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

SIT 103 Visual Programming 105524

Uploaded by

danielmikuro29
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views

SIT 103 Visual Programming 105524

Uploaded by

danielmikuro29
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

MURANG’A UNIVERSITY OF TECHNOLOGY

SCHOOL OF COMPUTING AND INFORMATION TECHNOLOGY

DEPARTMENT OF INFORMATION TECHNOLOGY

UNIVERSITY ORDINARY EXAMINATION

2017/2018 ACADEMIC YEAR


THIRD YEAR SECOND SEMESTER EXAMINATION FOR THE DEGREE OF
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY,
BACHELOR OF SCIENCE IN BUSINESS INFORMATION TECHNOLOGY,
BACHELOR OF SCIENCE IN SOFTWARE ENGINEERING,
BACHELOR OF SCIENCE IN COMPUTER TECHNOLOGY

SIT 103-VISUAL PROGRAMMING

DURATION: 2 HOURS

DATE: 19TH APRIL 2018

TIME: 2.00-4.00PM

Instructions to Candidates:

1. Answer Question 1 and Any Other Two questions.


2. Mobile phones are not allowed in the examination room.
3. You are not allowed to write on this examination question paper.

Page 1 of 4
SECTION ONE – ANSWER ALL QUESTIONS IN THIS SECTION
QUESTION ONE

a) With use of suitable examples describe the rules that govern naming of identifiers in a Visual
Basic environment (8 marks)
b) Explain the following Visual Basic IDE components (6 marks)
i. Toolbox
ii. Properties window
iii. Code window
c) i. Outline four characteristics of a visual programming language (4 marks)
ii. Distinguish between a method and property as used in visual programming (2 marks)
d) You are required to write a VB program that enables the user to calculate the sum, product,
division and difference of two numbers entered through text-box controls after a click of
responsive button. The results are displayed in a Text-box control and upon the click of a second
button, the user may clear the text-box controls content ready for next input.
i. Sketch a suitable graphical user interface assigning appropriate property values to your form
and other controls (2 marks)
ii. Write the code for EACH of the buttons, declaring your variables appropriately (8 marks)

SECTION TWO – ANSWER ANY TWO QUESTIONS IN THIS SECTION

QUESTION TWO

a) State the most appropriate VB data type for a variable that stores the following values.
Give a reason for each of your choices. (8 marks)
i. A student registration number
ii. Amount of money paid as fees by a student
iii. Whether a student is male or female
iv. The total number of students enrolled in ALL universities and colleges in Kenya
b) Write an Event Procedure that uses input dialog boxes to accept students scores in CAT,
Assignment and Exam marked out of 20, 10 and 70 respectively. The program calculates the total

Page 2 of 4
score and implements a SELECT CASE Statement to assign a letter grade and Order-of-merit as
shown in the table below (8 marks)
Total Score (%) Letter Grade Order of merit
70 ≤ Score < 100 A Distinction
60 ≤ Score < 70 B Credit I
50 ≤ Score < 60 C Credit II
40 ≤ Score < 50 D Pass
Score < 40 F Fail

c) Describe two types of container objects uses in VB (4 marks)

QUESTION THREE

a) i. Differentiate between a sub procedure and a function procedure as used in VB (2 marks)


ii. Write a VB event procedure on a button that accepts the radius of a circle via a text-box control
AND invokes/calls a function procedure to calculate the area of the circle, which is finally
displayed in a second text-box control (Area of Circle = πr2) (6 marks)
b) i. With aid of labeled diagrams, describe the logical differences between a WHILE and a Do…
WHILE repetitive structures as used in VB. (4 marks)
ii. Write a VB event handler to generate and display the integers 1 to 10 in an implementation of a
FOR…NEXT repetitive structure (4 marks)
c) Explain the concept of the scope of variable in VB with respect to the use of the keywords Dim
and Private (4 marks)

QUESTION FOUR

a) With respect to visual programming explain the terms Event and Event Driven Programming
(4 marks)
b) With use of Truth-tables elaborate the following logical operators (8 marks)
i. AND
ii. OR
iii. NOT
iv. XOR

Page 3 of 4
c) Write a single VB statement that would trigger the pop-up dialog box shown below (6 marks)
i) Cost Input Form x ii) Feedback Message x

ENTER THE ITEM COST


Click to Test
OK
!
CANCEL

Enter item cost here Yes No Cancel

d) Describe ADO (2 marks)

Page 4 of 4

You might also like