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

Programming Methodology Question Paper

Programming Methodology 

Course:Bachelor Of Science In Information Technology

Institution: Kca University question papers

Exam Year:2009



UNIVERSITY EXAMINATIONS: 2008/2009
FIRST YEAR EXAMINATION FOR THE DEGREE OF BACHELOR OF
SCIENCE IN INFORMATION TECHNOLOGY
BIT 1304: PROGRAMMING METHODOLOGY
DATE: AUGUST 2009 TIME: 2 HOURS
INSTRUCTIONS: Answer question ONE and any other TWO questions
QUESTION ONE
a) Differentiate between worst case running time and average case running time in relation to analysis
of algorithms [4 Marks]
b) Describe any two tools used in algorithm design. [2 Marks]
c) Explain any four data types in c programming language [4 Marks]
d) using some code segment differentiate between the following
i. Iteration and recursion [4 Marks]
ii. Function definition and function prototype [4 Marks]
e) Giving examples for each list, explain any three types of errors in programming. Which one is
more subtle? Give reason for your answer [6 Marks]
f) Using some code segment, describe the components of a c program. [6 Marks]
QUESTION TWO
a) Explain any four methods of file organization an access [4 Marks]
b) Carry out a worst case time analysis for the following algorithm
For i=1 to n {
…..
For j=1 to n{
2
…….
K=j;
While (k>=2) {
…….
K=k-1;
}
}
}
[9 Marks]
c) Explain the steps in program development [7 Marks]
QUESTION THREE
a) Write single line statements to accomplish the following
i. Prompt the user to enter an integer. End your prompt message with a semicolon.
ii. Read an integer from the keyboard and assign it to variable “num”.
iii. If the variable "Num” is not equal to 7, print “value not 7”.
iv. Print the message “this is a C program”, on two lines where the first line ends with C.
v. Declare a 15 character string called “grade”
[5 Marks]
b) Using one statement for each and some explanation, illustrate how the following string functions
are implemented.
i. Strcpy()
ii. Strcat()
iii. Strcmp()
iv. Strlen() [8 Marks]
c) 1. What do you understand by operator precedence? Suppose p, q and r are integer variables that
have the values p=8, q=3 and r=-5. x, y, and z, are floating point variables with values x=8.8,y=3.5
and z=-5.0. Determine the value of each of the following expressions.
i. P/q
ii. 3*q-3*(p-r)
iii. (X/y)+z
iv. X%y
v. (P*r)%q
[7 Marks]
3
QUESTION FOUR
a) Explain any five features that make C language the preferred one over other programming
languages. [5 Marks]
b) Explain the advantages of functions in structured programming [5 Marks]
c) Rewrite the following program statement using the switch statement
If (x==1)
{
Printf (“x is 1”);
}
Else if(x==2)
{
Printf (“x is 2”);
} else
Printf (“value of x unknown”); [5 Marks]
d) Briefly describe the two approaches to modular programming. Which one is the most
Preferred and why? [5 Marks]
QUESTION FIVE
a) State the master theorem on recursion. Hence or otherwise find the running time for the following
recursions
i. 3T (n/3) +n
ii. 2T (n/4) +n2 [6 Marks]
b) Define the term algorithm. The efficiency of an algorithm can be measured in terms of the amount
of computational resources. Name three of these resources. [4 Marks]
c) Differentiate between the following terms
i. Tractable and intractable problems
ii. Polynomial time and non polynomial time problems
[4 Marks]
d) Give the elements of the following
i. Divide and conquer method of solution
ii. Dynamic programming [6 Marks]






More Question Papers


Popular Exams



Return to Question Papers