Sunteți pe pagina 1din 10

~

PRINT your name ()n the line below and return


his booklet with the answer sheet. Failure to do
~o may result in disqualification.
TEST CODE 02115010
FORM TP 2013162 MAY/JUNE 2013
CARIBBEAN EXAMINATIONS COUNCIL
CARIBBEAN ADVANCED PROFICIENCY EXAMINATION
COMPUTER SCIENCE- UNIT 1

Paper 01
1 hour 30 minutes

( 06 JUNE 2013 (a.m.))

READ THE FOLLOWING INSTRUCTIONS CAREFULLY.

1. This test consists of 45 items. You will have 1 hour and 30 minutes to answer them.

2. In addition to this test booklet, you should have an answer sheet.

3. Do not be concerned that the answer sheet provides spaces for more answers than there are items
in this test.

4. 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.

5. On your 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?


Sample Answer

(A) 1
(B) 2
(C) 3
(D) 8

The best answer to this item is "3", so answer (C) has been shaded.

6. If you want to change your answer, erase it completely before you fill in your new choice.

7. 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 this item later. Your score
will be the total number of correct answers.

8. You may do any rough work in this booklet.


-
iiiiiii

--
iiiiiii
9. Figures are not necessarily drawn to scale.

-== 10. The use of silent, non-programmable calculators is allowed.

DO NOT TURN THIS PAGE UNTIL YOU ARE TOLD TO DO SO.

--- Copyright 2011 Caribbean Examinations Council


All rights reserved.
=
02115010/CAPE 2013
-2-

1. What is the longest integer that can be 5. What is the purpose of the fetch part of the
represented in 4-bit sign magnitude? fetch-decode-execute cycle in a computer?

(A) +1 (A) Obtaining an instruction from


(B) +3 memory
(C) +4 (B) Determining what the operands are
(D) +7 (C) Determining what the operation is
(D) Performing a task to get the results

2. What is the 4-bit two's complement of 8?


6. The decode part of the fetch-decode-execute
(A) 0111 cycle in a computer involves
(B) 1010
(C) 1000 (A) finding the location of an instruction
(D) 1011 (B) determining what the operation is
(C) determining what the operands are
(D) extracting the data for the various
3. Which of the following is NOT an advantage instruction fields
of storage devices over main memory?

(A) Greater response time 7. The range of instructions that a computer can
(B) Larger storage capacity execute is known as the
(C) Less volatility
(D) Ability to remove the storage (A) instruction set
medium from the machine for (B) instruction size
archival purposes (C) executable instructions
(D) word size

4. Which of the following BEST defines the


term 'clock speed'? Item 8 refers to Figure 1 and Figure 2.

(A) The number of clock cycles which r------,


occur within a nanosecond I I A B F
A----1 I
(B) The speed at which the micro- 1-- F 0 0 0
?
processor executes instructions I 0 1 0
B----1 I
(C) The speed at which the micro- I 1 0 0
L------...1
processor transfers data from 1 1 1
secondary storage to primary
memory Figure 1 Figure 2
(D) The number of bits transferred
across a medium in a second 8. The truth table in Figure 2 above corresponds
to

(A) a NAND gate


(B) an OR gate
(C) a NOR gate
(D) an AND gate

GO ON TO THE NEXT PAGE


02115010/CAPE 2013
-3-

9. Which of the following about Read Only Items 12-13 refer to the following component.
Memory (ROM) is/are correct?
(A) ALU
I. It is volatile. (B) cu'
II. It is mounted on the mother board. (C) Registers
III. It may hold instructions for booting (D) RAM
up a computer.
Match EACH item below with ONE of the
(A) I only components above. Each option may be
(B) II only used once, more than once, or not at all.
(C) II and III only
(D) I, II and III 12. Which of the components handles statements
like "If x < 0"?

10. The 8-bit sign and magnitude representation


of a certain number is 10010101. 13. Which of the components coordinates the
saving of a file to a hard drive?
What is the decimal number represented?

(A) -12 14. Which of the following statements about logic


(B) -21 gates are FALSE?
(C) 148
(D) 149 I. A NOT gate can have one or more
inputs, but only one output.
II. A NOR gate can have only one
11. Which of the following statements about input and only one output
flip-flops are TRUE? III. A NOR gate can have one or more
inputs, but only one output.
I. Flip-flops are examples of defective
logic circuits. (A) I and II only
II. Flip-flops are two-state devices that (B) I and III only
can only store 1'sand O's. (C) II and III only
III. Registers are made up of flip-flops. (D) I, II and III

(A) I and II only


(B) I and III only
(C) II and III only
(D) I, II and III

GO ON TO THE NEXT PAGE


02115010/CAPE 2013
-4-

Item 15 refers to the following program Item 18 refers to the following flowchart
segment written in low-level instructions. symbol.

LOAD X I I load contents of X to (..___~)


accumulator register

ADD mc I I add contents of inc to 18. The symbol represents


accumulator register
(A) a decision box
STORE X II store contents of accumulator (B) an input/output box
register to X (C) a process box
(D) a terminator
15. Which address instruction format is used by
the computer?
19. Which of the following control structures
(A) Zero address can be used when attempting to read data
(B) One address from a file where the number of records is
(C) Two address not known?
(D) Three address
(A) Afar loop
(B) A sentinel control loop
16. What is a sentinel value in an algorithm? (C) Switch control structure
(D) An 'If.. .. else" control structure
(A) A value which helps to terminate a
loop.
(B) Any input that the users enter.
(C) A print statement.
(D) A control instruction.

17. An assignment statement is used to

(A) perform input in an algorithm


(B) debug an algorithm
(C) set a variable to take the value of
an expression
(D) terminate an algorithm

GO ON TO THE NEXT PAGE


02115010/CAPE 2013
-5-

Item 20 refers to the following information. II. if (price > 10)


price =price- (price * 0.05)
Margaret works in the accounting department
of a large store. She has to write an algorithm else if (price'> 30)
that assigns a discount to products based on price =price- (price * 0.1 0)
the price of the product as follows.
else if (price > 60)
Production prices ($) Discount (%) price= price- (price * 0.13)
From 10 to 29 inclusive 5 else
From 30 to 59 inclusive 10 price= price -(price * 0.15)
From 60 to 89 inclusive 13
end if
90 or above 15
end if
20. Which of the following code segments will
assign the discount price to a product for a
III. if (price >= 10)
given product price?
price= price- (price * 0.05) end if
I. if (price>= 90) if (price>= 30)
price= price- (price* 0.15)
price =price- (price*O.l 0) end if
else if (price>= 60)
if (price >= 60)
price= price- (price*0.13) price= price- (price*0.13) end if
else if (price>= 30) if price>= 90)
price =price- (price*0.1 0) price =price- (price*0.15) end if
else if (price>= 10) end if
price= price- (price*0.05)
(A) I only
(B) II only
end if (C) I and III only
(D) II and III only

GO ON TO THE NEXT PAGE


02115010/CAPE 2013
-6-

21. Which of the following represent(s) the Items 24-25 are based on the algorithm
properties of a well-designed algorithm? below.

I. Clearly defined and unambiguous total-marks= 0


steps. num-marks = 0
II. Finite number of steps. end-of-data= -1
III. Gives a general solution to the Read mark
problem. While mark < > end-of-data do
total-marks =total-marks+ mark
(A) I only num-marks = num-marks + 1
(B) II only Read mark
(C) II and III only Endwhile
(D) I, II and III avg-mark=total-marks/num-marks
Print num-marks, total-marks,
avg-marks
Items 22-23 refer to the following options.

(A) Assignment 24. Which of the following programming


(B) Unbounded iteration constructs is used in the above algorithm?
(C) Output
(D) Bounded iteration (A) Selection
(B) Bounded iteration
Match EACH item below with ONE of the (C) Recursion
options above. Each option may be used (D) Unbounded iteration
more than once, once or not at all.

22. for (i = 0; i < n; ++ i) 25. What is the output when the algorithm is
executed with the following input values?
23. arr[j] = arr[j] + 3
45,56, 79, 84,-1, 76,31

(A) 4, 266, 64
(B) 5, 371, 92
(C) 4,264,66
(D) 5, 370, 93

GO ON TO THE NEXT PAGE


02115010/CAPE 2013
-7-

Item 26 refers to the following algorithms. Item 29 refers to the following algorithm
written in pseudocode.
ALGORITHM ALGORITHM ALGORITHM
I II III set number to 1
X=2 X=2 X=2 set counter to 20
FOR i = 1 to 500 REPEAT WHILEX>75 do
if number% 2 == 1
X=X+ 1 X=X+ 1 X =X+ 1 print number
END FOR UNTIL X= 75 END WHILE
end if
increment number by 2
26. If the algorithms were to be arranged such that while number <= counter
the values of X are in ascending order after
completion, then the order of the algorithms NB x % y is the remainder when x is
will be
divided by y.

(A) I, II, III 29. Which of the following will be printed by the
(B) I, III, II pseudocode above?
(C) III, I, II
(D) III, II, I (A) 3 5 7 9 11 13 15 17 19
(B) 3 5 7 9 11 13 15 17 19 21
(C) 1 3 5 7 9 11 13 15 17 19 21
Items 27-28 refer to the following algorithm. (D) 1 3 5 7 9 11 13 15 17 19

num= 1
30. Consider the following three algorithms
n=O
which will print a sequence of numbers.
WHILEn< 5 do
num=num+n l. X= 4
n=n+2 while (x < 5) do
PRINTnum print the value of x
END WHILE x=x+1
end while
27. What is the output produced by the algorithm?
II. X= 3
(A) 2 3 while (x < 4) do
(B) 1 2 4 x=x+l
(C) 1 3 7 print the value of x
(D) 1 3 5 end while

III. X= 4
28. What is the output produced by the algorithm repeat
if n is initialised to 1 and num is initialised print the value of x
to 5? x=x+l

(A) 5 8 until (x > 5)


(B) 6 8
Which of the algorithms will print the SAME
(C) 6 9
sequence of numbers?
(D) 5 9
(A) I and II only
(B) I and III only
(C) II and Ill only
(D) I, II and III
GO ON TO THE NEXT PAGE
02115010/CAPE 2013
-8-

31. Which of the following criteria should 34. Which of the following statements is/are
be considered when choosing a suitable TRUE about indentation?
programming language?
I. Indentation is a requirement of most
I. The nature of the application programming languages.
II. The availability of a suitable II. Every indent in a single program
compiler/interpreter must be of the same size.
III. The expertise of the programmers III. Indentation enhances the readability
of a program.
(A) I only IV. Poor indentation is a type of semantic
(B) I and II only error.
(C) II and III only
(D) I, II and III (A) III only
(B) II and III only
(C) II, III and IV only
32. A programming paradigm that models real (D) I, II, III and IV
world entities with attributes and behaviours
IS
Item 35 refers to the following lines of code.
(A) procedural
(B) functional int 1Osum, sum, i;
(C) object-oriented sum= 10;
(D) scripting lOsum = 0;
for (i = 9; i > 0; i - -)
{
33. To execute a computer program written in a sum= sum+ i;
high-level language it must be converted into lOsum = 10sum + 10;
}
(A) object code printf ("The sum is %d", i);
(B) source code
(C) assembly language 35. Which of the following identifies a syntax
(D) machine language error in the code?

(A) 1Osum, because it is not a valid


identifier

(B) sum= 10, because sum should be


intialised to 0

(C) for (i = 9; i > 0; i- -),because i- - is


an invalid re-initialisation step

(D) printf("The sum is %d", i), because


sum should be printed instead

GO ON TO THE ~EXT PAGE


02115010/CAPE 2013
-9-

36. Which of the following code segments reads 37. What is the correct order of the compilation
5 integers into an array? process for the stages listed below?

(A) int main ( ) { I. Syntax analysis


int arr [5]; II. Intermediate code generation
printf ("Please enter a#"); III. Semantic analysis
scanf ("%d", &arr [5]); IV. Code optimization
return 0; v. Lexical analysis
} VI. Code generation

(B) int main ( ){ (A) I ----+ IV ----+ II ----+ III ----+ IV ----+ VI
int num, arr [5]; (B) I ----+ V ----+ III ----+ II ---+ IV ----+ VI
for (num = 4; num >= 0; num--) { (C) V ~ I ----+ III ----+ II ---+ IV ----+ VI
printf ("Please enter a #"); (D) V ---+ II ----+ III ---+ I ----+ IV ----+ VI
scanf ("%d", &arr [num]);
}
Item 38 refers to the following lines of code.
return 0;
}
inti, sum;
sum= 5;
(C) int main ( ) {
for (i = 4; i > 1; i--)
int num = 5, arr [5];
sum= sum+ i;
while (num <= 5) {
printf ("sum is %d", sum);
printf ("Please enter a#");
scanf ("%d", &arr [num]);
38. What is the output generated when the lines
num++;
of code are executed?
}
return 0;
(A) Sum is 5
}
(B) Sum is 14
(C) Sum is 15
(D) int main ( ) {
int num;
(D) Nothing is generated.
int arr;
for (num = 0; num < =5; num++) {
39. Typically, a variable that is declared in a
printf ("Please enter a #");
function is accessible
scanf ("%d", arr [num]);
}
(A) within the whole file
return 0;
}
(B) within the function and main ( )
only
(C) from the calling function
(D) within the function only

GO ON TO THE NEXT PAGE


02115010/CAPE 2013
------------------------..----------------------------

- 10-

Items 40-41 refer to the following array 42. The MAIN reason for the differences in the
and code segment where'%' is the modulus programming software for small mobile
operator. devices like mobile phones versus those for
desktop computers is that mobile devices
0 1 2 3 4 5 6
23 45 27 34 56 92 (A) are used more than desktop
computers.
inti; //Line 1 (B) have better programs than desktop
for(i=O;i<7;i=i+l) { //Line 2 computers.
int num = arr [i]; //Line 3 (C) have less memory and other
if(i% 2 = = 0) //Line 4 resources than desktop computers.
printf ( "%d", num); //Line 5 (D) have a larger screen for playing
games.
} //Line 6

40. What is printed by the code segment above 43. Which of the following translates the source
after it is executed?. code of a program, one line at a time?

(A) 34 56 92 (A) Assembler


(B) 23 27 56 92 (B) Interpreter
(C) 23 45 27 1 (C) Linker
(D) 45 34 1 (D) Compiler

41. What is printed by the code segment if 44. The name given to the variable x when
Line 4 is replaced with the line DEFINING the function, displayData (int x)
lS

if(number %2 != 0)
(A) formal parameter
(A) 34 56 92 (B) passed parameter
(B) 23 27 56 92 (C) actual parameter
(C) 23 45 27 1 (D) sent parameter
(D) 45 34 1

45. 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 type of error will your program
contain?

(A) Syntax
(B) Logic
(C) Run-time
(D) Omission error

ENDOFTEST

IF YOU FINISH BEFORE TIME IS CALLED, CHECK YOUR WORK ON THIS TEST.

02115010/CAPE 2013

S-ar putea să vă placă și