Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
59 views24 pages

2023 Cape CS Unit 1 P2 Clean

Uploaded by

Sajiv Jadoonanan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
59 views24 pages

2023 Cape CS Unit 1 P2 Clean

Uploaded by

Sajiv Jadoonanan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 24

CARIBBEAN E XAM I NAT I O N S COUNCIL

CARIBBEAN ADVANCED PROFICIENCY EXAMINATION®

‘‘*’’Barcode Area”*”
Front Page Bar Code
06 JUNE 2023 (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

CANDIDATE’S FULL NAME (FIRST, MIDDLE, LAST)


‘‘*’’Barcode Area”*”

DATE OF BIRTH D D M M Y Y Y Y
Current Bar Code

SIGNATURE __________________________________________________

‘‘*’’Barcode Area”*”
Sequential Bar Code
DO
NO
W T
RI
TE
TH ON
IS
PA
GE
TEST CODE 02115020
FORM TP 2023203 MAY/JUNE 2023

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 © 2022 Caribbean Examinations Council


All rights reserved.
‘‘*’’Barcode Area”*”
02115020/MJ/CAPE 2023 Sequential Bar Code
-4-

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

COMPUTER ARCHITECTURE

Answer BOTH questions.

1. (a) Differentiate between the following terms.

(i) ‘ROM’ and ‘RAM’

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

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

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

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

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

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

(ii) ‘Surge protector’ and ‘voltage regulator’

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

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

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

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

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

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

GO ON TO THE NEXT PAGE


02115020/MJ/CAPE 2023
‘‘*’’Barcode Area”*”
Sequential Bar Code
-5-
DO NOT WRITE IN THIS AREA      DO NOT WRITE IN THIS AREA      DO NOT WRITE IN THIS AREA  

(iii) ‘Supercomputer’ and ‘microcomputer’

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

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

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

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

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

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

(b) A gamer wishes to purchase a new computer. State THREE hardware specifications that
should be considered and explain why EACH specification was chosen.

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

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

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

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

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

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

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

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

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

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

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

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

GO ON TO THE NEXT PAGE


02115020/MJ/CAPE 2023
‘‘*’’Barcode Area”*”
Sequential Bar Code
-6-

DO NOT WRITE IN THIS AREA      DO NOT WRITE IN THIS AREA      DO NOT WRITE IN THIS AREA  
(c) Briefly describe the processes in the fetch-decode-execute instruction cycle.

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

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

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

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

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

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

Total 15 marks

GO ON TO THE NEXT PAGE


02115020/MJ/CAPE 2023
‘‘*’’Barcode Area”*”
Sequential Bar Code
-7-
DO NOT WRITE IN THIS AREA      DO NOT WRITE IN THIS AREA      DO NOT WRITE IN THIS AREA  

2. (a) Explain what is meant by the term ‘multiplexer’.

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

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

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

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

(b) Construct the truth table for the circuit shown in Figure 1 by listing all possible input bit
patterns and their corresponding outputs. Show all intermediate steps.

Figure 1. Circuit diagram

[6 marks]

GO ON TO THE NEXT PAGE


02115020/MJ/CAPE 2023
‘‘*’’Barcode Area”*”
Sequential Bar Code
-8-

DO NOT WRITE IN THIS AREA      DO NOT WRITE IN THIS AREA      DO NOT WRITE IN THIS AREA  
(c) Calculate the binary floating point representation of the decimal number 5.50, using 1-bit
sign, 3-bit exponent and 5-bit mantissa. Show all working.

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

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

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

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

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

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

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

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

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

(d) Find the 8-bit two’s complement of -11. Show all working.

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

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

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

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

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

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

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

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

Total 15 marks

GO ON TO THE NEXT PAGE


02115020/MJ/CAPE 2023
‘‘*’’Barcode Area”*”
Sequential Bar Code
-9-
DO NOT WRITE IN THIS AREA      DO NOT WRITE IN THIS AREA      DO NOT WRITE IN THIS AREA  

SECTION B

PROBLEM-SOLVING WITH COMPUTERS

Answer BOTH questions.

3. (a) State how the top-down problem-solving method differs from the bottom-up method.

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

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

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

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

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

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

(b) Briefly describe the following stages of the problem-solving process.

(i) ‘Problem definition’

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

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

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

(ii) ‘Problem analysis’

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

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

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

(iii) ‘Identify and evaluate possible solutions’

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

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

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

GO ON TO THE NEXT PAGE


02115020/MJ/CAPE 2023
‘‘*’’Barcode Area”*”
Sequential Bar Code
- 10 -

DO NOT WRITE IN THIS AREA      DO NOT WRITE IN THIS AREA      DO NOT WRITE IN THIS AREA  
(iv) ‘Implementation and review’

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

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

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

(c) A food court with three restaurants serving Jamaican, Barbadian and Trinidadian cuisine
has a single cashier. A separate bill is needed for each restaurant. Each meal is priced as
shown in the table.

Restaurant Price (EC$) Service Charge (%)


Jamaican 12 4
Barbadian 10 3
Trinidadian 8 1

There is also sales tax of 10% and a discount of 5% if a customer buys more than one meal.

Write the appropriate pseudocode for calculating a single bill for a single customer,
assuming that there are variables called ‘bill’, ‘menuOption’ and ‘numOfMeals’. There
should be an option to exit the pseudocode.

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

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

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

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

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

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

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

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

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

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

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

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

GO ON TO THE NEXT PAGE


02115020/MJ/CAPE 2023
‘‘*’’Barcode Area”*”
Sequential Bar Code
- 11 -
DO NOT WRITE IN THIS AREA      DO NOT WRITE IN THIS AREA      DO NOT WRITE IN THIS AREA  

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

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

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

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

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

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

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

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

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

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

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

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

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

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

..............................................................................................................................................
[9 marks]

Total 15 marks

GO ON TO THE NEXT PAGE


02115020/MJ/CAPE 2023
‘‘*’’Barcode Area”*”
Sequential Bar Code
- 12 -

DO NOT WRITE IN THIS AREA      DO NOT WRITE IN THIS AREA      DO NOT WRITE IN THIS AREA  
4. (a) Examine Algorithm 1 and Algorithm 2 and answer the questions that follow.

Algorithm 1

READ A
SUM = 0
WHILE A <> 0 DO
SUM = SUM + A
READ A
END WHILE

Algorithm 2

FOR X = 1 TO 15 DO
PRINT X
END FOR

(i) State which of the algorithms above illustrates unbounded iteration. Justify your
answer.

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

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

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

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

(ii) Explain how the loop in Algorithm 2 is expected to terminate.

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

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

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

GO ON TO THE NEXT PAGE


02115020/MJ/CAPE 2023
‘‘*’’Barcode Area”*”
Sequential Bar Code
- 13 -
DO NOT WRITE IN THIS AREA      DO NOT WRITE IN THIS AREA      DO NOT WRITE IN THIS AREA  

(b) Trace through the execution of the following algorithm and in the space provided, draw
the output exactly as it would be generated by the algorithm.

START
Declare i = 1, j as Integer
While (i < = 4)
If (i % 2 = = 0) Then
Begin
Print "$"
For j = 1 to 4
Print "*"
EndFor
Else
Begin
For j = 1 to 4
Print "*"
EndFor
End IF
Print newline
i=i+1
EndWhile
STOP

[6 marks]
GO ON TO THE NEXT PAGE
02115020/MJ/CAPE 2023
‘‘*’’Barcode Area”*”
Sequential Bar Code
- 14 -

DO NOT WRITE IN THIS AREA      DO NOT WRITE IN THIS AREA      DO NOT WRITE IN THIS AREA  
(c) The following algorithm is designed to print a table of cubes of all the even positive integers
between 4 (inclusive) and 14 (inclusive). However, there are errors in the algorithm.

1. i=4
2. while i < 14
3. i * i * i = cube
4 print i, cube
5. i=i+1
6. end while

By referring to the specific line numbers, identify and correct the THREE errors so that
the algorithm achieves its objective.

Line Number Error Correction

[6 marks]

Total 15 marks

GO ON TO THE NEXT PAGE


02115020/MJ/CAPE 2023
‘‘*’’Barcode Area”*”
Sequential Bar Code
- 15 -
DO NOT WRITE IN THIS AREA      DO NOT WRITE IN THIS AREA      DO NOT WRITE IN THIS AREA  

SECTION C

PROGRAMMING

Answer BOTH questions.

5. (a) (i) State TWO differences between ‘a compiler’ and ‘an interpreter’.

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

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

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

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

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

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

(ii) Explain how the assembly and linking processes allow code written in high level
programming languages to run on a wide range of machines.

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

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

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

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

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

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

GO ON TO THE NEXT PAGE


02115020/MJ/CAPE 2023
‘‘*’’Barcode Area”*”
Sequential Bar Code
- 16 -

DO NOT WRITE IN THIS AREA      DO NOT WRITE IN THIS AREA      DO NOT WRITE IN THIS AREA  
(b) (i) Write a C declaration for a structure that holds the record of a customer. Each
record contains a customer ID (integer) and a customer balance (float).

Note that balance represents the amount of money a customer has for making
purchases.

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

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

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

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

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

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

(ii) Declare a variable to represent ONE customer, Andrew, and set his record values
as shown in the information below.

Customer Name – Andrew


Customer ID – 1230
Balance – $33.55

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

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

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

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

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

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

GO ON TO THE NEXT PAGE


02115020/MJ/CAPE 2023
‘‘*’’Barcode Area”*”
Sequential Bar Code
- 17 -
DO NOT WRITE IN THIS AREA      DO NOT WRITE IN THIS AREA      DO NOT WRITE IN THIS AREA  

(iii) Assume Andrew gets a 10% discount on all purchases.

Write C code to read the value from the keyboard that represents Andrew’s purchases
and calculates his customer balance based on the purchase.

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

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

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

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

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

Total 15 marks

GO ON TO THE NEXT PAGE


02115020/MJ/CAPE 2023
‘‘*’’Barcode Area”*”
Sequential Bar Code
- 18 -

DO NOT WRITE IN THIS AREA      DO NOT WRITE IN THIS AREA      DO NOT WRITE IN THIS AREA  
6. (a) Describe what is meant by the term ‘semantic errors’.

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

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

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

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

(b) State the role of a ‘watch’ in programming.

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

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

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

(c) Write a C function, arraySum, which accepts an integer array and an integer variable,
clearly indicating the size of the array as parameters. The function should return the sum
of all the numbers in the array that are NOT greater than 50.

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

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

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

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

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

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

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

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

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

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

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

..............................................................................................................................................
[7 marks]

GO ON TO THE NEXT PAGE


02115020/MJ/CAPE 2023
‘‘*’’Barcode Area”*”
Sequential Bar Code
- 19 -
DO NOT WRITE IN THIS AREA      DO NOT WRITE IN THIS AREA      DO NOT WRITE IN THIS AREA  

(d) Complete the trace table below by writing the output values of i, n and result at the
beginning of each iteration, if the function fact(5) is invoked by the following C function
fact(n), defined as

int fact (int n)


{
int result = 1;
for (int i = n; i > = 1; i - -)
{
result = result + i;
}
return result;
}


i n result

[5 marks]

Total 15 marks

END OF TEST

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

02115020/MJ/CAPE 2023
‘‘*’’Barcode Area”*”
Sequential Bar Code
- 20 -

DO NOT WRITE IN THIS AREA      DO NOT WRITE IN THIS AREA      DO 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/MJ/CAPE 2023
‘‘*’’Barcode Area”*”
Sequential Bar Code
- 21 -
DO NOT WRITE IN THIS AREA      DO NOT WRITE IN THIS AREA      DO 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/MJ/CAPE 2023
‘‘*’’Barcode Area”*”
Sequential Bar Code
- 22 -

DO NOT WRITE IN THIS AREA      DO NOT WRITE IN THIS AREA      DO 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/MJ/CAPE 2023
‘‘*’’Barcode Area”*”
Sequential Bar Code
DO
NO
W T
RI
TE
TH ON
IS
PA
GE
CANDIDATE’S RECEIPT

INSTRUCTIONS TO CANDIDATE

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

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 candidate’s booklet for the examination stated above.

Signature _____________________________
Supervisor/Invigilator

Date _________________________________

You might also like