Sie sind auf Seite 1von 3

TECHNICAL UNIVERSITY OF MOMBASA

INSTITUTE OF COMPUTING AND INFORMATICS


DEPARTMENT OF COMPUTER SCIENCE & INFORMATION TECHNOLOGY
UNIVERSITY EXAMINATION FOR:
BTAP/SEP2017/J-FT
BSME/SEP2017/J&S-FT
BTMA/SEP2017/J&S-FT
BTME/SEP2017/J&S-FT
BTRE/SEP2017/J-FT

EIT 4102; EIT 4253; TEE 4211: COMPUTER PROGRAMMING1-EX 1


END OF SEMESTER EXAMINATION
SERIES:DECEMBER2018
TIME:2HOURS
DATE:Pick DateNov2018
Instructions to Candidates
You should have the following for this examination
-Answer Booklet, examination pass and student ID
This paper consists of FIVE questions. Attemptquestion ONE (Compulsory) and any other TWO questions.
Do not write on the question paper.

Question ONE

a. List three characteristics of structured programing. [3 marks]


b. Give the syntax for the conditional operator. Explain how the operator works. [4 marks]
c. Describe three variable scopes in C, illustrating how they are declared. [6 marks]

c. Provide the syntax for a for loop. Outline four steps that describe the working of a for loop
[5 marks]

©Technical University of Mombasa Page 1 of 3


d. Provide the syntax for an if else statement and write a C program that uses the statement to show you are
eligible for voting if you are 18 years old. [5 marks]

e. Write an algorithm that reads the two sides of a rectangle and calculate its area. [4 marks]

f. Draw a flow chart for the algorithm in part e. [3 marks]

Question TWO

a) List six classifications of programming tokens in C language. [6 marks]

b) Differentiate between a C variable, C Array and C Structure :[6 marks]

c) State four rules of creating identifiers in C. [4 marks]

d) Write a C program that prompts the user for his name and prints it. [4 marks]

Question THREE

a. State four constructs of a C program. [4 marks]

b. State three differences between Variable Declaration and variable Definition. [6 marks]

c. Write a C program that uses a function n to calculate area of a circle. The user enters the radius.
[10 marks]

Question FOUR

a. List five steps involved in a program execution. [5 marks]

b. Identify five operations on data files. [5 marks]

b. Write a program that stores a sentence entered by a user into a data file [10 marks]

Question FIVE

a. Outline three types of program errors sating potential cause for each. [6 marks]

b. A recursive function is a function that calls itself. Provide the syntax of a recursive function
[4 marks]
c. Write a C program that stores elements in a 2x2 array and prints the output. [6 marks]

d. Describe four applications of pointers in C programs. [4 marks]

©Technical University of Mombasa Page 2 of 3


©Technical University of Mombasa Page 3 of 3

Das könnte Ihnen auch gefallen