UNIVERSITY EXAMINATIONS: 2018/2019
EXAMINATION FOR DIPLOMA IN INFORMATION TECHNOLOGY
DIT305 PROGRAMMING METHODOLOGY
MODE: FULL TIME/PART TIME
DATE: JULY, 2019 TIME: 2 HOURS
INSTRUCTIONS: Answer question ONE and any other TWO.
QUESTION ONE [30 Marks]
a) State and explain the stages of program development lifecycle(PDLC).
b) Name and explain THREE programming errors.
c) Draw and explain FOUR symbols used in a flowchart.
d) Design a program using a flowchart that will guide in calculating the area and perimeter of a
e) Differentiate between ++ and — operator as postfix and prefix
f) With an aid of a C program explain how conditional operators work.
QUESTION TWO [20 Marks]
a) Explain two and two advantages of low level languages.
b) Identifiers in C are user defined words used to name entities like variables, arrays, functions,
structures etc. Explain any FOUR rules used in naming identifiers in C.
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 C highlighting memory size and range of values for each type.
d) Differentiate between symbolic and literal constants in C. Give an example.
QUESTION THREE [20 Marks]
a) Write a C program that asks the user to enter an integer and then the program generates the
multiplication table up to 5.
b) Differentiate between argument and parameter as used in C functions.
c) Write a C program to read a number keyed in by the user to reverse the digits of a given number.
QUESTION FOUR [20 Marks]
a) Programming paradigm refers to basic structuring of thoughts underlying the programming
activity. State and explain FOUR programming paradigms.
b) Describe FOUR lexical elements in a C programming language.
c) Describe any FOUR calculation operators in C programming language
d) Write a program in c to pass an array containing age of a person to a function. The function
should prompt the user to enter age for all persons then find the average age and display the
average age in main function.
QUESTION FIVE [20 Marks]
a) Briefly explain three advantages of modularization in C programing. 3 Marks
b) Explain how developers achieve/implement modularization in C programming. 3 Marks
c) Using switch case selection, write a well commented C program to compute all arithmetic.
operations (+, -, /, *). 8 Marks
The program should ask the user to select the operation they want to perform where;
Finally, the program should display the results to the user.
d) Explain any two format specifiers used in C programming. 4 Marks
e) Explain the difference between a logical operator and a relational operator. 2 Marks