Sit 103 Visual Programming - 105517
Sit 103 Visual Programming - 105517
DURATION: 2 HOURS
DATE: 17/4/2019
TIME: 9-11 A.M.
Instructions to candidates:
Page 1 of 5
SECTION A: ANSWER ALL QUESTIONS IN THIS SECTION
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
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)
Number of years:
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)
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
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