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

Sit 103 Visual Programming - 105517

Uploaded by

danielmikuro29
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)
26 views

Sit 103 Visual Programming - 105517

Uploaded by

danielmikuro29
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/ 5

MURANG’A UNIVERSITY OF TECHNOLOGY

SCHOOL OF COMPUTING AND INFORMATION


TECHNOLOGY

DEPARTMENT OF INFORMATION TECHNOLOGY

UNIVERSITY ORDINARY EXAMINATION

2018/2019 ACADEMIC YEAR


FIRST YEAR SECOND SEMESTER EXAMINATION FOR BACHELOR OF
SCIENCE IN SOFTWARE ENGINEERING

SIT 103 – VISUAL PROGRAMMING

DURATION: 2 HOURS
DATE: 17/4/2019
TIME: 9-11 A.M.

Instructions to candidates:

1. Answer question One 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 5
SECTION A: ANSWER ALL QUESTIONS IN THIS SECTION

QUESTION ONE (30 MARKS)

a) Visual Programming languages have an Integrated Development Environment (IDE) that


provide most of the component tools required by a programmer in his/her software
development tasks. Briefly explain the functionality of the following visual Basic IDE
components.

i. Tool box
ii. Properties window
iii. Project/solution Explorer
iv. Form layout window
v. Code window (10 marks)
b) Information required for each and every student in a university database include the
following six data items: registration number, name, date of birth, gender (male/female),
number of units enrolled for and the amount of money to pay for the entire academic year. In
a VB application program, state the MOST appropriate VB data type for each of the variable
to be assigned EACH of these data items. GIVE a reason for each of your choices.
(6 marks)
c) The figure below depicts a VB application program GUI that receives two numbers for the
user. When the user clicks the COMPARE NUMBERS button; if the numbers are equal, the
feedback: “The numbers are equal” is displayed in the results text-box and if they are not
equal the feedback message (e.g. “Num is greater than N Num 2”) is accordingly displayed
in the results test- box-on clicking the clear button content in all text-boxes is accepted.
YOUR TWO NUMBERS

Num 1: Num 2:

Results:
nnN NNn

COMPARE NUMBERS CLEAR

Page 2 of 5
For the intended purpose to be accomplished, you are required to write an Event procedure
for EACH of the buttons. (Use appropriate naming convections for all the variables and the
GUT controls). (7 marks)

d) Write an Event procedure that implements a FOR loop and input dialog box to promote the
user for TEN numbers, calculates their SUM and average, and display those number with
their sum and average in a picture-box named picOutput. (7 marks)

SECTION B – ANSWER ANY TWO QUESTIONS IN THIS SECTION

QUESTION TWO (20 MARKS)


2. (a) Explain each of the following terms as used in a VB environment. (10 marks)
i. Event
ii. Event drivers Programming
iii. Project
iv. Control
v. Option Explicit
(b) The GUI shown below was designed to capture the present value (P value) of vehicle,
the annual rate® of depreciation, and the time duration (n) in years from the user. The
program then calculates and displays the vehicles future value (f value) at the end of the
specified time duration. (The guiding formular is f Value = P Value (1- r/100)2

Future value Calculator - X

Present Value (ksh)

Depreciator rate (%) p.a:

Number of years:

CALCULATE FUTURE VALUE


VAVALUEVALUE

Page 3 of 5
Write an Event procedure for the Calculate future value button to perform the task when the
button is clicked (Use appropriate naming conventions for all the variables and the GUI controls?
(10 marks)

QUESTION THREE (20 MARKS)

a) In a visual application design, adding a professional touch via the properties of controls is an
important and desirable aspect. Describe the effect of each of the following control properties
and elements with respect to GUI appearance and interactability with the application user.
(10 marks)
i. Border style property
ii. Accept Button property
iii. Cancel Button property
iv. Keyboard Access Keys (Hot keys)
v. Tooltip property
b) Describe an appropriate situation under which each of the following controls may be used
i. Checkbox Controls
ii. Radio Button controls (4 marks)
c) Sometimes an application user may accidently click the EXIT/CLOSE button of an
application program. It is therefore wise to provide the application with a facility like the
dialogue box shown below so as to allow the user to confirm his/her intention.

QUIT? X

? Are you sure you want to close the program?

YES NO

Write an Event procedure of the application EXIT/CLOSE button that will trigger the popping –
up of the above dialogue Box. (6 marks)

Page 4 of 5
QUESTION FOUR (20 MARKS)

a) With respect to visual Basic differentiate between a syntax error and a semantic/ logical
error and a sematic/logical error AND give an example of each. (4 marks)
b) With the aid of diagrams, explain the logical and functional differences between DO
WHILE and DO LOOP UNTIL structures as used in VB environment. (6 marks).
c) Write a program that uses text-boxes to accept a student’s cat, assignment and exam scores
that are marked out of 20, 10 and 70 respectively. The program calculates the total score and
implements a select case structure to assign a letter grade and an order-of-merit as per the
grading scale shown below. The poxigram should also display the name of the students, ALL
his/her three scores and order-of-merit in a picture-box named picResults. (10 marks)
TOTAL SCORE % LETTER GRADE ORDER OF MERIT
70-100 A Distinction
60-69 B Credit I
50-59 C Credit II
40-49 D Pass
Below 40 F Fail

Page 5 of 5

You might also like