Cop 003: Programming Methodologies Question Paper
Cop 003: Programming Methodologies
Course:Bachelor Of Business Information Technology
Institution: The Presbyterian University Of East Africa question papers
Exam Year:2017
QUESTION ONE (30 MARKS)
a) Define the term preprocessor directives and state the preprocessor directive in C (3 marks)
b) Distinguish the following terms as applied in computer programming; (10 marks)
i. Low level language versus High level language
ii. Code versus data
iii. Assembly language versus Machine language
iv. Algorithm versus pseudo code
v. Program design versus Program coding
c) With the help of a diagram, explain the different classification of programs. (5 marks)
d) Discuss the following in relation to programming. (10 marks)
i. Compiler
ii. Variable
iii. Statement terminator
iv. %d
v. Array
e) Explain the term translator and give two examples. (2 marks)
QUESTION TWO (15 MARKS)
a) Distinguish Process from program (3 marks)
b) Explain, with the use of a simple example, when you would use the If else statement (5 marks)
c) Read the following statements and answer the questions that follow.
When preparing for a bath the following takes place:
(1) Turn on the hot and cold taps.
(2) Is it too hot or cold? If it is, go to step 3, otherwise go to step 4.
(3) Adjust the hot and cold taps and go back to step 2.
(4) Wait for 2 minutes.
(5) Is the bath full? If it is, go to step 7, otherwise go to step 6.
(6) Go back to step 4.
(7) Turn off the hot and cold taps.
-Draw an algorithm and a flowchart for the above scenario. (7 Marks)
QUESTION THREE (15 MARKS)
a) Write an algorithm and draw a flow chart that will read the two sides of a rectangle and calculate its area. (7 marks)
b) Define the purpose of the following directives in C (5 marks)
i. Return 0;
ii. Int main()
iii. Printf
c) Define the terms variables, constants and data types (5marks)
QUESTION FOUR(15 MARKS)
a) Explain what a flowchart is. (2 marks)
i. Jambo SACCO is a savings and credit society and lends money to its members at a certain SIMPLE INTEREST RATE (which is obtained as I=P*R*T, where I is the INTEREST, P is the PRINCIPAL, R is the SIMPLE INTEREST RATE, and T is TIME. Draw a flowchart for obtaining the INTEREST given P, R, and T and REPAYMENT INSTALLMENTS given by (PRINCIPAL + INTEREST)/TIME.
ii. Draw a flow chart and write some algorithm for the flowchart. (7 marks)
b) State and explain the various data types in programming (6marks)
QUESTION FIVE(15 MARKS)
a) Outline the stages of developing a working program. (5 Marks)
b) Alex wants to write a C program and needs to understand variables. With respect to variables answer the questions below
i) Define the term variables (1 Mark)
ii) State four rules he should adhere to when naming variables (2 Marks)
c) Justify the need for pseudo code in solving computer problems (2 Marks)
d) When declaring variables, one has to follow some certain rules/conventions. Enumerate four of these rules (4 marks)
e) Compare and contrast between compilers and interpreters. (1mark)
More Question Papers
Exams With Marking Schemes