BIT 1303A-BBIT 105-BAC 1203- PROGRAMMING METHODOLOGY INTRODUCTION TO PROGRAMMING.

UNIVERSITY EXAMINATIONS: 2017/2018
EXAMINATION FOR THE DEGREES OF BACHELOR OF SCIENCE IN
IT/ BUSINESS IT/ APPLIED COMPUTING
BIT 1303A/BBIT 105/BAC 1203: PROGRAMMING METHODOLOGY/
INTRODUCTION TO PROGRAMMING
FULLTIME/ PART TIME/ DISTANCE LEARNING
ORDINARY EXAMINATIONS
DATE: AUGUST, 2018 TIME: 2 HOURS
INSTRUCTIONS: Answer Question One & ANY OTHER TWO questions.

QUESTION ONE [30 MARKS]
a) Discuss the characteristics of procedural languages. (4 Marks)
b) Explain why one might want to write a program in a machine independent language instead
of a machine dependent language. (4 Marks)
c) Program errors can be syntax, logical, linker or semantic errors. Classify the following
errors:
i) Misspelling keywords (1 Mark)
ii) Dividing a number zero (1 Mark)
iii) Using an undeclared variable (1 Mark)
iv) Misspelling a function name. (1 Mark)
d) Describe any THREE basic data types in C and state the amount of space occupied in memory by
each. (6 Marks)
e) Design a program using a flowchart to swap two values stored in two variables x1
and x2. (4 Marks)
f) Write a C program to store twenty natural numbers in a one-dimensional array then
calculate and display the sum of the odd numbers that are members of this array. (8 Marks)
QUESTION TWO [20 MARKS]
a) Write a simple program to return memory addresses and size of the following variables:
i) int x
ii) float y (4 Marks)
b) Describe TWO ways of creating constants in C language (4 Marks)
c) Write C statements for each of the following cases:
i) Print three blank lines (2 Marks)
ii) Read two integer values stored in variables a and b in one statement (2 Marks)
iii) Display the value of a floating-point variable in three decimal places. (2 Marks)
d) Developed programs must be tested in all environments. Discuss THREE environments in
which testing can be performed. (6 Marks)
QUESTION THREE [20 MARKS]
a) Using flowcharts, describe following program control structures:
i) Repetition structure (3 Marks)
ii) Selection structure (3 Marks)
iii) Sequential structure (3 Marks)
b) Design a program using pseudo code to calculate and display the gross pay of fifty
employees given that gross = basic pay + allowances. (5 Marks)
c) Implement the design in b) using C. The program should prompt the user to enter basic pay
and allowance, then calculate and display gross pay for all the fifty employees. (6 Marks)
QUESTION FOUR [20 MARKS]
a) Identify any FOUR benefits of white box testing (4 Marks)
b) Define the following programming terms:
i) Statement
ii) Evaluation
iii) Operator (6 Marks)
c) Design a program that uses functions to calculate the perimeter and area of a rectangle once
given dimensions. Hint: use a flowchart. (4 Marks)
d) Implement the design in a) using C. The program should prompt the user to enter the
dimensions of the rectangle. (6 Marks)
QUESTION FIVE [20 MARKS]
b) i) Discuss the aspects and activities involved during program design. (4 Marks)
ii) Apart from design, describe FOUR other stages that program development will
undergo. (4 Marks)
c) Discuss any TWO types of language translators. (4 Marks)
d) Write a program that uses structure called product whose members are price and quantity.
There are two objects (instances) of this structure namely soap and salt. Assume price is of
type float while quantity is of type integer. (8 Marks)

(Visited 131 times, 1 visits today)
Share this:

Written by