Cit301 2023 - 2
Cit301 2023 - 2
FACULTY OF SCIENCES
DEPARTMENT OF COMPUTER SCIENCE
2023_2 EXAMINATIONS 2023SEM2
Q1.
(a) Compare modularity to monolithic systems?
3 marks
(b) Differentiate between call by value and call by reference?
4 marks
(c) Describe with a C statement, 4 common string functions you know?
4 marks
(d) A transport company contracts you to publish the steps for transporting passengers from one
city to another. Using the first four phases of program development and respective tools,
practically implement the process.
14 marks
Q2.
(a) Discuss 4 characteristics of low-level languages
8 marks
(b) Tabulate 3 dissimilarities between semantic and runtime errors?
6 marks
www.puredu.net
Study Centre: Emevor Community Study Centre (DE02)
Q3
(a) What are the character set used C programming language? Put your response in a tabular
format.
4 marks
(b) Describe 3 rules for constructing integer constants
3 marks
(c) Declare a variable for each of the following C data type: integer, float, double, and
character and assign appropriate data value at the pointer of declaration.
4 marks
(d) What is a statement? Give 2 examples.
4 marks
Q4.
(a) What will the following code segment give? Execute the code manually and give the
result:
#include<stdio.h>
void main ()
{ int a;
a=5;
for (k=1;k=4;k++)
{
while (a>=1)
{
printf ("%d",a); a--;
} printf("\n");
a= 10;
}
}
5 marks
(b) Distinguish between if-else if statement and the switch statement using the following
features: syntax, usage and expression?
6 marks
www.puredu.net
Study Centre: Emevor Community Study Centre (DE02)
(c) Write a C program to print EVEN or ODD depending on the integer number supplied
4 marks
Q5
(a) Execute manually, the following programming code:
main( )
{
int i = 2;
switch ( i )
{
case 1:
printf ( "Case 1 executing\n" ) ;
case 2:
printf ( "Case 2 executing\n" ) ;
case 3:
printf ( "Case 3 executing\n" ) ;
default :
printf ( "Default executing\n" ) ;
}
}
3 marks
(b) In C, what is the equivalent statement for switch?
1 mark
(c) Rewrite the code in (a) using if else if statements?
6 marks
(d) Write a C function to generate n odd numbers?
5 marks
Q6
(a) Differentiate between an object and executable files?
6 marks
(b) What is a compound statement? Using a pseudocode, distinguish between a for and while
block/structure?
9 marks
www.puredu.net