Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
10 views

Ics 2175 Computer Programming I C

Comp

Uploaded by

meshackkaranja20
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

Ics 2175 Computer Programming I C

Comp

Uploaded by

meshackkaranja20
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

THE MOMBASA POLYTECHNIC UNIVERSITY COLLEGE

(A Constituent College of JKUAT)


(A Centre of Excellence)

Faculty of Engineering &


Technology
DEPARTMENT OF MECHANICAL & AUTOMOTIVE ENGINEERING

UNIVERSITY EXAMINATION FOR DEGREE IN BACHELOR OF SCIENCE


IN MECHANICAL ENGINEERING (BSME Y2 SI)

ICS 2175: COMPUTER PROGRAMMING I (C)

END OF SEMESTER EXAMINATION


SERIES: AUGUST 2012
TIME: 2 HOURS
Instructions to Candidates:
You should have the following for this examination
- Answer Booklet
This paper consist of FIVE questions in TWO sections A & B
Answer question ONE (COMPULSORY) and any other TWO questions
Maximum marks for each part of a question are as shown
This paper consists of TWO printed pages

SECTION A (COMPULSORY)

Question One (30 Marks)


a) Declare and initialize FOUR stages of data in C program. (4 marks)

b) Outline FOUR applications of comments in programming. (4 marks)

c) Describe using diagrams, TWO types of control structures in C. (4 marks)

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)

g) Identify SIX steps used in solving computer based problems. (6 marks)


SECTION B (Answer Any Two Questions)
Question Two (20 marks)
a) Give the basic structures of a C program. (5 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)

b) Declare and initialize FOUR types of variables. (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)

b) Describe the process of modular programming. (4 marks)

c) List FOUR advantages of modular programming. (4 marks)


Write a C program that prompts the user for his age and displays grade very old if the age is > = 100,
Old if the age is greater than 60 but less than 70, middle age if the age is greater than 50 but less than
60, old if the age is greater than 40 but less than 50 and Young if the age is less than 40.
(10 marks)

© 2012 – The Mombasa Polytechnic University College Page 2

You might also like