Download as pdf
Download as pdf
You are on page 1of 17
easytvet.com Candidate's Name: Index Number: te of Examination: Candidate's Signatures 0 2920/1038 STRUCTURED PROGRAMMING July 2012 ‘Time: 3 hours KENYA NATIONAL EXAMI ATIONS COUNCIL DIPLOMA IN INFORMATION COMMUNICATION TECHNOLOGY MODULE STRUCTURED PROGRAMMING hours INSTRUCTIONS TO CANDIDATES: Write your name aud index number in the spaces pravidedl eb Sign and write the date af exantinatian in the spaces provided abo FIVE of the following EIGHT questions {11 questions carry equal marks. For Official Use Only Marks This paper consists of 18 printed pages. Candidates should cheek the question paper to ascertain that all the pages are printed as indicated and that no questions are missing. M112 The Kenya Natianeal Examinaions Cauared Farwaver. ta) (b> fe) Ww) 2920/1038 easytvet.com fi) Outline three types of errors that ean occur during program development, (marks) con tS. Mompulatiea..2cers Bathe tt ET osc a logue...00000 (if) Deseribe two hardware requirements necessary for installation of programming software in a computer. 44 marks) With the aid of an example, describe the term escape sequence as used in C programming language (3 marks* ‘Write a Paseal progragp that allows the user to key in am amount @ program should then calculate the equivalent of the amount in either use of functions and eutpat the amount keyed in and dollar or po dollar Kal 80 and | pound Ksh 120. easytvet.com fier as used in programming (1 ae) s 4 7. SONS be bd t7 agit? " ! OMe en t t (bh) (i)_—_Deseribe the term siructure chart as used in program development (2 marks) 2920/103 Turn over (i (i) Joseph would ike t write w program which can read all the records front a text file. State two control structures that he would use to achieve his objective. (i) The f that Follows. = Given that the value of x input from the keyboard is 0, detertaine the expected output after the segment is executed. (3 marks) 2920/1003 easytvet.com (i aC progea c at of number of words per page and Turn over 2920/1038 easytvet.com 2 @® the Lerm syimbatie constant as used in C programming. (1 mark) Ui) Describe each of the following programming design concepts: 1 modula: n (b) 4 marks} {e) ‘With the aid of a flowehart, describe the flow af instruction in a repece until Loop as used in programming 2292/1038 6 easytvet.com 13 for the keybe ores them in an array and then amay to check whet in whether th 2920/03 7 Turn over easytvet.com (mark) © EA (a) Gi) List two examples of frternet based programming languages. Gi) Outline two advantages of compiling a program. (2 marks), {by Explain two flnetions of a user manucal as used in programming. (4 marks) () (i) Differentiate between biaary search and sequential search, (ii) With theaid ofan example; outline the grou Prnmeats Ale ceed to Pascal programming. a dela) 22920103 easytvet.com @ Write a Pasea! ugh the which ones g pproprigte comme: 55 ay ti) 1 following terms-as used in Py (1 mark (1 mark) 2920/1038 % Turn ayer easytvet.com (ii) State the function of the mering} statement as used in C programming . language. (2 marks) thy the result got from each of the follawing pointer arithmetic: i) pt (2 marks} Gi) pet (2 marks (c) ‘The following is a C program. Use it to answer the question that follows. | Lo Sten Identify four errors in the program (4 maths FN Moa lB PMB Be ooo fle. Shel. bee sin. zs. —_ Cse Sagive. od. 2920/1038 10 2920/103 The following y of drive ( easytvet.com represents students marks stored im a text filé named exam located in the ¢ C, Use iL to answer the question that fatlows. Maths Comp Appl OS Total Aver 360 5 Lawrence 4665 % a Pascal program that can read each student record and calculate ach student {8 marks) should then auiput t scores, total and averag u Turn over easytvet.com 6 (a) G)—_-Define each of the following terms as used in progrimming: 1 endless loop: (1 marky H,nested loops (1 mark) I, ranching loop. (1 mark) (ii) (2 marks (b)—Deseribe the t&rm formal parameter as used in programming. (2 marks © @ c would an extreme data be used during program testing, (3 maths 229207103 2 easytvet.com of reserved words in programming languages. Use the list the quest int veal, float, char, Jonginiever, switch, npedef Wy of the words-as either Paseal or C programming reserved word (3 marks} Fl 2 Prsca typedy +S: Poect. pwn Bee, intone Slwlfth

You might also like