Cit301 2024 - 1
Cit301 2024 - 1
FACULTY OF SCIENCES
DEPARTMENT OF COMPUTER SCIENCE
2024_1 EXAMINATION 2024MAY
Q1.
(a) Differentiate between a function and a procedure?
2 marks
(b) List any 10 keywords in C?
5 marks
(c) Describe 4 elements of structured programming?
4 marks
(d) You are invited by a social works group to automate the cleaning of a client’s kitchen.
Using the first four phases of program development and respective tools, practically illustrate
this process.
14 marks
Q2.
(a) In a table distinguish using 4 characteristics, structured and unstructured programming?
8 marks
Q3.
(a) What is an expression? Give 2 examples.
5 marks
(b) List 6 operators used in C programming language?
3 marks
(c) Given the mathematical expression: S + 3 x Y – 1, where S = 5 and Y = 34.
Reconstruct the expression in C format and evaluate it. Reconstruct the express such that the
result will be 271.
4 marks
(d) With a diagram, classify control statements?
3 marks
Q4.
(a) Differentiate between if and if else statements in C programming language using
diagram ONLY.
4 marks
(b) Write a sample C code for illustrating a function that accepts two arguments, and
returns values.
4 marks
(c) For each segment describing the basic structure of a C program below, give an
example to qualify each segment?
7 marks
Q5.
(a) Write syntax segments illustrating the switch and if else if statements in C? Give
examples?
10 marks