Ics 2175 Computer Programming I C
Ics 2175 Computer Programming I C
SECTION A (COMPULSORY)
d) Define the term data file and show how it is created. (3 marks)
e) Define the following terms and show how they are created.
i) Data structure
ii) Array
iii) Pointer (6 marks)
© 2012 – The Mombasa Polytechnic University College Page 1
f) Outline THREE advantages of program modulation. (3 marks)
b) Write a C program that prompts the user for 2 numbers and gets the sum. (5 marks)
c) Describe the FIVE elements of the system development life cycle. (10 marks)
Question Three (20 marks)
a) Describe THREE types of programming languages giving ONE advantage and ONE
disadvantage for each. (6 marks)
b) Write a C program that prompts the user for the first initial of his name and outputs the answer.
(4 marks)
c) Write a C program to input 10 student marks in array and calculate and display:
i) Student marks
ii) Average grade
iii) Highest grade
iv) Lowest grade. (10 marks)
Question Four (20 marks)
a) Differentiate between external variables at internal variables. Give examples. (4 marks)
c) Declare a structure variable with at least FOUR member elements, one of which should be an
array and another pointer. (6 marks)
d) Write a C program that uses a function to calculate the factorial of a number. (6 marks)
Question Five (20 marks)
a) What is modular programming? (2 marks)