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

Comp 111: Introduction To Computer Programming November 2009 Question Paper

Comp 111: Introduction To Computer Programming November 2009 

Course:Bachelor Of Education Science

Institution: Kabarak University question papers

Exam Year:2009



COURSE CODE: COMP 111
COURSE TITLE: INTRODUCTION TO COMPUTER
PROGRAMMING
STREAM: SESSION II

INSTRUCTIONS:
Answer Question 1 and two other Questions

QUESTION ONE (30 MARKS)
a) Describe how programming languages are classified. [4 Marks]
b) Define the following terms:
i. Documentation [1 Mark]
ii. Programming. [1 Mark]
iii. Flowchart. [1 Mark]
iv. Debugging. [1 Mark]
v. Testing. [1 Mark]
c) Discuss the basic structure of a C program. [6 Marks]
d) Write a flowchart that performs the basic arithmetic operations. [5 Marks]
e) Differentiate between constants and variables in programming. [4 Marks]
f) Write a program in C that accepts a string and reverses it. [6 Marks]


QUESTION TWO (20 MARKS)
a) i) Define an operating system and give two suitable examples.[2 Marks]
ii) State and explain any four functions of operating system. [4 Marks]
b) Describe four drawbacks of Assembly Level Language. [4 Marks]
c) Differentiate between the following:
i. Loader and Linker. [2 Marks]
ii. Assembler and Compiler. [2 Marks]
iii. Application software and System software. [2 Marks]
d) Write and explain the output of the following C program. [4 Marks]
#include<stdio.h>
main()
{
int a=2, b=12;
printf(“a=%d\n,a--);
printf(“b=%d\n,--b);
}

QUESTION THREE (20 MARKS)
a) Write a C program to compute the total marks scored by a student who sat for 4
Subjects in an exam. Include the code for awarding grades where (70%= First
Class, 60% =Second Class, 50%=Pass, and below 50% =Fail) [7 Marks]
b) Describe any three binary operators. [6 Marks]
c) Discuss the unary operator with an example. [4 Marks]
d) Describe any six features of C Programming language. [3 Marks]

QUESTION FOUR (20 MARKS)
a) State three (3) categories of control statements. [3 Marks]
b) Write a program in C that accepts two numbers and checks whether they are equal
or not. [5 Marks]
c) Describe the nested-if statement. [6 Marks]
d) Differentiate between the while and do-while statements. [4 Marks]
e) Explain how variables are initialized. [2 Marks]

QUESTION FIVE (20 MARKS)
a) What is a data type? Explain the basic data types in C. [7 Marks]
b) List and explain formatted and unformatted input statements in C. [4 Marks]
c) Write a program that prints the sum of the first n natural numbers. [5 Marks]
d) Rewrite the following program properly by correcting the errors and explain the
expected output. [4 Marks]
#include<stdio.>
main(
{
int m=4, n=;
print(“m=%d\n”,++m;
print(“n=%d\n”,n--);






More Question Papers


Popular Exams


Mid Term Exams

End Term 1 Exams

End Term 3 Exams

Opener Exams

Full Set Exams



Return to Question Papers