# DBIT 204 PRINCIPLES OF MANAGEMENT1.

UNIVERSITY EXAMINATIONS: 2015/2016
EXAMINATION FOR THE DIPLOMA IN BUSINESS/ INFORMATION
TECHNOLOGY
DBIT 303 COMPUTER PROGRAMMING CONCEPTS
DATE: AUGUST 2016 TIME: 1½HOURS

QUESTION ONE
(a) Describe five features of high level programming languages (10 Marks)
(b) Distinguish between the following terms as applied in programming providing an example in
each case:
(i) Relational operators and arithmetic operators
(ii) User defined function and inbuilt function (6 Marks)
(c)Define the following terms as used in programming: – (4 Marks)
(iii)Variable
(iv)Function
QUESTION TWO
(a)Differentiate between a structure and a union (2 Marks)
(b)List and briefly describe three types of errors in programming giving a suitable example in
each case (6 Marks)
(c) Describe two types of documentation in programming (4 Marks)
(d) (i)Using an example, give the syntax of declaring a one dimension array (3 Marks)
(ii) The following matrix represents DBIT 303 Exam scores for 2 students in 4 units:
70 78 69 75
50 43 40 38
Required:-initialize the above scores in a two dimensional array (5 Marks)
QUESTION THREE
(a)The Marks obtained by a student in 4 different subjects are input through the keyboard. The
average score is then calculated. The student gets a grade as per the following grading criteria:-

Note: any average below 0 or above 100 is wrong
Required: Write a program using && logical operators to determine and display the grade
obtained by the student (10 Marks)
(b) List and briefly explain the seven steps involved while developing C programs (7 Marks)
(c) Outline three factors that make C program popular amongst many computer programmers
(3 Marks)
QUESTION FOUR
(a)Write appropriate C statements for:-
(i) Incrementing a variable number by 1 (2 Marks)
(ii) Setting up a constant PIE as 3.14 using the define preprocessor (2 Marks)
(b) Explain the role of the following functions in C programming:-
(i) main() (2 Marks)
(ii) printf() (2 Marks)
(iii)scanf() (2 Marks)
(c) List and briefly explain five factors you would consider while selecting a programming
language (8 Marks)
QUESTION FIVE
(a) Write a pseudocode algorithm for a program to read the values firstnumber, secondnumber
and thirdnunmber and display the value of Y
Given that Y=firstnumber x secondnumber x thirdnumber. (6 Marks)
(b) Using examples, explain the difference between a while loop and a do while loop. (6 Marks)
(c) Write a C program that prompts the user to enter His/ Her first name, second name and last
name. The program should then display the user entered three names (8 Marks)

(Visited 96 times, 1 visits today)