DIT 305 – PROGRAMMING METHODOLOGY KCA Past Paper


UNIVERSITY EXAMINATIONS: 2020/2021
EXAMINATION FOR THE DIPLOMA IN INFORMATION TECHNOLOGY
DIT 305: PROGRAMMING METHODOLOGY
DATE: NOVEMBER, 2021 TIME: 2 HOURS
Instructions: Answer ALL questions.

QUESTION ONE (20 MARKS)
a) Amina has been advised to use a high level programming language to develop a system for a
certain organization:
(i) Outline two features of the programming language [2 Marks]
(ii) List three examples of high level programming languages [3 Marks]
b) Name two characteristics of a good algorithm. [2 Marks]
c) State and explain two types of repetition structures in C programming. [3 Marks]
d) State whether the following statements are true or false:- [2 Marks]
(i) Keywords can be used as variable names
(ii) Special characters can be used as variable names
e) Outline four differences between an interpreter and a compiler [4 Marks]
f) Write a program in c to calculate total of two floating point numbers then display the average.
[4 Marks]
QUESTION TWO (15 MARKS)
a) Write a C program that counts the number of digits 9 to 0 [5 Marks]
b) The figure below shows a trapezoid. Write a C program that will solve the area of the trapezoid

c) Identify and correct the errors in each of these statements: – [3 Marks]
i. Printf(welcome);
ii. scanf(“d”, x);
iii. printf(“welcome”)
d) Explain four data types supported by C language [4 Marks]
QUESTION THREE (15 MARKS)
a) Write C program that reads 4 percentage scores from a games scoreboard then prints a message
using the following criteria: [5 Marks]

b) Explain why the main() function is special in a C program [2 Marks]
c) Write a C program that prompts the user to enter the radius of a circle and then calculates the
area of a circle. (3 Marks)
Page 3 of 3
d) Write a C program that prints the following output on the screen. [3 Marks]
This is final Exam paper for the Diploma students
Observe the rules
e) Differentiate between printf and scanf as used in C programming. [2 Marks]
QUESTION FOUR (15 MARKS)
a) Write a C program that prompts the user to enter three numbers, calculate and prints the sum as
output. [4 Marks]
b) List and briefly explain THREE type of control structures supported by C language.
[6 Marks]
c) With the aid of an example illustrate the syntax of commenting a block of statement in C
programming language. [5 Marks]

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

Written by