100% found this document useful (1 vote)
44 views5 pages

Structured Programming0001

This document is an examination paper for the Craft Certificate in Information Technology focusing on Structured Programming, issued by the Kenya National Examinations Council. It consists of two sections, with Section A requiring all questions to be answered and Section B allowing candidates to choose four questions. The paper covers various topics related to C programming, including programming languages, data structures, algorithms, and specific coding tasks.

Uploaded by

mercywambui451
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
100% found this document useful (1 vote)
44 views5 pages

Structured Programming0001

This document is an examination paper for the Craft Certificate in Information Technology focusing on Structured Programming, issued by the Kenya National Examinations Council. It consists of two sections, with Section A requiring all questions to be answered and Section B allowing candidates to choose four questions. The paper covers various topics related to C programming, including programming languages, data structures, algorithms, and specific coding tasks.

Uploaded by

mercywambui451
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
1920/203 STRUCTURED PROGRAMMING July 2023 Time: 3 hours THE KENYA NATIONAL EXAMINATIONS COUNCIL CRAFT CERTIFICATE IN INFORMATION TECHNOLOGY MODULE I STRUCTURED PROGRAMMING 3 hours INSTRUCTIONS TO CANDIDATES This paper consists of TWO sections: Section A and B. Answer ALL the questions in section A and any FOUR from section B in the answer booklet provided. Candidates should answer the questions in English ‘This paper consists of 5 printed pages. Candidates should check the question paper to ascertain that all the Pages are printed as indicated and that no questions are missing. © 2023 The Kenya National Examinations Council. Turn over Section A (40 marks) Answer All the questions in this section 1. @)_ State four examples of third generation programming languages. (2 marks) (6) Explain the function of a /oader as used in programming. (2 marks) 2. State the difference between / operator and % operator as used inaC program. (4 marks) 3. Outline four characteristics of a C programming language. (4 marks) 4. Kennedy considered the following factors when choosing a programming language: (a) efficiency: (b) elasticity ofa language Explain a reason for each of this consideration. (4 marks) 5. Explain a circumstance that would necessitate the use of each of the following format strings in aC program: (@) %d () %f (4 saarks) 6. The following is a program written in C programming language. Use it to answer the questions that follow: #include main() { printf ("My country is Kenya”); } Explain the function of each of the following in the code: (a) maing () if) (4 marks) 7. Jared used the following keywords in a C program that he developed. (@) goto statement; (b) break statement; Explain the function of each of the key words in the program. (4 marks) The following is a statement used in a C program. Use it to answer the questions that follow: for (k=1;k<=20; k++) (a) Identify the logical expression in the statement. (2 marks) (b) State the function of the statement k++, (2 marks) 1920/203 2 July 2023, 9. With the aid of an illustration, state the difference between a one-dimensional array and a two- dimensional array as used in C programming language. (4 marks) 10. Describe each of the following data structures as used in programming language. (@) stack; (6) linked list. (4 marks) 1920/203 3 ‘Turn over July 2023 (o) © 122 @ (b) (©) 13. (a) (b) © 1920/203 July 2023, Section B (60 marks) Answer any FOUR questions in this section Describe each of the following tools as used in programming (i) decision tree; (ii) flow chart. (4 marks) Marion intends to develop an application in C programming language. Describe two types of software other than the operating system she would require to achieve her goal. (4 marks) (Explain merge sort technique as used in C programming. (2 marks) (ii) The following are clements in an array. Use it to answer the questions that follow. (6 [1 [i621 [26731 [37 Using a binary search algorithm, write a pseudo-code to find the element 26 in the array. (5 marks) (@ Explain the term binary file as used in C programming. (2 marks) (i) Outline two advantages of using a binary file in C programming. (2 marks) Sally documented a program that she developed. Explain three types of documentations that she could have considered. (6 marks) Write a program using C programming language that would display all integers from 20 t0 50. Use a for loop statement. (5 marks) Explain the function of each of the following function prototype statements in a C program: (float areacint, int) Gi) int void sum(int) (4 marks) State a program development phase where each of the following activities may be performed: (5 marks) (writing the actual program; (ii) stating the requirements of the program to be developed; (iii) enhancing the operation of the program; (iv) checking if the program meets its requirement specifications; (v) drawing a flowchart to show the logic of a program. ‘The volume of a sphere is given by V = +x mx r3, where V is the volume and r is the radius. Write a C program that would compute and display the volume ofa sphere with a radius 20cm, (6 marks) 4 @ 0) © 15. @) (b) (© 1920/203 July 2023 Outline three advantages of sub programs in programming, (G marks) With an aid of an example, differentiate between a single character constant and a string character constant as used in C programming. (4 marks) The following is a program in C programming language. Use it to answer the questions that follow. #include ant g; int main () 4 int a, b; a= 10; b= 20; gsatb printf ("value of a = td, b = #d and g = d\n", a, b, g); return 0; ) (i) State two statements that have been used to initialise variables in the program. (2 marks) (ii) Explain the function of \n in the printf statement. (2 marks) Explain the scope of each of the following variables declared in the program: O ss aya. (4 marks) State the difference between “a” command mode and “w+” command mode as used in C programming files. (4 marks) Explain the function of each of the following in C programming language. (i) escape sequence; i) nested loop; (iii) clrscr() command, (6 marks) Write a C program that would accept a string of 10 characters through an input statement. The program should then print the first character and last character of the string on the screen. (5 marks) THIS IS THE LAST PRINTED PAGE.

You might also like