KNEC Craft Certificate in ICT module 2 structured programming past paper: July 2015 Answers

Solved.

Course Name:  Information and Communication Technology
Also Done By:
Diploma in ICT module 1
Course Level:  Craft Certificate
Sub Level:       Module II
Course Unit:   Structured Programming
Exam body:    KNEC

Share with Friends:
        
Go Back



1. Outline the function following preprocessor commands in a c program #: i)include ii)define iii)if iv)error ()

2. With an aid of an example in each case, distinguish between a second generation and fourth generation programming language ()

3. Outline two differences between an interpreter and compiler as used in programming ()

4. Given that x=10 and y=14.State the Boolean result for each of the following i)x!=y; ii)x++=12; iii)x>y; iv)y>x && x)

5. Differentiate between a break and continue statement as used in C programming ()

6. Outline the function of the following escape sequence operators i)\r ii)\f iii)\n iv)\t ()

7. Explain the role of the following c program statements. Printf(“enter the student data’’); Scanf(“%d,%c,%s,&k,n,&d); ()

8. Marion developed a program using a C programming language. Explain two features of this language ()

9. The following is a program written using a C programming language. Identify the errors in the program. #include<stdioh> main() { int p[10],i; float avg=0; Printf(enter 10 numerals); for(i=0;i<=9;i++) { scanf(“%d”,&p[i]); } for(i=0;i<=9;i++); { avg = avg+p[i]; } avg=(float)avg/0; printf(“enter average is %k\n”,avg); ()

10. Write a C program that would add 5 consecutive numbers starting from number 3. The program should display the output after every counter. Use a While loop ()

11. Outline three characteristics of a pointer variable as used in C programming ()

12. Outline two disadvantages of using pointers when writing a C program ()

13. Distinguish between object oriented and structured programming language ()

14. Write a C program that will display value and address of variable a given a = 5. Use pointers ()

15. Outline the function of each of the following file modes used in c programming language r+ a+ w ()

16. Describe a sorting technique that uses divide and conquer method ()

17. Write a Pseudocode that would be used to perform a selection sort as used in data ()

18. write a C program that compute and display the area of two rectangles given that has length and width 10,15 and 20,40 respectively. Use functions ()

19. State the differences between getw() and putw() as used in C programming language. ()

20. Explain two ways in which parameters can be passed to a function in C programming ()

21. Mercy is in the process of developing a system. Describe two types of documentation she is likely to come up with ()

22. Write a c program that would prompt user to enter the choice of fruit and display the message as shown in table 1. Use case statements ()

23. Marion used a linear search to locate a record in a file. Outline two advantages of this type of search in programming ()

24. Mathew used arrays to display ion formation. Explain two disadvantages he may have realized ()

25. Distinguish between formal and actual parameters as used in c programming languages ()

26. Write a c program that would prompt user to enter two numbers and check whether the two numbers are equal. Use an if statement ()

27. Describe each of the following design tool as used in programming. (i) Data flow diagram (ii) Decision table ()

28. Write a C program that would accept a word and display the length of the word ()

29. Aggie wants to develop an information system for an organization. Explain factors that she could consider when selecting an appropriate language to use for developing the system ()