Get premium membership and access revision papers, questions with answers as well as video lessons.

Introduction To Programming Question Paper

Introduction To Programming 

Course:Bachelor Of Computer Science (It Telecommunication)

Institution: Kabarak University question papers

Exam Year:2010



Page 1 of 3
KABARAK UNIVERSITY
UNIVERSITY EXAMINATIONS
2010/2011 ACADEMIC YEAR
FOR THE DEGREE OF BACHELOR OF COMPUTER SCIENCE
AND BACHELOR OF SCIENCE IN ECONOMICS & MATHEMATICS
COURSE CODE: COMP 111
COURSE TITLE: INTRODUCTION TO PROGRAMMING
STREAM: Y1S1
DAY: THURSDAY
TIME: 9.00 – 11.00 A.M
DATE: 16/12/2010
INSTRUCTIONS:
• Section A is compulsory
• Attempt other two questions from Section B
PLEASE TURNOVER
Page 2 of 3
SECTION A (30 Marks)
QUESTION ONE: (30 MARKS)
a) Explain the three types of instructions in C. (3 Marks)
b) Write a program to calculate simple interest for ten clients who are enjoying the same
terms. The initial deposit is Ksh.50, 000, rate of interest is 3% and the period of maturity
is four years.
(5 Marks)
c) Why is C most preferred by many professional programmers? (4 Marks)
d) Differentiate between the following: - (6 Marks)
i. Identifier and keyword
ii. Formal arguments and actual arguments
iii. Looping and nesting
e) Explain four properties that qualify a function in a program. (4 Marks)
f) Explain a pointer in C. (4 Marks)
g) What is an array? How is a 1 – dimensional array initialized? (4 Marks)
SECTION B: (20 Marks each)
QUESTION TWO: (20 MARKS)
a) Any character is entered through the keyboard; write a program to determine whether the
character entered is a capital letter, a small letter, a digit or a special symbol. The
following table shows the range of ASCII values for various characters: (6 Marks)
Characters ASCII
A – Z 65 – 90
a – z 97 – 122
0 – 9 48 – 57
Special symbols 0 – 47, 58 – 64, 91 – 96, 123 – 127
Page 3 of 3
b) Differentiate between the following:
i. Logical operators and relational operators (4 Marks)
ii. Local variables and global variables (2 Marks)
c) Write a program to receive an integer and find its octal equivalence. (6 Marks)
d) Define a structure. (2 Marks)
QUESTION THREE: (20 MARKS)
a) Differentiate between the following: - (6 Marks)
i. Continue and break
ii. Do –while and while statement
iii. Binary and tertiary operators
b) Write a program to print the multiplication table up to ten of the number entered by the
user. The table should be displayed in the following format: (6 Marks)
29 * 1 = 29
29 * 2 = 58
c) Explain the for loop statement. (4 Marks)
d) Explain the 2 –D array and how to initialize it. (4 Marks)
QUESTION FOUR: (20 MARKS)
a) Explain the benefits of using functions in programming. (4 Marks)
b) Write a program to interchange two values of user’s choice using functions and only two
variables. (6 Marks)
c) Define the following: - (4 Marks)
i. Recursion
ii. Auto
iii. Loose typing
iv. Initialization
d) Write a program to find the square of any number using a function. (6 Marks)






More Question Papers


Popular Exams



Return to Question Papers