DIT 305 PROGRAMMING METHODOLOGY.

UNIVERSITY EXAMINATIONS: 2017/2018
EXAMINATION FOR THE DIPLOMA IN INFORMATION TECHNOLOGY
DIT 305: PROGRAMMING METHODOLOGY
MODE: PART TIME/FULL TIME
DATE: NOVEMBER, 2017 DURATION 1 ½ HOURS
INSTRUCTION: Answer any THREE questions.

QUESTION ONE [20 MARKS]
a) Explain why organizations and software developers are interested in searching for more
efficient ways to perform the software development process.
[4 Marks]
b) Explain the following data types with the help of examples
i. Array
ii. Struct
iii. Typedef
iv. enumeration
[8 Marks]
c) Explain four advantages of using functions in structured programming.
[4 Marks]
d) Differentiate between a compiler and interpreter as used source code translation
[4 Marks]
QUESTION TWO [20 MARKS]
a) Explain the importance of having the stdio.h header file in the source files.
[4 Marks]
b) Explain the following program control structures:
i. Switch
ii. Do…while
iii. For
iv. If…else
[8 Marks]
c) Describe the TWO pointer operators in C.
[4 Marks]
d) Describe TWO advantages of modularization as used in structured programming.
[4 Marks]
QUESTION THREE [20 MARKS]
a) Differentiate between user defined and built-in functions.
[2 Marks]
b) Write a C program to convert hours to minutes or vice versa depending on what the user
needs.
[9 Marks]
c) Discuss the following programming paradigms:
i. Imperative paradigm
ii. Logical paradigm
iii. Functional paradigm
[9 Marks]
QUESTION FOUR [20 MARKS]
a) Explain the possible causes of the following errors in a program.
i. Syntax error
ii. Semantic error
iii. Logic error
[6 Marks]
b) Define the term statement as used in a C program.
[2 Marks]
c) Write appropriate C statements for:
i). Setting up a constant PAYRATE as 1000.00 using define preprocessor.
ii). Test if age is below 18 or above 65
iii). Print five blank lines, then print the message “its over”
[6 Marks]
d) Define modulus operator. Explain the limitations of modulus operator.
[6 Marks]
QUESTION FIVE [20 MARKS]
a) Write a C program to receive a number in base 10, then convert it to its binary equivalent.
[8 Marks]
a) Given the variables A and B have initial values 60 and 13 respectively predict the output for:
i). A&B
ii). A|B
iii). A^B
[6 Marks]
b) For each of the following built-in functions in C, explain the use. Assume x is the argument.
i. Sqrt(x)
ii. Log(x)
iii. Pow(x)
[6 Marks]

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

Written by