Vous êtes sur la page 1sur 32

CARIBBEAN E XAM I NAT I O N S COUNCIL

CARIBBEAN ADVANCED PROFICIENCY EXAMINATION

*Barcode Area*
Front Page Bar Code
13 MAY 2016 (a.m.)

FILL IN ALL THE INFORMATION REQUESTED CLEARLY IN CAPITAL LETTERS.

TEST CODE 0 2 1 1 5 0 2 0

SUBJECT COMPUTER SCIENCE UNIT 1 Paper 02

PROFICIENCY ADVANCED

REGISTRATION NUMBER

SCHOOL/CENTRE NUMBER

NAME OF SCHOOL/CENTRE

CANDIDATES FULL NAME (FIRST, MIDDLE, LAST)


*Barcode Area*
Current Bar Code

DATE OF BIRTH D D M M Y Y Y Y

SIGNATURE __________________________________________________
DO
NO
W T
RI
TE
TH ON
IS
PA
G E
TEST CODE 02115020
FORM TP 2016175 MAY/JUNE 2016

CARIBBEAN E XAM I NAT I O N S COUNCIL

CARIBBEAN ADVANCED PROFICIENCY EXAMINATION

COMPUTER SCIENCE

FUNDAMENTALS OF COMPUTER SCIENCE

UNIT 1 Paper 02

2 hours 30 minutes

READ THE FOLLOWING INSTRUCTIONS CAREFULLY.

1. This paper consists of SIX questions. Answer ALL questions.

2. Write your answers in the spaces provided in this booklet.

3. Do NOT write in the margins.

4. If you need to rewrite any answer and there is not enough space to do so on the
original page, you must use the extra lined page(s) provided at the back of this
booklet. Remember to draw a line through your original answer.

5. If you use the extra page(s) you MUST write the question number clearly in
the box provided at the top of the extra page(s) and, where relevant, include
the question part beside the answer.

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

Copyright 2015 Caribbean Examinations Council


All rights reserved.
*Barcode Area*
02115020/CAPE 2016 Sequential Bar Code
-4-

DO NOT WRITE IN THIS AREADO NOT WRITE IN THIS AREADO NOT WRITE IN THIS AREA
SECTION A

COMPUTER ARCHITECTURE AND ORGANIZATION

Answer BOTH questions.

1. (a) The logic circuit in Figure 1 refers to a system of three switches, A, B and C. The
combination of switches illustrated below determines whether a bell, X, sounds.

Figure 1

In the space below, construct the truth table for the circuit in Figure 1.


[4 marks]

GO ON TO THE NEXT PAGE


02115020/CAPE 2016
*Barcode Area*
Sequential Bar Code
-5-
DO NOT WRITE IN THIS AREADO NOT WRITE IN THIS AREADO NOT WRITE IN THIS AREA

(b) In the space below, construct a truth table for the proposition P Q.


[4 marks]

(c) What is a program counter?

..............................................................................................................................................

..............................................................................................................................................

..............................................................................................................................................

..............................................................................................................................................
[2 marks]

GO ON TO THE NEXT PAGE


02115020/CAPE 2016
*Barcode Area*
Sequential Bar Code
-6-

DO NOT WRITE IN THIS AREADO NOT WRITE IN THIS AREADO NOT WRITE IN THIS AREA
(d) Below are two 8-bit binary numbers which are stored in Registers 1 and 2 respectively.
When the numbers are added, the result is stored in an 8-bit register, Register 3.

Add the two numbers and explain what will be stored in Register 3. Show ALL working.

Register 1 = 10010111
Register 2 = 11011000
Register 3 = ________

..............................................................................................................................................

..............................................................................................................................................

..............................................................................................................................................

..............................................................................................................................................

..............................................................................................................................................

..............................................................................................................................................

..............................................................................................................................................

..............................................................................................................................................
[4 marks]

(e) Convert the decimal number 13.25 to binary. Show ALL working.

..............................................................................................................................................

..............................................................................................................................................

..............................................................................................................................................

..............................................................................................................................................

..............................................................................................................................................

..............................................................................................................................................
[3 marks]

GO ON TO THE NEXT PAGE


02115020/CAPE 2016
*Barcode Area*
Sequential Bar Code
-7-
DO NOT WRITE IN THIS AREADO NOT WRITE IN THIS AREADO NOT WRITE IN THIS AREA

(f) What is a multiplexor. In the space provided below, draw a block diagram to support
your answer.

..............................................................................................................................................

..............................................................................................................................................

..............................................................................................................................................

..............................................................................................................................................


[4 marks]

(g) Why is multiplexing important? Provide a scenario to support your answer.

..............................................................................................................................................

..............................................................................................................................................

..............................................................................................................................................

..............................................................................................................................................

..............................................................................................................................................

..............................................................................................................................................
[4 marks]

Total 25 marks
GO ON TO THE NEXT PAGE
02115020/CAPE 2016
*Barcode Area*
Sequential Bar Code
-8-

DO NOT WRITE IN THIS AREADO NOT WRITE IN THIS AREADO NOT WRITE IN THIS AREA
2. (a) Figure 2 shows the basic hierarchy of computer memory. It requires four examples of
specific types of memory for completeness.

Figure 2

Provide ONE example for EACH of the missing entries labelled 1, 2, 3 and 4.

..............................................................................................................................................

..............................................................................................................................................

..............................................................................................................................................

..............................................................................................................................................
[4 marks]

GO ON TO THE NEXT PAGE


02115020/CAPE 2016
*Barcode Area*
Sequential Bar Code
-9-
DO NOT WRITE IN THIS AREADO NOT WRITE IN THIS AREADO NOT WRITE IN THIS AREA

(b) Imagine that electricity is available but is not consistently supplied in your community.
You have just purchased a cellphone which gives 10 hours of battery power and takes
5 to 7 hours to become fully charged if not in constant use.

Clearly explain the purpose and core benefit that EACH of the following devices will yield
in this scenario.

(i) Surge protector

....................................................................................................................................

....................................................................................................................................

....................................................................................................................................
[2 marks]

(ii) Voltage regulator

....................................................................................................................................

....................................................................................................................................

....................................................................................................................................
[2 marks]

(iii) UPS

....................................................................................................................................

....................................................................................................................................

....................................................................................................................................
[2 marks]

(c) Define the term clock speed as it relates to a processor. Give TWO examples of CPU
clock speeds using different units of measure.

..............................................................................................................................................

..............................................................................................................................................

..............................................................................................................................................

..............................................................................................................................................

..............................................................................................................................................

..............................................................................................................................................
[3 marks]
GO ON TO THE NEXT PAGE
02115020/CAPE 2016
*Barcode Area*
Sequential Bar Code
- 10 -

DO NOT WRITE IN THIS AREADO NOT WRITE IN THIS AREADO NOT WRITE IN THIS AREA
(d) Describe ONE input device and ONE output device that could be used by a person who
is visually impaired.

..............................................................................................................................................

..............................................................................................................................................

..............................................................................................................................................

..............................................................................................................................................

..............................................................................................................................................

..............................................................................................................................................

..............................................................................................................................................

..............................................................................................................................................
[4 marks]

(e) Explain the main difference between a supercomputer and a mainframe computer.
Provide TWO examples of how EACH type of computer is used.

..............................................................................................................................................

..............................................................................................................................................

..............................................................................................................................................

..............................................................................................................................................

..............................................................................................................................................

..............................................................................................................................................

..............................................................................................................................................

..............................................................................................................................................
[5 marks]

GO ON TO THE NEXT PAGE


02115020/CAPE 2016
*Barcode Area*
Sequential Bar Code
- 11 -
DO NOT WRITE IN THIS AREADO NOT WRITE IN THIS AREADO NOT WRITE IN THIS AREA

(f) There are several types of instructions which can be performed by the processor. Write
a set of instructions to perform a mathematical calculation. Include THREE different
instructions in your answer.

..............................................................................................................................................

..............................................................................................................................................

..............................................................................................................................................

..............................................................................................................................................

..............................................................................................................................................

..............................................................................................................................................
[3 marks]

Total 25 marks

GO ON TO THE NEXT PAGE


02115020/CAPE 2016
*Barcode Area*
Sequential Bar Code
- 12 -

DO NOT WRITE IN THIS AREADO NOT WRITE IN THIS AREADO NOT WRITE IN THIS AREA
SECTION B

PROBLEM SOLVING WITH COMPUTERS

Answer BOTH questions.

3. (a) At a library, a set of data representing outstanding customer balances exist. Each line
consists of a customers id (integer), followed by the number of books outstanding (integer)
and the rate at which fines are charged (character). If the fines rate is P, the customer
pays $4.50 for each overdue book. If the fines rate is N, the customer pays $6.50 for each
overdue book. The last line contains 9999 only. Assume all data are valid.

Sample Data:

2000 5 P
1534 6 N
2311 10 P
9999

In the space provided on page 13, write an algorithm to read the data and determine the
following:

The total outstanding fines for each customer


The total amount of fines paid under each of the categories, N and P
The total amount of fines paid overall
The number of customers
The customer id for the highest fine paid (ignore ties)

GO ON TO THE NEXT PAGE


02115020/CAPE 2016
*Barcode Area*
Sequential Bar Code
- 13 -
DO NOT WRITE IN THIS AREADO NOT WRITE IN THIS AREADO NOT WRITE IN THIS AREA

[15 marks]

GO ON TO THE NEXT PAGE


02115020/CAPE 2016
*Barcode Area*
Sequential Bar Code
- 14 -

DO NOT WRITE IN THIS AREADO NOT WRITE IN THIS AREADO NOT WRITE IN THIS AREA
(b) Distinguish between bounded iteration and unbounded iteration.

..............................................................................................................................................

..............................................................................................................................................

..............................................................................................................................................

..............................................................................................................................................

..............................................................................................................................................

..............................................................................................................................................
[4 marks]

(c) Write an algorithm to find the sum of all multiples of 7 between 21 and 210 (inclusive).

..............................................................................................................................................

..............................................................................................................................................

..............................................................................................................................................

..............................................................................................................................................

..............................................................................................................................................

..............................................................................................................................................

..............................................................................................................................................

..............................................................................................................................................
[6 marks]

Total 25 marks

GO ON TO THE NEXT PAGE


02115020/CAPE 2016
*Barcode Area*
Sequential Bar Code
- 15 -
DO NOT WRITE IN THIS AREADO NOT WRITE IN THIS AREADO NOT WRITE IN THIS AREA

NOTHING HAS BEEN OMITETED

GO ON TO THE NEXT PAGE


02115020/CAPE 2016
*Barcode Area*
Sequential Bar Code
- 16 -

DO NOT WRITE IN THIS AREADO NOT WRITE IN THIS AREADO NOT WRITE IN THIS AREA
4. (a) In the space provided on page 17, construct a flowchart to represent the following algorithm.

read name
if name = enddata
print No data supplied.
else
while name <> enddata
read amt
read quan
sale = amt * quan
print This sale = , sale
read name
endwhile
endif

GO ON TO THE NEXT PAGE


02115020/CAPE 2016
*Barcode Area*
Sequential Bar Code
- 17 -
DO NOT WRITE IN THIS AREADO NOT WRITE IN THIS AREADO NOT WRITE IN THIS AREA

[11 marks]

GO ON TO THE NEXT PAGE


02115020/CAPE 2016
*Barcode Area*
Sequential Bar Code
- 18 -

DO NOT WRITE IN THIS AREADO NOT WRITE IN THIS AREADO NOT WRITE IN THIS AREA
(b) A communications company provides the following rates for telephone calls.

First 20 minutes $1.25 per minute


Any additional minutes $0.25 per minute

Write an algorithm that reads an integer value representing the amount of minutes for a
call and calculates and prints the cost of the call.

..............................................................................................................................................

..............................................................................................................................................

..............................................................................................................................................

..............................................................................................................................................

..............................................................................................................................................

..............................................................................................................................................

..............................................................................................................................................

..............................................................................................................................................
[6 marks]

GO ON TO THE NEXT PAGE


02115020/CAPE 2016
*Barcode Area*
Sequential Bar Code
- 19 -
DO NOT WRITE IN THIS AREADO NOT WRITE IN THIS AREADO NOT WRITE IN THIS AREA

(c) A company called ExcelCo sells used video games and wishes to acquire software to track
purchases, customer information and the quantities of video games in stock. The company
has contracted the services of a software company called SoftwarePlus that writes software
applications.

Briefly describe any FOUR stages that SoftwarePlus would generally follow when creating
the software for ExcelCo.

..............................................................................................................................................

..............................................................................................................................................

..............................................................................................................................................

..............................................................................................................................................

..............................................................................................................................................

..............................................................................................................................................

..............................................................................................................................................

..............................................................................................................................................
[8 marks]

Total 25 marks

GO ON TO THE NEXT PAGE


02115020/CAPE 2016
*Barcode Area*
Sequential Bar Code
- 20 -

DO NOT WRITE IN THIS AREADO NOT WRITE IN THIS AREADO NOT WRITE IN THIS AREA
SECTION C

PROGRAMMING

Answer BOTH questions.



5. (a) A certain computer program simulates a simple guessing game. First the program generates
a random number between 1 and 10 (inclusive), then the user tries to guess this number by
entering an integer. The user continues to enter integers until the number generated and
the number guessed are the same. When the numbers are the same the program notifies
the user and prints a count of the numbers the user guessed before correctly guessing the
random number.

In the space provided on page 21, write a C program which will simulate this guessing
game. The following line of code will generate a random number between 1 and 10
(inclusive). You may use the following line of code in your program.

int r = rand() % 10 + 1; // random number generator


GO ON TO THE NEXT PAGE


02115020/CAPE 2016
*Barcode Area*
Sequential Bar Code
- 21 -
DO NOT WRITE IN THIS AREADO NOT WRITE IN THIS AREADO NOT WRITE IN THIS AREA

[12 marks]

GO ON TO THE NEXT PAGE


02115020/CAPE 2016
*Barcode Area*
Sequential Bar Code
- 22 -

DO NOT WRITE IN THIS AREADO NOT WRITE IN THIS AREADO NOT WRITE IN THIS AREA
(b) This question is related to various programming paradigms.

(i) What is a procedural language?

....................................................................................................................................

....................................................................................................................................
[1 mark]

(ii) What is an object oriented language?

....................................................................................................................................

....................................................................................................................................

....................................................................................................................................

....................................................................................................................................
[2 marks]

(c) You have been commissioned to assist with the development of an application to keep track
of district details for an upcoming general election. The data file, constituency.txt, stores
the following district details ID, name, population count and the number of eligible
voters. The format for this file is shown in Figure 3 below. Data is terminated by a line
containing the characters XX only.

A1 Kingstown 5000 3500


A2 Port of Spain 9000 7245
A3 Castries 6000 4000
B1 St Catherine 3500 2000
C8 St Joseph 2200 1500
XX

Figure 3

In the space provided on page 23, write C code which will

read in data from the file


count the total number of districts recorded
find the district with the highest number of eligible voters.

GO ON TO THE NEXT PAGE


02115020/CAPE 2016
*Barcode Area*
Sequential Bar Code
- 23 -
DO NOT WRITE IN THIS AREADO NOT WRITE IN THIS AREADO NOT WRITE IN THIS AREA

[10 marks]

Total 25 marks

GO ON TO THE NEXT PAGE


02115020/CAPE 2016
*Barcode Area*
Sequential Bar Code
- 24 -

DO NOT WRITE IN THIS AREADO NOT WRITE IN THIS AREADO NOT WRITE IN THIS AREA
6. (a) State THREE ways in which an application for a mobile device may differ from an
application for a desktop computer.

..............................................................................................................................................

..............................................................................................................................................

..............................................................................................................................................

..............................................................................................................................................

..............................................................................................................................................

..............................................................................................................................................
[3 marks]

(b) What output is produced by the following C code?

#include <stdio.h>

int test (int b, int c, int a) {


return (c + a);
}
int main ()
{ int a = 1, b = 2, c = 3;
while (a <= 10) {
for (b = c; b <= 7; b = b+ 2) {
a = test(a, b, c);
printf(a is %d b is %d c is %d\n,a, b, c);
a++;
c--;
} //for
a = a + 2;
}//while
return 0;
}//main

..............................................................................................................................................

..............................................................................................................................................

..............................................................................................................................................

..............................................................................................................................................

..............................................................................................................................................

..............................................................................................................................................
[10 marks]
GO ON TO THE NEXT PAGE
02115020/CAPE 2016
*Barcode Area*
Sequential Bar Code
- 25 -
DO NOT WRITE IN THIS AREADO NOT WRITE IN THIS AREADO NOT WRITE IN THIS AREA

(c) (i) Declare in C a structure called BookRec that can store data for a book. A books
data consists of id (integer), quantity in stock (integer) and price (double).

....................................................................................................................................

....................................................................................................................................

....................................................................................................................................

....................................................................................................................................

....................................................................................................................................

....................................................................................................................................
[3 marks]

(ii) Write C code to load data into EACH of two books, book1 and book2.

Note: book1 and book2 are of type BookRec.

Obtain the data from the user.

....................................................................................................................................

....................................................................................................................................

....................................................................................................................................

....................................................................................................................................

....................................................................................................................................

....................................................................................................................................
[4 marks]

(iii) Write C code to increase the price of book1 by 25%.

....................................................................................................................................

....................................................................................................................................

....................................................................................................................................

....................................................................................................................................
[2 marks]

GO ON TO THE NEXT PAGE


02115020/CAPE 2016
*Barcode Area*
Sequential Bar Code
- 26 -

DO NOT WRITE IN THIS AREADO NOT WRITE IN THIS AREADO NOT WRITE IN THIS AREA
(iv) Write C code to interchange the contents of book1 and book2.

....................................................................................................................................

....................................................................................................................................

....................................................................................................................................

....................................................................................................................................

....................................................................................................................................

....................................................................................................................................
[3 marks]

Total 25 marks

END OF TEST

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

02115020/CAPE 2016
*Barcode Area*
Sequential Bar Code
- 27 -
DO NOT WRITE IN THIS AREADO NOT WRITE IN THIS AREADO NOT WRITE IN THIS AREA

EXTRA SPACE

If you use this extra page, you MUST write the question number clearly in the box provided.

Question No.

...........................................................................................................................................................................

...........................................................................................................................................................................

...........................................................................................................................................................................

...........................................................................................................................................................................

...........................................................................................................................................................................

...........................................................................................................................................................................

...........................................................................................................................................................................

...........................................................................................................................................................................

...........................................................................................................................................................................

...........................................................................................................................................................................

...........................................................................................................................................................................

...........................................................................................................................................................................

...........................................................................................................................................................................

...........................................................................................................................................................................

...........................................................................................................................................................................

...........................................................................................................................................................................

...........................................................................................................................................................................

...........................................................................................................................................................................

...........................................................................................................................................................................

...........................................................................................................................................................................

...........................................................................................................................................................................

02115020/CAPE 2016
*Barcode Area*
Sequential Bar Code
- 28 -

DO NOT WRITE IN THIS AREADO NOT WRITE IN THIS AREADO NOT WRITE IN THIS AREA
EXTRA SPACE

If you use this extra page, you MUST write the question number clearly in the box provided.

Question No.

...........................................................................................................................................................................

...........................................................................................................................................................................

...........................................................................................................................................................................

...........................................................................................................................................................................

...........................................................................................................................................................................

...........................................................................................................................................................................

...........................................................................................................................................................................

...........................................................................................................................................................................

...........................................................................................................................................................................

...........................................................................................................................................................................

...........................................................................................................................................................................

...........................................................................................................................................................................

...........................................................................................................................................................................

...........................................................................................................................................................................

...........................................................................................................................................................................

...........................................................................................................................................................................

...........................................................................................................................................................................

...........................................................................................................................................................................

...........................................................................................................................................................................

...........................................................................................................................................................................

...........................................................................................................................................................................

02115020/CAPE 2016
*Barcode Area*
Sequential Bar Code
- 29 -
DO NOT WRITE IN THIS AREADO NOT WRITE IN THIS AREADO NOT WRITE IN THIS AREA

EXTRA SPACE

If you use this extra page, you MUST write the question number clearly in the box provided.

Question No.

...........................................................................................................................................................................

...........................................................................................................................................................................

...........................................................................................................................................................................

...........................................................................................................................................................................

...........................................................................................................................................................................

...........................................................................................................................................................................

...........................................................................................................................................................................

...........................................................................................................................................................................

...........................................................................................................................................................................

...........................................................................................................................................................................

...........................................................................................................................................................................

...........................................................................................................................................................................

...........................................................................................................................................................................

...........................................................................................................................................................................

...........................................................................................................................................................................

...........................................................................................................................................................................

...........................................................................................................................................................................

...........................................................................................................................................................................

...........................................................................................................................................................................

...........................................................................................................................................................................

...........................................................................................................................................................................

02115020/CAPE 2016
*Barcode Area*
Sequential Bar Code
- 30 -

DO NOT WRITE IN THIS AREADO NOT WRITE IN THIS AREADO NOT WRITE IN THIS AREA
EXTRA SPACE

If you use this extra page, you MUST write the question number clearly in the box provided.

Question No.

...........................................................................................................................................................................

...........................................................................................................................................................................

...........................................................................................................................................................................

...........................................................................................................................................................................

...........................................................................................................................................................................

...........................................................................................................................................................................

...........................................................................................................................................................................

...........................................................................................................................................................................

...........................................................................................................................................................................

...........................................................................................................................................................................

...........................................................................................................................................................................

...........................................................................................................................................................................

...........................................................................................................................................................................

...........................................................................................................................................................................

...........................................................................................................................................................................

...........................................................................................................................................................................

...........................................................................................................................................................................

...........................................................................................................................................................................

...........................................................................................................................................................................

...........................................................................................................................................................................

...........................................................................................................................................................................

02115020/CAPE 2016
*Barcode Area*
Sequential Bar Code
DO
NO
W T
RI
TE
TH ON
IS
PA
G E
CANDIDATES RECEIPT

INSTRUCTIONS TO CANDIDATE:

1. Fill in all the information requested clearly in capital letters.

0 2 1 1 5 0 2 0
TEST CODE:

SUBJECT: COMPUTER SCIENCE UNIT 1 Paper 02

PROFICIENCY: ADVANCED

REGISTRATION NUMBER:

FULL NAME: ________________________________________________________________


(BLOCK LETTERS)

Signature: ____________________________________________________________________

Date: ________________________________________________________________________

2. Ensure that this slip is detached by the Supervisor or Invigilator and given to you when you
hand in this booklet.

3. Keep it in a safe place until you have received your results.

INSTRUCTION TO SUPERVISOR/INVIGILATOR:

Sign the declaration below, detach this slip and hand it to the candidate as his/her receipt for this booklet
collected by you.

I hereby acknowledge receipt of the candidates booklet for the examination stated above.

Signature: _____________________________
Supervisor/Invigilator

Date: _________________________________