You are on page 1of 19

AFFIX SEAL HERE +

Evo must sieni below and return


with the Answer Sheet Failure to do so may TESTCODE reviem disqualification: OD
DOORDVI OD
1
MAY/JUNE 2010

FORM 2010158
Hou.fi mu do voted 1
the
att
man signature de
CARIBBEAN EXAMINATIONS COUNCIL

ADVANCED PROFICIENCY EXAMINATION

COMPUTER SCIENCE - UNIT 1


Paper 01

90 minutes

(03 JUNE 2010 (a.m.)

READ THE FOLLOWING INSTRUCTIONS CAREFULLY.


1.
This test consists of 45 items. You will have 90 minutes to answer them.

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

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

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 8x1 multiplexer have?
AFFIXSEAL HERE

Sample Answer
(A) (B) (C) (D)
12 3 8

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

If you want to change your answer, be sure to erase it completely before you fill
in yournew choice.
When you are told to begin, turn the page and work as quickly and as carefully as you
can. If you cannot answeranitem, omititand go on to the next one. You can return later to the
item omitted. Your
score will be the total number of correct answers. You may
do any rough work in this booklet. Figures are not necessarily drawn to scale.
The useofnon-programmable calculators is allowed.

:: DO NOT TURN THIS PAGE UNTIL YOU ARE TOLD TO


DO SO.
Copyright © 2009 Caribbean Examinations Council®.
All rights reserved.
02115010/CAPE 2010
-2.

6.
What is the 4 bit one's complement representation of 6?
The decode part of the fetch-decode execute cycle in a computer involves

(A)
(A)
finding
(B)
(B)
0110 1010 1001 1011
finding the location of an instruction determining what the operation is
determining what the operands are extracting the data for the various
instruction fields
(D)
.

The decimal equivalent of the ASCII representation of 'A'is 65. What is the ASCII
decimal representation of‘J'?
7.
The second part of a floating-point representation of a number is called the

(A) (B) (C) (D)


74 73 75
mantissa multiplier quotient exponential
-
--

(D)
T

- 8.
Read Only Memory (ROM)
A computer designer wishes to store some instructions which need to be
quickly retrieved. Which of the following is the BEST location to place the
instructions?
V

II. III.
is volatile is programmable is mounted on the mother board holds
instructions for booting up a
computer
(A) (B) (C)
Hard drive Floppy disk Cache memory Random access memory
I and III only III and IV only I, II and IV only II, III and IV only
)
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?
Which of the following statements about logic gates are FALSE?
LEWANDOW

(A)
Surge protector Voltage regulator PDA UPS
(C) (D)
I.
II.
5.
Which of the following devices represent components of a CPU?
m

III.
ANOT gate can have only one input
and only one output. A NOT gate can have one or more
inputs, but only one output. A NOR gate can have only one input
and only one output. A NOR gate can have one or more
inputs, but only one output.
.

ALU
II.
CU
III. IV.
Registers RAM
Nimi

(A)
I and III only I and IV only II and III only II and IV only
(C)
:

I and II only II and III only I, II and III only I, II, III, IV
(B)
-*
..
.
.

GO ON TO THE NEXT PAGE


.-4.
A-------
- NOAA

-3-

Items 10 - 11 refer to Figure 1 and Figure 2.

AI BI F
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 first action is to 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
...
...
..
.

1
1
.

1 Figure 2
... ..

Figure 1
...
.

(A)
.

10.
The truth table in Figure 2 above corresponds
.

to
.

(B)
..

decode the instruction, execute the


instruction, transfer the data. decode the instruction, transfer the
data; execute the instruction, execute the instruction; decode the
instruction, transfer the data. transfer the data; execute the
instruction; decode the instruction.
a NAND gate an OR gate a NOR gate an AND gate
(B) (C) (D)

14.
11.
The symbol that should replace the box in Figure 1 is
A list of computers is given below. List them in order from SMALLEST to
LARGEST.

DDDD
I. II. III. IV.
PDA Supercomputer Laptop Microcomputer

TILE

(A)

(A) (B) (C)


1 II
I, II, III, IV I, III, IV, II III, I, IV, II III, II, IIV

(D)
IV
----

12.
-

The range of instructions that a computer can execute is known as the


-...'
---

(A) (B)
4:

instruction set instruction size executable instructions word size


.
.

GO ON TO THE NEXT PAGE


WW

-4

Item 15 refers to the following statements.


16.
W

Which of the following algorithms will find the sum of all the even
divisors of any positive integer n?
...ITULU

.
I. Retains data when its power supply
is switched off. II. An electronic pathway along which .. signals can be
sent from one part
of a computer to another. III. 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.
--..---...

sum = 0 fori = 1 ton


if (i mod 2 ==0)
sum = sum +i end if end for print sum
-
-
-
--
.
.
.
-
--'N
-
I

NB: The mod operator finds the remainder when the first number is divided by
the
second.
Which of the following rows in the table shows the BEST match of EACH word
to the given statement.
-
--
-
--
-

II.

EPROM
-"
--

Bus Clock speed Register (A) ILI


III II II IV II IV III
sum=0 i=2 while i<=n
sum = sum +i i=i+2 end while print sum
I
'.
'
.':
'

(D) |
III
I
,
TITE

III.
sum=0 i=n while i >0
sum = sum +i
i=i - 2 end while print sum
'

I only I and II only II and III only I, II and III


.

(C) (D)
'
-
'
'.
'
"
"
!!
T
*
-
'
r
'
--
.
-
.
---
.'
"
-
"
----
-
-
-
-
--
-
-
.-
.
--
.--.F
-C-VT NU
I
-

GO ON TO THE NEXT PAGE


-
-
-
-
- -
.
-
-
-
-
-
-

Item 17-19 refer to the following options.


Items 22 - 24 are based on the following algorithms.
(A)
Assignment Unbounded iteration Output Bounded iteration
(C)
(D)
ALGORITHM ALGORITHM ALGORITHM
II
III X = 2
x=2
X = 2 FOR I = 1 to 500 REPEAT WHILE X > 75 1 X = X + 1 X = X + 1 X = X +1 END FOR
UNTIL X = 75 END WHILE
Match EACH item below with ONE of the options above. Each option may be used
more than once, once or not at all.
22.
for (i = 0; i<n; ++i)
Which of the following constructs can be identified in all three algorithms?

arr[j]=arr[j] +3
I. II.
Selection Sequence Iteration
19.
while ((c=getchar()) !=“0')
III.

(A)
Items 20-21 refer to the following algorithm.
I and II only I and III only II and III only I, II and III
(D)
binary (num)
IF (num <= 1) THEN
PRINT num
Which of the following statements is TRUE?
ELSE
binary (num/2) PRINT (num mod 2)
(A)

(B)
END IF
The value of X at the end of
Algorithm III is 2. The value of X at the end of Algorithm II is 77. The value of
X at the end of
Algorithm III is 77. The value of x at the end of
Algorithm Iis 501.
(C)
END
(D)
The mod operator finds the remainder when the first number is divided by the second,

20.
24
In this algorithm, calls are made to itself. This is an example of
If the 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
(A)
selection sequencing iteration recursion
(A)
(D)
I, II, III I, III, II III, I, II III, II, I
)
21.
If the algorithm was called with binary (3), the output would be

(A) (B) (C)


0 1 11
(D)
GO ON TO THE NEXT PAGE
-6.
Item 25 refers to the following information.
(III)
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.
if (price210)
price=price-(price* 0.05)endif if (price230)
price=price- (price*0.10)endif if
(price 60)
price=price- (price* 0.13)endif if price(290)
price=price-(price* 0.15) endif
Product price (S) Discount (%) From 10 to 29 inclusive | 5 .. From 30 to 59
inclusive 10 From 60 to 89 inclusive 13 : 90 or above
15 .

25.
Which of the following code segments will assign the discount price to a product for a given
product price?
I only I and II only I and III only II and III only

(1)
26.
Which of the following steps about program translation is TRUE?
LRT..
.

(A)
-
--

if(price>90)

price = price - (price * 0.15) else if (price<89 AND price260)


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)


Object code + compiler →
source code Object code → interpreter →
source code Source code + compiler → object
code Source code interpreter →
object code
(C)
-.
.

(D)
I

27.
nteri-.

A collection of statements bracketed by is called a


.-
.
L
AU-

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)


(A) (B) (C) (D)
nested statement compound statement conditional statement complex statement
WWww
V

end if
.

end if end if
L
G
-
----

GO ON TO THE NEXT PAGE


- 7
-

Item 28 refers to the following


algorithm.

BEGIN
MAIN

do something (x,
y) IF y = TRUE
THEN do this (x) ELSE
do this (y)

END IF
print
(x)

END
MAIN

28
.
Which flowchart is a correct representation
of this algorithm?

(A)
(B)
Begin
Main
Begin
Main

do something
(x, y)
do something (x, y)
Do this (x)
Do that
(x)

(x =
True
Print
(x)

End Main

End
Main
Do this
(y)]
Do
this
(x)

Begin
Main

(D
)
Begin
Main do something (x, y)
Do this (w) Do that (2)
(Begin
Main do
something
(x, y)
Print
(x)]

y=Tru
e

Do this
(y)]
Do
this (x)

Print
(x)

End
Main
1-1
LL LUI

GO ON TO THE NEXT
PAGE
-8-

Item 29 refers to the following algorithm.


32.
To execute a computer program written in a high-level language it must be
translated into

(A) (B)
BEGIN
x=2 y=6 WHILE Y>x
printy
yuy-2 ENDWHILE print y
object code source code assembly language machine language

Items 33 - 34 refer to the following code segment where % is the modulus operator.
END
29.
Which of the following represents the output of the algorithm?
I. II.
int num[5]={1,9,8,2,11}; intx=num [0]; intr; int sum=0;
III.
IV.
(A) (B)
6,4,2 6,4,4 6,4,2,0 6,4,2,2
V.
for (r=0;r<5;r++) {
,

30.
Which of the following represent(s) the properties of a well-designed algorithm?
VI. if (num [r] %2 = = 0) &&
(num[r]<x) VII. sum=sum+num [r]; VIII. X=num[r];
IX.)
1.
Clearly defined and unambiguous
steps. Finite number of steps. Gives a general solution to the
problem
II. HII.
33.
What is the value of the variable sum when the for loop terminates?

(A)
(B) (C)
>)
I only II only II and III only I, II and III
(A) (B) (C) (D)
0 8 10 14
weLL-LAW

34.
31.
In the programming language C, what data. type should be used to store a
currency value in a program?
Change the if condition in line VI to if (num [r] %2 == 1) && (num [r] >x). What
value will be stored in the variable sum?

(A)
(A)
Long Double : Integer Alphanumeric
GO ON TO THE NEXT PAGE
35.
-9 Which of the following allows already compiled modules to be combined with the
compiled program to generate an executable file?
Item 38 refers to a certain struct which is declared as follows:

struct Record {
int x; int y [5];
(A)
(B)
(C) (D)
Translator Linker Compiler Program
Two variables are then declared as follows:

struct Record record1, record2;


36.
The function of a programming paradigm is
to
Data is then inserted in record1 so that it has the following values:
(A)

(B)

(C)
request the programmer to input
statements provide the view a programmer has
of the program edit the program written by the
programmer change how a programmer sees a
program
Ly
|0
0
0
0
0
1
(D)
38.
Which of the following code segments will result in record2 being an identical copy of
record/?

37.
(A)
Which of the following criteria should be considered when choosing a suitable
programming language?
(B)
(C)
record2 = 0; record2 = recordl; record2.x = record1.x record2.y = record1.y int i;
I.
(D)
The nature of the application The availability of a suitable compiler/
interpreter The expertise of the programmers
III.
record2.[x] = 0; for(i=0; i<5;i++)
record2.[y][i] = 0;

(B)
I and II only I and II only II and III only I, II and III
39.
What is the correct order of the compilation process for the stages listed below?
)

I.
II.
Inter
Syntax analysis Intermediate code generation Semantic analysis Code optimization Lexical
analysis Code generation
IV.
V.

(A) (B)
)
I
I>IVII-III IV-VI
V -III-II-IV-VI V»I>IIIII-IV-VI V>IIIIII-IV-VI
GO ON TO THE NEXT PAGE
www

- 10 -

40.
43.
What is the value of x after the following CODE is executed?
A user wishes to declare a variable in C, which can store the square root of an
integer. Which of the following is the MOST appropriate declaration?
int x=2; int n=3; while (n>0){
x=x* 3; n=n - 1;
w wwwwwwwww

(A)
dan
double num; char num [10] char num; int num;
(C)
(D)
aw
Items 44 - 45 refer to the following scenario.
ලිසුමට
A text file, data.txt contains several lines of data. A certain program opens this file as
follows:
Which of the following is the BEST paradigm to use for calculating the total usage
time for all Internet accounts on a server?
FILE *fp= fopen("data.txt", "w");

44.
(A) (B)
Which of the following BEST describes one of the effects of the fopen statement
above?

(C)
Scripting Functional Procedural Object-oriented
(A)
What is one MAIN reason for the difference in the programming languages for small
mobile devices like mobile phones and desktop computers?
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.
(A)

(B)
45.
Mobile devices are used more than
desktop computers. Mobile devices have better programs
than desktop computers.
· Mobile devices have less memory
and other resources than desktop computers. Mobile devices have a larger
screen
for playing games.
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?
(C)

(D)
(A) (B) (C)
fp = fprintf ("%d", x); fprintf(fp,"%d", x); fprintf ("data.txt", "%d", x); fprintf("%d",
x);

IF YOU FINISH BEFORE TIME IS CALLED,CHECK YOUR WORK


ON THIS TEST.
.:
:'::
.
..
..:...
.'
.
MITTWAMIT THE

02115010/CAPE 2010

You might also like