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

Coe 162: Introduction To Programming Question Paper

Coe 162: Introduction To Programming 

Course:Bachelor Of Engineering In Electrical And Electronics Engineering

Institution: Moi University question papers

Exam Year:2012



COE 162: INTRODUCTION TO PROGRAMMING

CAT I
INSTRUCTION: ATTEMPT ALL QUESTIONS IN THIS PAPER

1. Define the following programming concepts: source code, non-procedural language, stepwise refinement and parameter. (4mks)

2. Identify FOUR important differences between programming in low level languages and programming in high level languages. (4mks)

3. Draw a flowchart for a program that accepts 20 numbers and finds the number of zeroes and non-zeroes in them. (5mks)

4. Write a C program to print the numbers between 1 and 10, along with an indication of whether each is even or odd, in this manner:
1 is odd
2 is even
3 is odd ...
(Hint: use the % operator)

5. The volume (V) of a sphere is given by the following formula:

V= 4/3 *pi*r*r*r

Write a C program that reads real values of r and calculates and outputs V in exponential form. (6mks)

6. What is the output of the following code?
{
int x=9, int y=14;
x=x++;
y=++y;
printf ("%d %d \n", x,y);
} (2mks)

7. A program contains the following declarations and initial assignment.

int i=8, j=5, k;
Float x=0.005, y=-0.01, z;
Char a,b,c='c', d='d';

Determine the value of the following assignment expressions. Use the values originally assigned to the variables for each expression.
i. x*=2
ii. i+=(j-2)
iii. a=(c<d)? c:d (4mks)






More Question Papers


Popular Exams



Return to Question Papers