Get premium membership and access revision papers, questions with answers as well as video lessons.
Got a question or eager to learn? Discover limitless learning on WhatsApp now - Start Now!

Programming Methodology Question Paper

Programming Methodology 

Course:Bachelor Of Science In Information Technology

Institution: Kca University question papers

Exam Year:2009



UNIVERSITY EXAMINATIONS: 2009/2010
FIRST YEAR EXAMINATION FOR THE DEGREE OF BACHELOR OF
SCIENCE IN INFORMATION TECHNOLOGY
BIT 1304: PROGRAMMING METHODOLOGY
DATE: DECEMBER 2009 TIME: 2 HOURS
INSTRUCTIONS: Answer question ONE and any other TWO questions
QUESTION ONE
a) With the help of a flowchart illustration for each, differentiate between pre test and post test loops.
[6 Marks]
b) Explain any four data types in c programming language [4 Marks]
c) using some code segment differentiate between the following
i. Iteration and recursion [4 Marks]
ii. Function definition and function prototype [4 Marks]
d) Giving examples for each list and explain any three types of operators in programming.
[6 Marks]
e) Using some code segment, describe the components of a c program. [6 Marks]
QUESTION TWO
a) Explain any five features that make high level languages the preferred ones over machine code and
assembly programming languages. [5 Marks]
b) Explain the advantages of functions in structured programming [5 Marks]
c) A program is required to calculate the volume of a cylinder. It is required that base area be
calculated using a function basearea() and its return value be used in the main() to calculate the
volume. Implement this in c language. [5 Marks]
d) Briefly describe the two approaches to modular programming. Which one is the most
2
Preferred and why? [5 Marks]
QUESTION THREE
a) A program is required to compute the sum of odd numbers between 31 and 367.
i. Draw a flowchart to depict solution to the problem
ii. Implement the above in c using ;
1.) A pre test loop
2.) A post test loop [12 Marks]
b) i) What is an array? Explain any three types of arrays.
ii) Write a program that will initialize an array with the days of the twelve months in a year and
output the month and its number of days to the screen
[8 Marks]
QUESTION FOUR
a) i) What do you understand by the term translators? [2 Marks]
ii) Compare and contrast a compiler with an interpreter. [6 Marks]
b) Write a program that calculates the factorial of an integer n (i.e. n!) if n! =n*(n-1)*(n-2)*…..*(n-
(n-1)) for n>1 and n! =1 for n<=1. [7 Marks]
c) Write a code segment that will allow the user input a value then output the address in memory
where the value is stored. [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
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