KNEC diploma in ICT module 1 structured programming past paper:July 2017 Answers

Answered and verified

Course Name:  Information and Communication Technology
Also Done By:
NA
Course Level:  Diploma
Sub Level:       Module I
Course Unit:   Structured Programming
Exam body:    KNEC

Share with Friends:
        
Go Back



1. Explain one disadvantage of using go to statement in a program ()

2. Distinguish between procedural and visual programming ()

3. A student would like to write a program that could compute and display the average of 10 integers entered through the keyboard one at a time. Use a flow chart to design the program ()

4. Assuming Pascal programming language, evaluate the expression; Z=a + b mod c *(d^2) Given that a = 10, b =23, c = 7 and d = 5. ()

5. 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 ()

6. Outline the function of preprocessor directives in C programming language ()

7. Explain one type of error that may be encountered during program execution ()

8. Write a program in Pascal language that would create a text tile, write some text into the file and then close the file ()

9. Write a program in Pascal language that could be used to store in a record; admission number, name, gender and age of two students ()

10. State two floating data types and their storage sizes as used in C programming language ()

11. Define a pointer as used in Pascal programming language ()

12. Distinguish between register and static storages as used in C programming language ()

13. Write a program in C programming language that would prompt a user to enter an integer. The program should then check whether the integer entered is a prime number and output the result ()

14. A program is required to prompt a user to enter two non-zero integers. The program then checks and outputs the larger integer. (i)Write a pseudocode to represent the program logic ii)Write a program in Pascal programming language to implement the logic ()

15. Outline three circumstances that would make a programmer to use a compiler during program writing ()

16. Describe three types of operators used in C programming language ()

17. The following program was created by a student during a programming lesson. Use it to answer the question that follows. (4 marks) # include<stdio.h> main ( ) { int a =0; int b=15; int c; if (a && b) { printf (“Line 1-condition is true\n”) } if( a || b) { printf (“Line 1-condition is true\n”) } } Interpret the program ()

18. Outline two uses of comments in Pascal programming language ()

19. A newly constructed computer lab is 15 meters long and 10 meters wide. The lab is to be fitted with floor tiles. Write a program in Pascal programming language that prompts a user to enter the length and width of the lab. The program then computes the number of tiles required. One tile has an area of #0.36M^2# ()

20. Outline two reasons why program documentation is important ()

21. Explain three types of program testing ()

22. Write an algorithm that may be used to remove an item from a queue ()

23. Differentiate between procedure and function as used in Pascal programming language ()

24. Write a program in C programming language that computes the sum of even numbers between 44 and 100 and output the result. Use for loop ()

25. Outline two advantages of modular programming approach ()

26. Given data items: 56, 64, 40, 59, 34, 72 and 47. I. Construct a binary tree II. State the degree of the binary tree constructed in I. ()

27. Outline three tree data structure traversals as used in programming ()

28. A newly established bank converts Kenya shillings to US dollars at the rate of 1 US dollar 102 Kenya shillings. Write a program in C programming language that prompts a user to enter the currency either Ksh or USD. The program then outputs the equivalent amount. Use functions ()

29. Write a program in Pascal programming language that prompts a user to enter a string of characters. The program then outputs the number of characters in the string ()

30. Distinguish between pre-increment and post-increment as used in C programming language ()

31. Define quick sort as used in programming ()

32. Explain two techniques that could be used to find an item in an ordered list ()

33. Distinguish between actual and formal parameters as used in programming ()

34. A student created a program to implement stack data structure. When he executed the program an "underflow error message" was displayed. Outline a possible cause for this error ()

35. Write a program in C programming language that would initialize the values 34, 40, 45, 48 and 53 in an array and get their sum ()

36. Table 1 shows the criteria used by the national government to allocate bursaries to college students. Use it to answer the question that follows. Write a program in Pascal programming that would prompt a user to enter student category. The program then outputs the corresponding amount. Use case statement ()