You are on page 1of 10
2 4 aver sean mere} ‘@ . FORM 2010158 testcope02115010 MAY/UNE2010 ADVANCED PROFICIENCY EXAMINATION COMPUTER SCIENCE - UNIT 1 Paper 01 90 minutes 03 JUNE 2010 (a.m. READ THE FOLLOWING INSTRUCTIONS CAREFULLY. 1, Thistest consists of 45 items. You will have 90 minutes to answer them, 2. Inadditionto this test booklet, you should have an answer sheet. 3. Eachitemin this testhas four suggested answers lettered (A), (B),(C),(D). Readeach item you are about to answer and decide which choice is best. 4, Onyouranswer sheet, find thenumber which corresponds to youritem and shade thespace having the same letteras the answer you have chosen. Look at the sample item below. ‘Sampleltem How many selection lines does an 8x | multiplexerhave? 1 (B) 2 @ 3 ooe ‘The best answer to this item is “3”, so answer space (C) has been shaded. Ifyou wantto change youranswer, be sureto erase it completely before you fillin yournew choice. 6 Whenyouaretoldtobegin, tun the page and work as quickly andas carefully asyoucan. Ifyou cannotansweran item, omit itand goon tothenextone. Youcanretum latertothe item omitted. ‘Your score will be the total number of correct answers. 7. Youmay doany rough work inthis booklet. Figures are notnecessarily drawn to scale. 9, Theuseofnon-programmable calculatorsisallowed. DO NOT TURN THIS PAGE UNTIL YOU ARE TOLD TO DO SO. ‘Copyright© 2009 Caribbean Examinations Council®. llrightsreserved. 02115010/CAPE 2010 4 aimwasxuay 5 1. -2- What is the 4 bit one’s complement representation of 6? (A) 0110 (B) 1010 © 1001 @) 1011 The decimal equivalent of the ASCII representation of *A’is 65. Whatis the ASCII decimal representation of ‘J’? a ® 2 © 5 ©) 10 A computer designer wishes to store some instructions which need to be quickly retrieved. Which ofthe followings the BEST Tocation to place the instructions? (A) Hard drive (B) Floppy disk (©) Cache memory (D) Random access memory A.user wishes to properly close all open files and log off her computer when there is an electricity outage. What device does she need to handle this? (A) Surge protector (B) Voltage regulator © = PDA (D) UPS ‘Which of the following devices represent components ofa CPU? IL ALU 1 cu Ul. Registers IV, RAM (A) Land tonly (B) Mand If only (© Land Ilonly ©) LILULIV 6. The decode part of the fetch-decode- execute cycle in a computer involves (A) finding the location of an instruction (B) determining what the operation is, (©) determining what the operands are (D) extracting the data for the various instruction fields ‘The second part of a floating-point representation of a number is called the (A) mantissa ®) multiplier (©) quotient (D) exponential Read Only Memory (ROM) 1. isvolatile Tl, _isprogrammable III. _ismounted on the mother board TV. holds instructions for booting up a computer (A) Land Ill only (B) Wand IV only (©) 1,MandIV only (D) Th, Mand TV only Which of the following statements about logic gates are FALSE? 1 ANOT gate can have only one input andonly one output. t. ANOT gate can have one or more inputs, bt only one output. UL. A'NOR gate can have only one input and only one output. IV, ANOR gate can have one or more inputs, bat only one output. (A) Tandifonly ®B) —_ LandiVonly (©) Mand only (D) Mand IVonly GO ON TO THE NEXT PAGE 10. i. Usms 10 LL refer to Figure 1 and Figure 2.43, =|-]e]e|> =Jo}-|o}se Figure 1 Figure 2 ‘The truth table in Figure 2 above corresponds to (A) aNAND gate (®B) — anORgate (©) aNOR gate (D) anAND gate 14. ‘The symbol that should replace the box in Figure Lis \_ pT) 12. 7 7 W “mM 1 ® © Ww oO Vv ‘The range of instructions thata computer can execute is known as the (A) instruction set (B) _instructionsize (©) executable instructions (D) word size The CPU deals with each instruction in a cycle. The sequence of instructions to carry ‘out one machine instruction is called the instruction or machine cycle. The firstaction isto fetch the instruction from memory and then the program counter is updated (reset). ‘The other three phases of the machine cycle in the correct order are (A) decode the instruction; execute the instruction; transfer the data, (B) decode the instruction; transfer the data; execute the instruction, (©) __ execute the instruction; decode the instruction; transfer the data, (D) transfer the data; execute the instruction; decode the instruction, Alistofeomputers is given below. List them. in order from SMALLEST to LARGEST. PDA T. —_Supercomputer TH Laptop TV. Microcomputer (A) LILMLIV (BL MLIVI © m,.v0 ©) TM IIIVv GO ON TO THE NEXT PAGE Item 15 refers to the following statements. I. _ Retains data when its power supply is switched off Il, Anelectronie pathway along which signals can be sent from one part ofacomputerto another, Ill, Used to hold the addresses of instructions and data in memory. IV. The frequency with which a processor executes instructions or data that is processed. 15. Which of the following rows in the table shows the BEST match of EACH word to the given statement. 16. Which of the following algorithms will find the sum ofall the even divisors of any positive integer n? 1 end for print sum NB: The mod operator finds the remainder when the first number is divided by the second. T. sum=0 is while i<=n sum=sum +i isi+2 end while print sum MI sum=0 iva whilei> 0 sum = sum +i -2 end while print sum, (A) Tonly (B) Land Ionly (©) Mand If only (D) Land GO ONTO THE NEXT PAGE Item 17-19 refer to the following options. Items 22 - 24 are based on the following algorithms, ‘ALGORITI LGORITHM| ALGORITHM 1 ii u 22. Which of the following constructs can be (A) Assignment (B) —_ Unbounded iteration ©) Output (D) Bounded iteration Match EACH item below with ONE of the options above. Each option may be used more than once, once or not at all. 17. fori=0,i60) price = price —(price*0.13) ‘else if (price= 59 AND price >30) price = price -(price*0.10) else if (price<29 AND price > 10) price = price —(price*0.05) (1) if (price> 10) price = price ~ (price *0.05) elseif ( price > 30) price = price - (price * 0.10) else if (price > 60) price = price —(price *0.13) else price = price - (price *0.15) endif endif endif 26. 27. (UD if (price 10) price=price-(price*0.05)endit if (pricez 30) price=price~(price* 0.10)endif if (price2 60) ptice=price-(price*0.13)endif if price(290) price=price~(price*0.15) endif (A) Tonly (B) Land only (C) Land Il only {D) Wand til only Which of the following steps about program ‘translation is TRUE? (A) Object code -» compiler > source code (B) Object code —> interpreter > source code (C) Source code -» compiler — object code (D) Source code -> interpreter > object code A collection of statements bracketed by {} is called a (A) nested statement (B) compound statement (©) conditional statement (D) complex statement GO ONTO THE NEXT PAGE, Item 28 refers to the following algorithm. BEGIN MAIN THEN do this (x) ELSE do this (») ENDIF paint (x) ENDMAIN 28. Which flowchart is a correct representation of this algorithm? a ® Begin Main do something (x, y)][Do this (x)] [Do that @) [Print 09] o ‘Begin Main ) ‘do something (x) [Do that (©)] [Print @ <>) ‘Main Se something G9) — [Do this @)] [Do this G)] do Se ey oo [Do = @) this @| Print @) GO ONTO THE NEXT PAGE 29, 30, 31. Item 29 refers to the following algorithm. 32. BEGIN WHILE y>x rinty yry-2 ENDWHILE print y END Which of the following represents the output ofthe algorithm? A) 64,2 B) 644 © 6,4,2,0 @) 6,4,2,2 Which of the following represent(s) the properties of a well-designed algorithm? 1. Clearly defined and unambiguous steps. I Finite number of steps. 33, II Gives a general solution to the problem. (A) Tonly (8) only (©). Mand Ionly (DB) 1 Mand 34, In the programming language C, what data type should be used to store a currency value in a program? (A) Long (B) Double (C) Integer (D) Alphanumeric ‘To execute a computer program written ina high-level language it must be translated into (A) objecteode (B) source code (© assembly language (D) machine language ‘Items 33 - 34 refer to the following code segment where % is the modulus operator. 1 intnum{5]={1,9,8,2,11}; I. intx=num (0; I. intr; IV. intsum=0; Ve for(r=0;r x). ‘What value will be stored in the variable sum? A) 10 @®) 15 © 2 @) 2 GO ON TO THE NEXT PAGE 35. 36, 37. -9- Which of the following allows already compiled modules to be combined with the compiled program to generate an executable file? (A) Translator (B) Linker (©) Compiler (D) Program ‘The function ofa programming paradigm is wp (A) request the programmer to input statements (B) provide the view a programmer has ofthe program (©) edit the program written by the programmer (D) change how a programmer sees a program Which of the following criteria should be considered when choosing a suitable programming language? ‘The nature of the application TI. — Theavailability ofa suitable compiler’ interpreter IIL The expertise of the programmers (A) Land only (8) Tandllonly (©) Mand Ifonly (D) 1, Mand Itt 38. 39. tem. 38 refers to a certain struct which is declared as follows: struct Record { intx; inty [5]: h ‘Two variables are then declared as follows: struct Record recordl, record2; Data is then inserted in record so that ithas the following values: Which of the following code segments will result in record2 being an identical copy of record!? (A) record? = 0; (B) record? = recordl; (©) record2.x = record x @) record2.{x] = 0; Whats the correct order of the compilation process for the stages listed below? 1. Syntax analysis Tl, Intermediate code generation TH. Semantic analysis TV. Code optimization V. Lexical analysis VI. Code generation A) VoIsMSIvovt (B) SVoIIsIsiv->vI © VoIsIIsIsvVv1 ©) Vollomlsiovovi GO ONTO THE NEXT PAGE 40. AL. -10- Whatis the value of x afterthe following CODE is executed? intx=25 intn=3; while(n>0) { x=K*3; n=n-1; } “a 3 @®) 6 © 8 ©) 54 ‘Which of the following is the BEST paradigm touse for calculating the total usage time for all Internet accounts on a server? (A) Scripting (B) Functional (©) Procedural @) Object-oriented 42. What is one MAIN reason for the difference inthe programming languages for small mobile devices like mobile phones and desktop computers? (A) Mobile devices are used more than desktop computers. (B) Mobile devices have better programs than desktop computers. © — Mobile devices have less memory and other resources than desktop computers. (D) Mobile deviceshave a larger screen for playing games. 43. 44, 45. Auuser wishes to declare a variable in C, which can store the square root ofan integer. Which of the following is the MOST appropriate declaration? (A) doublemum: B) — charnum [10] (©) charnum; (D) — intnum; Items 44-45 referto the following scenario. A text file, data.tet contains several lines of data, A certain program opens this file as follows FILE “fp = fopen (“data.txt”, “w”); ‘Which of the following BEST describes one of the effects of the fopen statement above? (A) New data is stored at the end of the file, afterall the existing data, (B) New data is stored atthe beginning of the file, before all the existing data, (©) Existing datais completely erased and the file will contain only new data, (D) Existing data in the file is gradually erased to make room for new data. An integer variable, x, has a certain value. Which of the following statements can be used to store the value of x in the file? (A) fp fprintt “%d", x); (B) fprintf (fp, “%d", x); (©) fprintf ¢*data.tat”, “%d", x); (D) — fprintt%d", x); IF YOUFINISH BEFORE TIME ISCALLED, CHECK YOUR WORK ON THISTEST. 02115010/CAPE2010

You might also like