DIT 504 APPLICATION PROGRAMMING.

UNIVERSITY EXAMINATIONS: 2013/2014
ORDINARY EXAMINATION FOR THE DIPLOMA IN
INFORMATION TECHNOLOGY
DIT 504 APPLICATION PROGRAMMING
DATE: AUGUST, 2014 TIME: 1½HOURS
INSTRUCTIONS: Answer Any Three Questions.

QUESTION ONE
a) Define the following terms as used in programming and support your answer with
examples.
i. Method
ii. Variable
iii. Comments
iv. Event driven programming
[8 Marks]
b) Write one line of code to perform the following tasks in VB
(i) Display the text “Programming is great” on a label lbTrial
(ii) To clear text form a text box txttrial
(iii) Add items “apple”,”Mangoe”,”Orange”, to a combobox cbotrial
(iv) Put the insertion cursor on the first textbox; txttrial
[4 Marks]
c) State the syntax of the functions msgbox[] and inputbox[] [2 Marks]
d) Differentiate between the following looping constructs [give general syntax of
each]; „while … loop‟ and „do… while loop‟. [4 Marks]
e) One of the qualities of a good program is readability. As a result, there are a
number of techniques employed by programmers to ensure that programs are
readable. Discuss any TWO of them. [2 Marks]
QUESTION TWO
a) Differentiate between a sub procedure and a function [4 Marks]
b) Write a windows application to accept inputs for the dimensions of a rectangle
through the input box function and then compute the area and perimeter of the
rectangle. The Area and Perimeter should be displayed through a Message Box
[8 Marks]
c) Explain the term debugging [2 Marks]
d) Describe the Visual studio IDE environment and list FIVE components on this
window. [6 Marks]
QUESTION THREE
a) Write a program to calculate the sum of the first SIX positive integers using the
Do while loop [6 Marks]
b) Rewrite the above code using the For..Next loop . [3 Marks]
c) Explain the meaning of the following Visual Basic code. [2 Marks]
Dim Test[5] as Integer
ReDim Test[15] as Integer
d) Explain THREE types of errors encountered during program development
[6 Marks]
e) Write pseudo code for a program to calculate the sum of ten numbers provided by
a user [3 Marks]
QUESTION FOUR
a) Distinguish between a selection control and a loop control structure [4 Marks]
b) Outline FOUR characteristics of a good algorithm [4 Marks]
c) Briefly explain any THREE advantages of using functions in a program[6 Marks]
d) Using examples, Explain any THREE fundamental data types supported by the
VB language. [6 Marks]
QUESTION FIVE
a) List any TWO rules used when naming variables [Identifiers] [2 Marks]
b) A program is required to process and award students grades for students in a class
according to the following summary table.
Marks% Grade
80 – 100 A
60 – 79 B
40 – 59 C
Below 40 Fail
Write a VB program that prompts the user for the student‟s Marks and outputs the
appropriate grade. [6 Marks]
c) describe THREE data operators supported by VB [6 Marks]
d) Describe the THREE control structures used in programming [6 Marks]

(Visited 106 times, 1 visits today)
Share this:

Written by