You are on page 1of 11
Testcope02115010 MAY/JUNE2009 ADVANCED PROFICIENCY EXAMINATION COMPUTER SCIENCE - UNIT 1 Paper 01 90 minutes READ THE FOLLOWING INSTRUCTIONS CAREFULLY. 1. Thistest consists of 45 items. You will have 90 minutes to answer them, 2. Inadditiontothistestbooklet, you should have an answer sheet. 3, Eachitem in this testhas four suggested answers lettered (A), (B), (C),(D). Readeach item you are about to answer and decide which choice is best. 4, Onyouranswersheet, find thenumberwhich corresponds to your'item and shade the space having the same letter as the answer you have chosen. Look at the sample item below. sample tem How many selection lines doesan 8x | multiplexerhave? (A) 1 ‘Sample Answer (By) 2 os @Oe@o ‘The best answer to this item is “3”, so answer space (C) has been shaded. Ifyou want to change your answer, be sure to erase it completely and fill in your new choice. 6. When youaretoldtobegin, tum the page and work as quickly andas carefully as youcan. Ifyou cannotanswer an item, omititand go onto the nextone. Your score will be the total number of correct answers. 7. Youmay doany rough workin this booklet. Figures are not necessarily drawn to scale. 9, Theuseofnon-programmable calculatorsisallowed. 10. Donotbeconcemed thatthe answer sheet provides spaces for more answers than there are items inthistest. DO NOT TURN THIS PAGE UNTIL YOU ARE TOLD TO DO SO. Copyright ©2008 Caribbean Examinations Council®. llrightsreserved (02115010/CAPE 2009 4 namovasxiay § ‘What isthe decimal equivalent of 00011001, a) 2 B® 3 © B O % What is the LARGEST integer that can be represented in a 4-bit signed magnitude? a 8 ®) 47 © ©) HS A computer designer wishes to have ready access to instructions which need to be retrieved quickly. Which of the following storage devices accesses information in the FEWEST clock cycles? (A) Hard drive (B) Floppy disk (©) Cache memory (D) Random access memory ‘What device should be used to properly close all open files and log off the computer when there isan electricity outage? (A) Surge protector (B) Voltage regulator (©) PDA (D) UPS Item 5 refers to the following components of ‘computer system, I ALU cu I. Registers IV. RAM Which of the components above does a typical CPU contain? (A) Land Ill only (B) —_LandITonly (©) 1,Mand itt only (D) 1.1L and IV The decode part of the fetch-decode-exeeute cycle ina computer involves (A) finding the location ofan instruction (B) determining what the operands are (©) determining what the operation is (D) extracting the data for the various instruction fields, Which of the following devices is used to store permanent binary information? (A) ROM (B) RAM (© EPROM (D) EEPROM ‘Whats the name of the combinational circuit which converts binary information from rn coded inputs to a maximum of 2° unique outputs? (A) Multiplexer (B) Encoder (©) Decoder (D) LogicGate 10 uw 12. -3- Which of the following functional devices is 13. found ina processor? (a) cpu (B) Harddisk (© Screen (D) Mouse Which ofthe following statements about logic 14. gates are TRUE? 1. A gate isa fundamental building block of a logic circuit I NANDis one of the basic gates used in digital logic TH. Agate can have only one input and only one output 15, IV. A gate can be defined using a truth table (A) Land IV only (B) Land only (©) Land IV only (D) Land IVonly Which of the following statements about fip- flops are TRUE" 1. Flip-flops are examples of defective logic circuits, 16. Il, Flip-flops are two-state devices that can only store 1’sand 0's. MHL Registers are made up of flip-flops. (A) Land only (B) — Tandiifonly (© Mand ftlonly ) 1 Mand.tTonty The range of instructions that a computer can execute is known as the (A) instruction set (B) instruction size (C) executable instructions (D) — wordsize Which of the following components are found in the CPU? (A) ALUand Internal cache (B) ALU, CU and Registers (©) ALU,RAMand Internal cache (D) ALU, Intemal cache and Registers Which of the following computers is the MOST portable? (A) Supercomputer (B) Laptop (© Microcomputer () PDA Alist of computers is given below. List them in order from SMALLEST to LARGEST. I PDA T.— Supercomputer ML Laptop IV. Microcomputer (LIV (B) UHL 1,1V, 11 (© mtv () UL IVn An algorithm refers to (A) a set of coded instructions to be executed (B) _acollection of instructions that the ‘computer can execute (©) a step-by-step solution to solve a specific problem (D)__theoutput ofa program GO ON TO THE NEXT PAGE. Which of the following control structures 22. What does the following algorithm print? can be used when attempting to read data from a file where the number of records is jad not known? while j <10 Print j+2 (A) A for loop (B) A sentinel control loop athe (C) Switch contro structure eee (D) An ‘If..else" control structure (A) 246810 ® 2468 Items 18-20 refer tothe following options. © 46810 © 4681012 (A) Assignment (B) —_Unboundediteration (©) Output 23. Which of the following ways of specifying (D) Bounded iteration an algorithm uses standard symbols? Match EACH item below with ONE of the (A) Narrative ‘options above. Each option may be used more (B)__Flowcharts than once, once or not at all. (C)__ Pseudocode (D) Program 18, 19. 20. 21. while (mark not equal -1) forj=1 to 501 Which algorithm shows the BEST way to print only the LARGER of two unique numbers? (A) WHILE(a>b)DO PRINTa (B) WHILE(a>b)DO PRINT b (©) IF(a) IF(a>b)THEN PRINT b ELSE PRINT a ee Item 24 refers to the following algorithm. Items 25 - 27 are based on the following algorithms. binary (num) TE ae | ALGORITHM | ALGORITHM | ALGORITHM PRINT num 1 Tl ll Ere [x X=2 X=2 an Ge 42) LFOR i= 1 to 500 | REPEAT WHILE X > 75 o_o X=X+1 | X=X+1 X=X+1 se END FOR TONTICX=75 [END WHILE END 25. — Which of the following constructs can be ‘The mod operator finds the remainder when identified in all three algorithms? the first number is divided by the second. Selection TL, Sequencing TI, —Tteration 24, Inthis program calls are made to itself. This isan example of (A) LandIonly (B) Land IlLonly (A) selection (©) Wand Hlonly (B) sequence (D) 1, Mand Itt © iteration (D) recursion 26. Which of the following statements true? (A) The value of X at the end of Algorithm Ill is 77. (B) The viaue of X at the end of Algorithm Il is 77 (©) The value of X at the end of Algorithm IIlis2 (D) The value of X at the end of Algorithm Iis 501 27. Ifthe algorithms were to be arranged such that the values of X are in ascending order after completion, then the order of the algorithms will be (Ut cree © m,L0 © Limo GOON TO THE NEXT PAGE oe 28. Which of the following diagrams contains a “while loop’? ey) @) ‘Velocity = 0.0001 * time? + print velocity time = 0 + compute velocity ¥ print velocity x increment time by 1 © 1 Print “Denominator Close to zero” Fraction = num denominator print fraction () sum=sum=100 |—— print velocity fe GO ONTO THE NEXT PAGE -8- Item 29 refers to the following algorithm written in pseudocode. setmumber to 1 set counter to 20 ifnumber %2 print number increment number by 2 while number <= counter 29. What will be printed by the pseudocode above? (A) 35791113 1517 19 @®) 35791113 15171921 © 1357911 1315171921 @) 13579111315 1719 30. Item 30 refers to the following algorithm which counts and displays the number of votes obtained by 10 candidates in an election. Each vote is input as a number between 1 and 10, corresponding to one of the candidates. Data are terminated by zero. fori=0t0 9 begin {xX} end for read vote while (vote != 0) begin 1Y} read vote end while fori=1t010 print ( “Votes obtained by candidate” +i “is") {Z} end for Which of the following best represents X, Y and Z in the algorithm above? (A) X:amfo]=i Y: arr{vote] = arrfvote - 1] +1 Z: print (ar [i]) B® Xarfo Y: arr [vote -1] = arrfvote ~ 1] + Z: print (arr (i- 1) (©) X:arfij=0 Y: arr [vote -1] = arr [vote - 1] +1 Z: print arr{i-1) (D) X:arrfi]=0 Y: arr [vote] = arr [vote - 1] +1 Z: print (ar [i)) 3. 32. 33. 34, In C, what data type should be used to 35, store a currency value in a program? (A) long (B) double (© integer (D) alphanumeric ‘To execute a computer program written ina high-level language it must be translated into (A) machine language (B) source code (C) assembly language (D) pseudocode What is the correct order of the compilation process for the stages listed below? 1, Syntax analysis Il, Intermediate code generation TI. Semantic analysi IV. Code optimization V. Lexical analysis VI. Code generation @ IsVolomsvovi ®) IsoloVvovov © 19VoiIsioviowv ©) VobMotowvovi 36. Which of the following allows previously compiled modules to be combined with a compiled program to generate an executable file? (A) Linker (B) Translator 37. (©) Compiler (D) Program What are the values of a and b after the following code segment is executed? int temp = baa (A) a= 10andb (B) a=25andb (©) a=25andb (PD) a=10andb=1 and code segment where *%’ is the modulus operator. o 1 2.3 4 5 6 28 [27 [34 156 [192] intis Line 1 for(i=0si<7i=i41){ — /Mine2 int number = arr (i); MiLine3 if((%2==0) Mines printf (‘“%d", number); //Line 5 } Mine 6 ‘What is printed by the code segment above after itis executed?. (A) 34 56 92 @) 23 27 56 92 © 23 45 27 1 (@) 45 34 1 What is printed by the code segment if Line 4 isreplaced with the line if (umber %2! ) (A) 34 56 92 (B) 23 27 56 92 (© 23 45 27 1 () 45 34 1 GOON TO THE NEXT PAGE 38. 39. -10- Harridan needs to write a program to read data from a file called data txt. Which of the following statements would allow his program to open the file for reading? (A) FILE * in= fopen (“data.txt”, (B) _ FILE* in=fopen (“data.txt”); (C)__ FILE * in=fopen (“data.txt”, "read (D) FILE*in; fopen (in, “data.txt”, “t”); Which of the following statements correctly asks the user for an integer and stores the input value in a variable? (A) intnumber=0; printf (“Please enter a number: seanf (“%d”, number); (B) _intnumber=0; printf (“Please enter a number scant (“%d”, &number); (©) intnumber=0; printf (“Please enter a number: seanf (“%1f", & number); (D) _ intnumber=0; printf (“Please enter a number: ” scanf( &number); 40. 41 42. What is the value of x after the following code is executed? intx=2; intn=3; while (n> 0) { n=n-l; I (Ay 4 ®) 8 © @) 256 How many times will the following loop be executed? inty=10; for ( <100;1=1+1) { yryri, printf (“i= %d”, i); 3 (A) Otimes (B) —10times (© 100times (D) — 110times Typically, a variable that is declared in a function is accessible (A) within the whole file (B) within the function and main() only (©) within the function only (D) fromthe calling function 44 Bie Which ofthe following translates the source 45. code of a program, one line ata time? (A) Assembler (B) Interpreter (© Linker ©) Compiler What is the term used for the item x when DEFINING the function, displayData int 3)? (A) Formal parameter (B) Passed parameter (©) Actual parameter (D) Sent parameter You write a program to compute the day of the week on which a given date will fall but forget to consider leap years. Which of the following types of error will your program contain? (A) Syntax (B) Logic (©) Run-time (D) Omission error IF YOU FINISH BEFORE TIME ISCALLED, CHECK YOUR WORK ON THISTEST.

You might also like