1920/203
STRUCTURED PROGRAMMING
AUGUST 2024
Time: 3 hours
KENDEGE TECHNICAL AND VOCATIONAL COLLEGE
CRAFT CERTIFICATE IN INFORMATION TECHNOLOGY
MODULE I
STRUCTURED PROGRAMMING
3 Hours
INSTRUCTIONS TO CANDIDATES
You should have the following for this examination:
Answer Booklet
This paper consists of TWO sections
Answer any ALL questions in both sections
Candidates should answer the questions in English
©August 2024, Kendege TVC Computing & Informatics Department Page 1
Answer any FIVE questions.
1. Distinguish between Procedural and Non-Procedural programming languages
(4 Marks)
2. Assuming you are programming in C language, evaluate the expression;
Z=a + b % c * (d ^ 2)
Given that a = 10, b = 23, c = 7 and d = 5.
(4 Marks)
3. The following are identifiers used by a student in C programming language during program
writing.
myVal, const, integer and switch
Citing a reason in each case, state whether these identifiers are valid or not.
(4 Marks)
4. Write a program in C language that prompts a user to enter age of a person. The program then
displays the age and a message “You are an adult” whenever the age is greater than 18 years.
(4 Marks)
5. Outline two uses of comments in pascal programming language.
(4 Marks)
6. Explain the function of each of the following in the code
i.) Main()
ii.) Printf()
(4 marks)
7. Kemasaba used the following keywords in a c program that he developed
i.) Goto statement
ii.) Break statement
Explain the function of each of the key words in the program.
(4 marks)
8. Outline four characteristics of a C programming language
(4 marks)
9. Explain a circumstance that would necessitate the use of each of the following format strings
in a C program:
i.) %d
ii.) %f
(4 marks)
10. The following is a statement used in a C program. Use it to answer the questions that follow:
for (k=1; k<=20; k++)
i.) Identify the logical expression in the statement.
ii.) State the function of the statement k++.
(4 marks)
©August 2024, Kendege TVC Computing & Informatics Department Page 2
Section B (60 marks)
Answer ALL Questions in this section
11. (a) Mwita, a computer programmer intends to create a program using the C programming
language. State the program development stage in which she could:
i. Create flow charts
(1 Marks)
ii. Choose identifiers for variables
(1 Marks)
iii. Check whether the program is giving the desired results
(1 Marks)
iv. Adjust the program to meet new demands
(1 Marks)
(b) Explain one reason that may cause a run time error to occur in a program
(2 Mark)
(c) The table below shows the criteria used by a county government to allocate bursaries
to students. Use it to answer the question that follows.
Status Amount Allocated
Orphan 15,000
Needy 13,000
Affirmative Action 13,000
Other 0
Write a program in C language that would prompt a user to enter the status of a student.
The program then outputs the amount allocated to student. Use case statement
(3 Marks)
12. a) Johnson intends to name identifiers when writing a C program. Outline four rules that
he should observe.
(4 Marks)
b) Explain the function of each of the following commands in a C program
i.) Curly braces;
ii.) Return 0;
iii.) #include<stdio.h>
(6 marks)
c) state five examples of sorting techniques used in data structures
(5 marks)
13. (a) (i) Explain the term binary file as used in C programming.
(2 marks)
(ii) Outline two advantages of using a binary file in C programming
©August 2024, Kendege TVC Computing & Informatics Department Page 3
(2 marks)
(b) Kay documented a program that she developed. Explain three types of
documentations she could have considered.
(6 marks)
(c) write a program using C language that would display all integers from 20 to 50. Use
for loop statement.
(5 marks)
14. (a) With the aid of a diagram, describe each of the following data structure elements in
respect to entry and retrieval of data.
i.) Queue
ii.) Stack
(6 marks)
(b) Given the following array of data: 6, 11,16, 21,26, 31, 37. Sort the data using merge
sort showing all the steps.
(6 marks)
(c) Explain the function of each of the following in C programming language.
i.) Escape sequence
ii.) Nested loop
iii.)Clrscr() command
(3 marks)
THIS IS THE LAST PRINTED PAGE
©August 2024, Kendege TVC Computing & Informatics Department Page 4