Professional Documents
Culture Documents
CAPE Computer Science 2015 U1 P1
CAPE Computer Science 2015 U1 P1
-b
E.
(A) ROM store permanent binary information?
(B) RAM
(c) EEPROM (A) ROM
(D) EPROM (B) RAM
(c) PROM
(D) EPROM
4. What is the 8-bit sign and magnitude
representation of the decimal number - 29? 9. Which of the following statements about
flip-flops are TRUE?
(A) 000r0llr
(B) 0001 r r 0 r I. Flip-flops are examples ofdefective
(c) l00l0rrl logic circuits.
(D) r 00 | l r 0l II. Flip-flops are-two-state devices that
can only store I's and 0's.
III. Registers are made up offlip-flops.
f,. What is the purpose of the fetch part of the
fetch-decode-execute cycle in a computer? (A) I and II only
(B) I and III only
(A) Obtaining an instruction from (C) II and III only
memory (D) I,ll and III
(B) Determining what the operands are
(C) Determining what the operation is
(D) Performing a task to get the results 10. Apopular scheme for representing characters
is
A B F
0 0 0
0 I 0
I 0 0
t I I
Figure I Figure II
pigure
-r>
is
aJ 4J -f)*-
1:- -T)*
4J
I ;] III IV
(A) I
(B) rr
(c) rrr I
(D) rv
I
f
Items 12-13 refer to the fol lowing components. . 14. Which ofthe followingstatements about logic
gates are FALSE?
(A) ALU ?
(A) ALU
(B) CU (A)
(C) Registers
(D) RAM
if a:: b then
print (*Equal")
elseifa>bthen
print ("A is larger")
else
(B)
print ("8 is larger")
End if
.*
(A) A is larger
(B) A is larger
B is larger
(c)
Equal
{cl
(D) B is larger
(D)
i..
ll
I
ll
i!
i
ir
i_
R'
i,
!
i
il
t,
i,
v
r..
t;
;'
.t....
,t:;;
g.
Item lE refers to the:following flowchart Item 23 refers to the following algorithm
symbol. which counts and displays the number
of votes obtained by l0 candidates in an
election. Each vote is input as a number
between I and 10, corresponding to one of
the candidates. Data are terminated bv zero.
(A)
tx)
a decision box end for
(B) an inpuVoutput box read vote
(C) a process box while (vote ! :0) begin
(D) a terminator tY)
read vote
end while
19. Which of the following control structures for i= 1 to l0
can be used when attempting to read data print ( "Votes obtained by
from a file where the number of records is candidate" +i "is")
not known? {z)
end for
(A) A'for" loop
(B) A sentinel control loop
(C) A switch control structure 23. Which of the following BEST represents X,
(D) An "lf.-..else" control structure Y and Zinthe algorithm above?
(A) X: arr[0]: i
Items2h22 refer to the following options. Y: arr[vote] : arr[vote - l] +l
Z: print (an [i])
(A) Assignment
(B) Unbounded iteration (B) X: arr [0]: i
(C) Ouput Y: arr [vote -l] : arr[vote - l] +l
(D) Bounded iteration Z: pfint (an [i - l])
Match EACH item below with ONE of the (C) X: arr [i]: O
options above. Each option may be used Y: arr [vote -l]: arr [vote - l] +l
more than once, once or not at all. Z: print (anli-ll)
(A) *
*:f :f !F*
(B) ***
**
*
(C) **{'***
(D) :F
**
**.*
25. The symbol represented by 'P' can be
replaced with the statement
(A) Read x
(B) Isx<0?
(c) x:2*x
(D) 5*y
(A) 3s79tl l3 ts t7 19
(B) 3s7911 13 15 l7 l9 2l
(c) 13s7e il1315t7t9
(D) t3s79 lt 13 t5 t7 19 2l
35. Which of the following is NOT a valid (c) The value of a is l0 \n Goodbye
identifier for a variable?
(D) The value of a is l0
(A) _hello Goodbye
(B) 2ndmark
(C) marker 2
(D) SUM4
Item 38 refers to the following lines ofcode.
int i, sum;
sum = 5;
Item 36 refers to the code below.
for (i = 4;i> l; i--)
int a, b, c
sum=sum*i;
printf ("sum is Yod",sum);
a: l;
(i= l; i< 5; i+r)
for
a=a* i; 38. What is the output generated when the lines
b=a*5; ofcode are executed?
Error (b) - a value of a wrong type is assigned (A) fp = fprintf ("Yod" , x);
to a constant (B) fprintf (..data.txt'', ..o/od',, x);
(C) Srintf (fp, "%od",x);
- 4L At which stage ofcompilation will errors (a) (D) fprintf ("Zod", x);
and (b) be detected?
(A) (a) lexical (b) syntax 45. You write a program to compute the day of
. (B) (a) syntax (b) lexical the week on which a given date will fall but
(C) (a) semantic (b) code generation forgot to consider leap years. Which of the
(D) (a) lexical (b) semantic following types of errors will your program
contain?
(A) objects
(B) variables
(C) functions
(D) structures
END OF TEST
IF YOU F"INISH BEFORE TIME IS CALLED, CIIE',CK YOUR WORK ON THIS TEST.