TECHNICAL UNIVERSITY OF MOMBASA
INSTITUTE OF COMPUTING AND INFORMATICS
DEPARTMENT OF BUSINESS ADMINISTRATION
UNIVERSITY EXAMINATION FOR:
BBIT Y1S2
EIT 4102: FUNDAMENTALS OF PROGRAMMING
END OF SEMESTER EXAMINATION
SERIES:APRIL2016
TIME:2HOURS
DATE:Pick DateMay2016
Instructions to Candidates
You should have the following for this examination
-Answer Booklet, examination pass and student ID
This paper consists of Choose No questions. AttemptChoose instruction.
Do not write on the question paper.
Question ONE
a) Provide definitions for the following terms/phrase.
i. System program
ii. Application program
iii. Programming
iv. Algorithm [4 marks]
b) Identify three programming constructs [3 marks]
c) Write a C program to check if a number is odd or even and print the number [5 marks]
d) Name and describe four data types in C [6 marks]
e) Outline the computer problem solving steps [6 marks]
f) Write a C Program that prompts a user for a radius and calculates area and circumference of circle
[6 marks]
©Technical University of Mombasa Page 1 of 3
Question TWO
a) What is a storage class? Outline four storage classes used in C [5 marks]
b) Write a C program to perform basic arithmetic operations which are addition, subtraction, multiplication and
division of two numbers. Numbers are assumed to be integers and will be entered by the user.
[5 marks]
c) Write a C program to print a pyramid pattern as shown [10 marks]
Question THREE
a) List four types of operators in C [4 marks]
b) Identify the key elements of a program development environment (PDE) [4 marks]
c) Write a program that stores a sentence entered by a user into a data file [6 marks]
d) Write a C program that prompts a user for marks and prints A if mark is
>=70, B if marks is >=60 and <=69, C if mark is >=50 and <=59, D if mark
is >=40 and <=49 and F if mark is <40
[6 marks]
Question FOUR
a) Write an algorithm that reads in, displays and exchanges integer values of two variables
[4 marks]
b) Draw a flow chart and write the pseudo code for the algorithm in part a [8 marks]
c) Implement the algorithm using C programming language. [12 marks]
Question FIVE
a) Describe three variable scopes in C [6 marks]
b) Write a C program that illustrates the use of the variables in part a [6 marks]
c) Write a C program that calculates the factorial of any positive number n. [8 marks]
©Technical University of Mombasa Page 2 of 3
©Technical University of Mombasa Page 3 of 3