# BIT1303A BBIT105 BAC1203  PROGRAMMING METHODOLOGY,INTRODUCTION TO PROGRAMMING.

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

QUESTION ONE [30 MARKS]
a) State and explain the stages of program development lifecycle (PDLC). (6 Marks)
b) Name and explain any THREE programming errors. (6 Marks)
c) Discuss FOUR symbols used in a flowchart and show illustrations of these (4 Marks)
d) Design a program using a flowchart that will guide in calculating the area and perimeter of a
rectangle. (4 Marks)
e) Differentiate between ++ and — operator as postfix and prefix (4 Marks)
f) With the aid of a C program explain how conditional operators work. (6 Marks)
QUESTION TWO [20 MARKS]
a) Identifiers in C are user defined words used to name entities like variables, arrays, functions,
structures etc. Explain any FOUR rules used in naming identifiers in C. (4 Marks)
b) The table below shows the cost of electricity per unit:
Consumption Range Cost (per unit)
Over 700 units 4.5
501 – 700 units 3.5
200 – 500 units 2.5
Below 200 units 1.5
Write a C program that prompts the user to input the number of units consumed and then
computes the total cost and displays the result. (6 Marks)
c) Differentiate between symbolic and literal constants in C. Give an example. (4 Marks)
d) Data types refer to an extensive system used for declaring variables or functions of different
types before its use. These types can be classified as derived types of primary types. Describe
any THREE primary types in C and highlight the memory size and range of values for each
type. (6 Marks)
QUESTION THREE [20 MARKS]
a) Describe following program control structures:
i) Repetition structure (2 Marks)
ii) Selection structure (2 Marks)
b) 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. (6 Marks)
c) Differentiate between argument and parameter as used in C functions. (4 Marks)
d) Write a C program to read a number keyed in by the user to reverse the digits of a given number
(6 Marks)
QUESTION FOUR [20 MARKS]
a) Programming paradigm refers to basic structuring of thoughts underlying the programming
activity. State and explain FOUR programming paradigms. (4 Marks)
b) Describe FOUR lexical elements in a C programming language. (4 Marks)
c) Describe any FOUR calculation operators in C programming . (4 Marks)
d) Write a program in C to pass an array containing age of a person to a function. The function
should prompt the user to enter age for all persons then find the average age and display the
average age in main function. (8 Marks)
QUESTION FIVE [20 MARKS]
a) Discuss any TWO types of language translators. (4 Marks)
b) A C program is required that uses two one-dimensional arrays to store 10 integers. Each of
the elements stored in the first array is then modified by incrementing its value by 2 and the
value is stored in another array. The program should display all the values in these two
arrays.
Required:
i) Create an algorithm in the form of a flowchart or pseudocode to illustrate the
solution. (4 Marks)
ii) Write a C program to implement the solution. (8 Marks)
c) Explain TWO advantages and TWO disadvantages of low level programming languages.
(4 Marks)

(Visited 136 times, 1 visits today)