UNIVERSITY EXAMINATIONS: 2018/2019
EXAMINATION FOR DIPLOMA IN INFORMATION
TECHNOLOGY
DIT 305: PROGRAMMING METHODOLOGY
MODE: FULL TIME/PART TIME
ORDINARY EXAMINATIONS
DATE: NOVEMBER, 2018 TIME: 2 HOURS
INSTRUCTIONS: Answer question ONE and any other TWO.
QUESTION ONE [30 MARKS]
a) Define the following terms as used in programming methodology. (10mks)
i. Pseudocode
ii. Algorithm.
iii. Programming paradigms.
iv. Structured programming.
v. Reserved words.
10 Marks
b) State FOUR advantages of structured programming.
4 Marks
c) State and explain the stages of program development lifecycle.
6 Marks
d) Draw and explain FOUR symbols used in a flowchart.
4 Marks
e) Draw a flowchart for a program that accepts length and width of a rectangle, then calculate and
display the area and perimeter.
6 Marks
QUESTION TWO [20 MARKS]
a) Name and explain THREE programming errors
6 Marks
b) With an aid of a C program explain how conditional operators work.
6 Marks
c) Given that A and B are integers and are given initial values 21 and 12, predict the output of the
following C statements.
i. Printf(“%d”,A>=B);
ii. Printf(“%d”,!(A<B));
iii. Printf(“%d”,A&B);
iv. Printf(“%d”,A^B);
8 Marks
QUESTION THREE [20 NARKS]
a) Distinguish between an array of pointers and pointers to an array.
6 Marks
b) Differentiate between argument and parameter as used in C functions.
4 Marks
c) Write a C program to read a number keyed in by the user to reverse the digits of a given number.
10 Marks
QUESTION FOUR [20 MARKS]
a) Explain two and two advantages of low level languages.
4 Marks
b) Identifiers in C are user defined word used to name of entities like variables, arrays, functions,
structures etc. Explain any FOUR rules used in naming identifiers in C.
4 Marks
c) Data types refer to an extensive system used for declaring variables or functions of different types
before its use. These types can be classified as derived types of primary types. Describe the four
primary types in highlight memory size and range of values for each type.
8 Marks
d) Differentiate between symbolic and literal constants in C. Give an example.
4 Marks
QUESTION FIVE [20 MARKS]
a) Briefly explain THREE constructs used in repetition structures
6 Marks
b) Explain the difference between exit controlled and entry controlled loops.
4 Marks
c) Explain the role of break and continue keywords in a loop.
4 Marks
d) Write a C program to receive twenty integers, store them in an array, then calculate and display their
sum.
6 Marks