103.docx
- 1. ©2023 Kendege Technical & Vocational College Page 1
2920/103
STRUCTURED PROGRAMMING
JUNE/JULY 2023
TIME: 3 HOURS
KENDEGE TECHNICAL AND VOCATIONAL COLLEGE
DIPLOMA IN INFORMATION AND COMMUNICATION TECHNOLOGY
MODULE I
STRUCTURED PROGRAMMING
3 Hours
INSTRUCTIONS TO CANDIDATES
Answer ALL questions in answer booklet provided
All questions carry equal marks
Candidates should answer the questions in English
The paper consists of 3 printed pages
Candidates should check the question paper to ascertain that all the pages are printed as indicated
and that no question is missing
- 2. ©2023 Kendege Technical & Vocational College Page 2
1 a) Explain two ways in which parameters can be passed to a function (4 marks)
b) Describe the following data structures as used in structured programming
a. Linked list (2 marks)
b. Stack (2 marks)
c) Write a simple program in C that implements a bubble sort algorithm (12 marks)
2 a) Differentiate between local variable and global variable as used in structured programming.
(4marks)
b) Given the numbers: 45, 23, 4, 15, 78, 52, 12, 6, 56, 92. Show a step-by-step process of sorting the
list using inserting sort algorithm (8marks)
c) Outline any four application areas of array data structures (4 marks)
d) State any four rules to observe while choosing a variable name (4 marks)
3 a) With the aid of syntax statements, differentiate between the do…while loop and the while loop as
used in structured programming. (4 marks)
b) State and explain any three types of errors encountered in a programming (6 marks)
c) Distinguish between pseudocodes and flowcharts as used in programming (4 marks)
d) Explain each of the following stages used when solving a computer problem
a. Problem definition (2 marks)
b. Writing an algorithms (2 marks)
c. Testing the solution (2 marks)
4 a) State any four programming paradigms giving a brief description of each (8 marks)
b) Maguire wants to write a program that computes and displays the average of 10 integers entered
through the keyboard one a time. Use a flow chart to design the program
(4 marks)
c) Outline the function of preprocessor directives as used in c language (2 marks)
d) Write a C program that could generate random numbers between 0 and 1 (6 marks)
5 a) Outline two cases where a programmer could use a compiler during program writing
(2 marks)
b) Explain any three types of program testing (6 marks)
- 3. ©2023 Kendege Technical & Vocational College Page 3
c) State the difference between a procedure and a function as used in structured programming
(4 marks)
d) Differentiate between post-increment and pre-increment as used in c language
(4 marks)
e) Distinguish between actual and formal parameters as used in programming (4 marks)
THIS IS THE LAST PRINTED PAGE