You are on page 1of 10
FORM TP 2016171 9. 10, [CANDIDAIE=TLENSE NOTES TPRINT your maste 0a the line below aed retur aan rt ese cope 02115010 ——________} MAY/JIUNE 2016 AMINATIONS COUNCIL CARIBBEAN CARIBBEAN ADVANCED PROFICIENCY EXAMINATION* COMPUTER SCIENCE UNIT 1 ~ Paper 01 1 hour 30 minutes (02 JUNE 2016 (a.m.) READ THE FOLLOWING INSTRUCTIONS CAREFULLY. ists of 45 items. You will have | hour and 30 minutes to answer them. tion to this test booklet, you should have an answer sheet. Do not be concemed that the answer sheet provides spaces for more answers than there are items in this tes! Each item in this test has four suggested answers lettered (A), (B). (C). (D). Read each item you are about to answer and decide which choice is best. On sour answer sheet. find the number which 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 Item How many selection lines does an 8 x 1 multiplexer have? ple Answer ‘ar ©©@0 (B) 2 (C) 3 (D) 8 The best answer to this item i so (C) has been shaded, If you want to change your answer, erase it completely before you fill in your new choice. When you are told to begin, turn the page and work as quickly and as carefully as you can. If you cannot answer an item. go on to the next one. You may return to that item later. You may do any rough work in this booklet. Figures are not necessarily drawn to scale The use of silent, non-programmable calculators is allowed. DO NOT TURN THIS PAGE UNTIL YOU ARE TOLD TO DO SO. Copyright © 2015 Caribbean Examinations Council All rights reserved. . O21 1S010/CAPE 2016 1 Which of the following is NOT an advantage of storage devices over main memory? (A) Greater r (B) Larger storage eapacity (©) Less volatitity (D) Greater probability ponse time 6 What is the LARGEST integer that ean be represented in a 4-bit signed magnitude? A) +3 Gy 7 «ch +8 (D) 71S 7. Which of the following CANNOT be accurately represented using 4-bit two's complement notation? (Ay -8 (B) om «cy 7 (D) 8 Which of the following BEST defines the 8. term “clock speed”? (A) The number of clock cycles which ‘occur within a nanosecond (B) The speed at which the micro- processor executes instructions (C) The speed at which the micro- processor transfers data from secondary storage to primary memory (D) The number of bits transferred across a medium in a second The second part of a floating-point representation of a nuinber is called the (A) mantissa (B) multiplier (C) quotient (D) exponential 9 Liem 6 refers to the following compo, eS a computer sy stem 1 ALU we cu IL, Registers IV, RAM Which of the components above does a typical CPU contain? (A) and I only (B) Land If only (©). tland U1 only (D) Lt ttand 1v jonal circuit What is the name of the combi which converts binary information from 1 coded inputs to a maximum of 2° unique outputs? (A) Multiplexer (B) Encoder (C) Decoder (D) Logie gate The 8-bit sign and magnitude representation of a certain number is 10010101 What is the decimal number represented? (A) (B) © (D) The range of instructions that x computer can execute is known as the (A) __ instruction set (B) instruction size (C) executable instructions (D) word 12. Items 10-11 refer to Figure | and Figure 2. A | BIE o 0 0 0 1 0 1 0 0 1 [1 Figure t Figure 2 The truth table in Figure 2 above corresponds to (A) (B) « () a NAND gate an OR gate a NOR gate an AND gate ‘The symbol that should replace the box in Figure 1 is, tO “> 2D (A) (B) «© (D) 1 1 Mn Iv A supermarket uses a stack master file to store the details ofits stock items. Which of the following file access methods is MOST suitable for retrieving a particular stock item from the file? A) (B) ©) (D) Serial Sequential Random Indexed sequential 13. 14, 15. it w-level instructions. item 13 refers o the follow ing program segment witten in low-level instruct LOAD X // load contents of X (o accumulator register add contents of ine to accumulator register STORE X # store contents of accumulator register to X Which address instruction format is used by the computer? (A) Zero address (B) One address (©) Twoaddress (D) Three address Item 14 refers to the following properties. 1. Signal forwarding device I. An electronic pathway along which signals can be sent from one part of a computer to another. II] 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, Which of the following rows in the table shows the BEST match of each word to the given property. as] hak speed | Regier [Mailer i@i ot a] ow vee fe | 1« a | (oO)! ut Tt Vv What is the 8-bit sign and magnitude representation of the decimal number ~29? (Ay oooT0IIT (B) OOOTTIOL (Cc) loorortt (D) 10011 1OT 16. Which of the following algorithms will find the sum of all the even divisors of any positive integer n? 1 sum=0 fori=1ton if (i mod 2 = = 0) sum = sum +i end if end for 18. print sum NB: The mod operator finds the remainder when the first number is divided by the second. u sum=0 while i 19. sum = sum + i ae end while print sum MH. sum =0 n while i> 0 sum = sum +i i end while print sum (A) Lonly (B) Land {only (C) Mand Il only (D) 1, Mand ttt 17. Which ofthe following control structures are 20. used in structured programming? 21. 1. Sequence 1, Assignment 2. I, Selection IV. Iteration (A) 1, land Il only (B) I, Il and LV only (C) Mand IV only (D) 1. land 1V only Items 18-19 refer to the following algorithm, te I While <> 12. do Ill, product =1* 1 WV. print (product) V. I-1+1 VI. Endwhile The algorithm above BEST illustrates an example of using (A) input and output commands (B) _aselection statement (C) test first iteration (D) ‘test last iteration Which of the following BEST describes the type of statement used in line V? (A) Conditional statement (B) Incremental statement (C) Recursion (D) Variable declaration Items 20-22 refer to the following options. (A) Assignment (B) — Unbounded iteration (C) 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. for (i= 0: i i) are{jl = arr{j] +3 while (= getchar()) ! = NO") o- tom 23 refers to the following scenario. Margaret works in the accounting department of a large store. She has to write an algorithm that assigns a discount to products based on the price of the product as follows. Product Price s) | Pent | From 10 to 29 inclusive! 5 | From 30 t0 59 inclusive | 10 [__90orabove = 23. Whichofthe following code segments will assign the discount price to a product for a given product price? (W) if (price > 90) price = price ~ (price * 0.15) else if (price <89 AND price > 60) price = price — (price*0.13) elseif (price <59 AND price > 30) price = price ~ (price*0.10) else if (price <29 AND price > 10) price = price ~ (price*0.05) (ll) if (price > 10) price = price ~ (price * 0.05) else if (price > 30) price = price—(price*0.10) else if (price > 60) price = price ~(price*0.13) else price = price ~(price*0.15) endif end if end if 021 1S010/CAPE 2016 24, 25, (iy if (price > 10) price ~ price -(price*0.05) endit if (price > 30) price=price -(price*0.10) endif if (price > 60) 7 price = price —(price* 0.13) endif ifprice (290) price = price ~ (price*0.15) endif (A) tonly (8) Land Honly (©) Land ll only (D) Wand ish only Items 24-25 are based on the following algorithm total_marks Read mark ‘While mark <> end_of data do {otal_marks = total_marks + mark ‘num _marks = num_marks +1 Read mark Endwhile ayg-mark =total_marks/num_marks Print num-marks, toral_marks, avg_marks Which of the following programming ‘constructs is used in the above algorithm? (A) Selection (B) Bounded iteration (©) Recursion (D) — Unbounded iteration What is the output when the algorithm is executed with the following input values? 45, 56, 79, 84, -1, 76, 31 (A) 4,266, 64 (B) 5,371.92 GO ON TO THE NEXT PAGE 27. NB 28. {tem 26 refers to the following algorithm. j=2 while j < 10 print j > ji endwhile What is the output of the algorithm above? (A) 2468 10 (BR) 2468 («C) 468 10 (D) 4 6 8 10 12 Which of the following ways of representing 29. an algorithm uses standard symbols? (A) Narrative (B) Flowchart (C) _ Pseudocode (D) Program Item 28 refers to the following algorithm. 1 pes 2. x=l 3. while x < 10 AND x> 0 do 4 expo = pow (x, y) 5. print expo 6. 7. Endwhile The function pow raises the first value passed to it by the second value. For example, pow (5, 2) retums the value 25 (5°). ‘What statement can be placed in line 6 to ensure that the while loop terminates? (A) x5 (BR) oxextl (C) Input y (2) = 8 yrx Item 29 refers to the following algorithm written in pseudocode set number to | set counter to 20 do if number % 2 == I print number increment number by 2 while number <= counter NB x %y is the remainder when x is divided by »: What will be printed by the pseudocode above? (Ay 35791113 15 17 19 (Be 3579 1) 3) tole) © (357911 13 ts 17 19 20 (W) 15d 70M eb i) 30, 3h Consider the following three algorithms which will print a sequence of numbers, Looxad while (x « t print the value of x xextd } 5) do We x=3 while (x <4) do { xextl print the value of x } We x= repeat { print the value of x Eek ae & until (¢> 5) Which of the algorithms will print the SAME sequence of numbers? (A) Land I only (B) Land ffl only (C) Sand Ill only (D) 1, Mand tt Which of the following criteria should be considered when choosing a suitable programming language? 1, The nature of the application I The availability of a suitable compiler/interpreter i The expertise of the programmers (A) fand tt only (B) Land 111 only (©) Wand M1 only (D) i. Wand 1 32. 33. 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 Items 33-34 refer to the following code segment where % is the modulus operator. 1. intnum {5} = { 1.9.8.2,10}: M1, intx=num [0]; “intr: IV. int sum =0; V. for (r=0:1< 5; r++) £ Vi. if (num fr] %2 == 0) && (nem[r] x). What value will be stored in the variable sum? (A) 10 (B) 15 (ct (Dy 20 36. 37. O21 SO10/CAl “9 Which of the following allows already tei compiled modules to be combined with the compiled program to generate an excettable Hite? 0 [3] to the following array and code rent where “%" is the modulus operator. ebb tele pr] (A) Translator (B) Linker (©) Compiler int i; Mine | (D) Program for(i=O:i< hin ivl)f Mine 2 int num ~ arr fil; Mine 3 if %2~~0) MLine 4 Items 36-37 refer to the following code print? (“%d", num); Line 5 segment } MLine 6 double num! = 5.6: double num2 = 3. 38, What is printed by the code segment if ine 3: double product = 1.0; 4 is replaced with the line while (product < 50) { printf (“The new product is if (num4%2 != 0) d\n”, product); Line 6: product = product * num2; A 45 4 1 Line 7: } (B) 34-5692 (C) 23 27 56 92 (D) 23 45 27: 1 Which line of the above code se produce a run-time error? 39. What output would you expect from the o! following program? (B) 3 © 5 # include (D) 6 main () { int a, b; Assuming that the error is corrected, how ans many lines of output are produced by the b=10; code segment? printf (“The value of a is %d”, 6); printf (*\n Goodbye”), w 3 } (By 3 «4 (A) The value of ais 10 wm) 50 Goodbye (B) The value of ais 5 \n Goodbye (C) ‘The value ofa is 10 \n Goodbye (D) ‘The value of a is 5 Goodbye GO ON TO THE NEXT PAGE, 40. aL 42. -10- What isthe value of safterthe following code is executed? imt x= 2, int n= 3: while (n> 0) { “1 5 43. “am 4 ®) 8 © (D) 256 Which feature BEST describes why mobile application software could be more attractive then desktop software? (A) Ability to control the level of detail viewed (®) Level or depth of functionality (C) Application level customization (D) Centralized location of software 44. updates ‘Auser wishes to declare a variable in C that can store the square root of an integer. Which ‘of the following is the MOST appropriate declaration? (A) double num: (B) char num [10] 4s. (C) char num; (D) — intnum; END OF T IF YOU FINISH BEFORE TIME IS CALLED, CHEC hu ems 43-44 refer to the following scenario. ‘A text file, dara.ixt. contains several Vines ofdata. A certain program opens follows: FILF *fp = fopen (“data.txt™. Which of the followi file as BEST describes one of the effects of the fopen statement above? (Ay ®) ©) (oy) New data is stored at the end of the file. after all the existing data. New data is stored at the beginning of the file. before all the existing data. Existing data is completely erased and the file will contain only new data 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) (B) ©) @) printf (%d", x): fprintf (fp, “Ped”, x); printf (“data.txt”, “%d", x): fprintt (-%6d". x): 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 errors will your program contain? (A) Syntax (B) Logie © w) YOUR WORK ON THIS TEST.

You might also like