<=Back

<=KNEC Craft Certificate in ICT module 2 structured programming past paper: November 2018

The following is a C-segment code statement. Use it to answer the question that follows.
M=2;
N=++m;
(i)Rewrite the segment using the postfix increment statement
(ii)Evaluate the value of m and in (i).

    Viewed:  450  times

  Share in:
        

Question Answer:





Questions List:

1. James, a program designer, would like to develop a program for a client State two non-linear data structure that he could use
2. Outline two benefits that he would realize from using data structures in the program.
3. Describe two items that could be added to program documentation to make the details easy to access.
4. A student wrote a computer program during a programming lesson. Outline three functions the program would be expected to perform
5. Write a program in C programming language that would generate odd numbers from 1 to 9. Use for loop
6. State two examples of each of the following as used in C programming language: i)Logical Operator ii)Relational Operator
7. Differentiate between a modular and bottom up programming approaches.
8. Assuming C programming language, determine the value of x in each of the following expression given that a=20, b=10 and c=2: (4 marks) (i)x=a*(b-2)/sqrt(c+2) (ii)x=2^c+(a+1)*c
9. Ann, a programmer at cymba solutions included a function in a program. Outline four properties that this function should possess
10. Differentiate between linear and binary search techniques
11. The following program segment was created by a student. Use it to answer the question that follows. main() { int n; printf("Enter a number :"); scanf("%d",&n); printf("the resultant of %d is %d\n", n,cube(n)); } cube (int k) { return(k*k*k); } Interpret the program segment.
12. Outline four characteristics of assembly programming language.
13. Write a C program that could read the content “Student details” in a text file named datafile. The program then closes the test file
14. A client approached you to design a program from scratch. State three design tools that you may use
15. Describe two commands that are used with switch statements in a C programming language.
16. Outline two function of a compilers software in structured programming
17. Explain a reason for using each of the following types of test data during program testing i)Real data ii)Exceptional data iii)Dummy data
18. Write a program in C programming language that prompt a user to enter two different integers. The program then compares the numbers and outputs the smallest integer
19. A student would like to add a comment in a program she is creating. Outline three reasons for this.
20. Outline three properties of any array data structure
21. Simple interest (I) accrued when a principal amount (P) is deposited in a bank for a period of time (T) years at rate (R) is given by I=P*T*R . Write a program in C programming language that will prompt a user to enter the principal amount and the number of years. The program should then compute and display the simple interest given that the rate is 10%.
22. Differentiate between runtime error and logical error as used in C programming
23. The following is a C-segment code statement. Use it to answer the question that follows. M=2; N=++m; (i)Rewrite the segment using the postfix increment statement (ii)Evaluate the value of m and in (i).
24. Outline the technique used to access data element in each of the following data structure: (i)Queue ii)Array iii)Stack
25. Outline four rules that should be observed when composing identifiers in a program.
26. Given the following data elements O,T,JW,M,R,K,Z and F. draw a binary tree data structure to store them
27. The following is a C program code created by student. Use it to question that follows: include(iostream> void main[ ] (int I,j; printf “input two non integer”; scanf(“%d%f”,&i.&j); cout(“\n addition=%f subtraction=%d\n* i+j, i-j); } Rewrite the program by correcting the errors
28. Outline three sorting techniques that could be used in C programming language
29. (a)Mercy wrote a C program to compute the value of R in the expression R=(x+y)/(p-q) (i)Explain the type of error that is likely to occur when the value p is equal to the value q. ii)Explain a way in which the error in (i) can be trapped
30. Peter wrote a program using monolithic programming approach. Outline two challenges that he may have encountered as he wrote the program
31. Table 1 shows the criteria used in Maseno college to admit students in various courses use it answer to answer questions that follows. Write a C program that would prompt a user to enter the Grade scored by an applicant. The program then outputs the course the applicant qualifies for.