Вы находитесь на странице: 1из 194

Computer

Science

CAPE® PAST PAPERS


Macmillan Education
4 Crinan Street, London, N1 9XW
A division of Macmillan Publishers Limited
Companies and representatives throughout the world

www.macmillan-caribbean.com

ISBN 978-0-230-48288-3 AER

© Caribbean Examinations Council (CXC ®) 2016


www.cxc.org
www.cxc-store.com

The author has asserted their right to be identified as the author of this work in accordance with the
Copyright, Design and Patents Act 1988.

First published 2014


This revised edition published August 2016
All rights reserved; no part of this publication may be reproduced, stored in a retrieval system,
transmitted in any form, or by any means, electronic, mechanical, photocopying, recording, or
otherwise, without the prior written permission of the publishers.

Designed by Macmillan Publishers Limited


Cover design by Macmillan Publishers Limited and Red Giraffe
Cover photograph © Caribbean Examinations Council (CXC ®)
Cover photograph by Mrs Alberta Henry
With thanks to Celsus Henry
CAPE® Computer Science Past Papers

LIST OF CONTENTS

UNIT 1 Paper 02 May 2005 3


UNIT 2 Paper 01 May 2005 8
UNIT 1 Paper 01 June 2006 15
UNIT 1 Paper 02 May 2006 22
UNIT 2 Paper 01 June 2006 28
UNIT 2 Paper 02 June 2006 35
UNIT 1 Paper 02 May 2008 40
UNIT 1 Paper 02 July 2008 46
UNIT 1 Paper 02 May 2009 52
UNIT 2 Paper 02 May 2009 61
UNIT 1 Paper 02 May 2010 66
UNIT 2 Paper 02 May 2010 73
UNIT 1 Paper 02 May 2011 80
UNIT 2 Paper 02 May 2011 87
UNIT 1 Paper 02 May 2012 92
UNIT 2 Paper 02 May 2012 98
UNIT 1 Paper 02 May 2013 104
UNIT 2 Paper 02 May 2013 111
UNIT 1 Paper 02 May 2014 117
UNIT 2 Paper 02 May 2014 125
UNIT 1 Paper 02 May/June 2015 132
UNIT 2 Paper 02 May/June 2015 142
UNIT 1 Paper 02 May/June 2016 149
UNIT 2 Paper 02 May/June 2016 173
TEST CODE 02115020
FORM TP 2005186 MAY/JUNE 2005

C ARIBBEAN EXAM I NATIONS COUNC IL


ADVANCED PROFICIENCY EXAMINATION
COMPUTER SCIENCE
UNIT 1- INFORMATION SYSTEMS
PAPER02
I~ hours

( 20MAY200S(a.m.))

INSTRUCTIONS TO CANDIDATES

1. This paper consists of THREE sections.

2. Answer ONE question from EACII section.

Copyright© 2004 Caribbean Examinations Council.


All rights reserved.

02115020/CAPE 2005
-2-

SECTION A

MODULE 1: COMPONENTS OF COMPUTER SYSTEMS

An swer ONE question from this section.

1. (a) Differentiate between EACH of the following as they pertain to computers and information
systems:

(i) ROM and EPROM [2 marks]

(ii) MAN and LAN [2 ma r ks]

(iii) Hub and router [2 ma r ks]

(iv) EPROM and EEPROM [2 marks]

(v) Workstation and supercomputer [2 marks]

(b) Describe the characteristics of EACH of the followi ng transmission media:

(i) Coaxial cable [3 marks]

(ii) l'wistcd pair [3 ma r ks]

(iii) Fiber-optic cables [3 marks]

(c) Describe TWO network related problems that can be solved by using network diagnostic
tools. [4 marks]

(d) Explain TWO reasons why compression utilities are useful. [4 marks]

(e) Describe 'radio waves' as a transmission media. [3 marks]

Tota l 30 marks

GO ON TO THE NEXT PAGE


02115020/CAPE 2005
-3-

2. (a) Your friend is interested in purchasing a mouse to act as an input device for her computer.
Advise your friend on FOUR issues that she should consider before buying the mouse.
(Do NOT include cost as an issue in your answer.) [8 marks]

(b) Explain the role of the 'user interface' in an operating system. [3 marks]

(c) Describe the use of the microwave as a wireless transmission media. [S marks]

(d) (i) With the aid of a diagram, describe the FDDI (Fiber Distributed Data Interface)
network topology. [6 marks]

(ii) When would a FDDI network fail? [1 mark]

(iii) Briefly describe a disadvantage of FDDI networks. [2 marks]

(e) Describe how data is transmitted in a ring network topology. [5 marks]

Total 30 marks

SECTION B

MODULE 2: APPLICATIONS OF COMPUTERS

Answer ON E question from this section.

3. Fifteen years ago, John Alibocas opened a small department store called Houseware, in Port of
Spain, Trinidad , selling furniture, appliances and other household articles. His business
experienced steady growth and now Houseware has 15 branches throughout Trinidad, as well as
branches in some of the other Caribbean countries.

(a) Discuss THREE application areas of the business where the data processing needs of
Houseware would have changed during the past fifteen years. [9 marks]

(b) For TWO of the appli cation areas discussed in 3 (a), describe how innovations in
information technology would have affected the way in which the changing needs of the
business could be met. [6 marks]

(c) (i) Discuss the kinds of infonnation processing activities that would take place at
the operational and strategic levels of Houseware. [6 marks]

(ii) Identify THREE types of information systems that could be used at Houseware
and describe the processing that would be performed by EACH one.
[9 marks]

Total 30 marks

GO ON TO THE NEXT PAGE


021 15020/CAPE 2005
-4-

4. People's Bank is a bank operating in a large Ca1ibbean country and has several branches throughout
that country. The bank uses an information system to maintain information on its customers and
the different accounts that they have at the bank. The system is not currently connected to the
Internet but management is interested in offering banking services to customers using the Internet
in the near future.

(a) (i) Discuss TWO means by which unauthorised access of data in the system can take
place. [6 marks]

(ii) Propose TWO measures to prevent or deter unauthorised access to the system
from taking place. [6 marks]

(b) Accidental damage to data as well as other unforeseen circumstances such as hurricanes,
fire and power outages, can render the information system useless. Discuss TWO measures
that the bank can take to prepare for ALL of these situations. [6 marks]

(c) Discuss TWO benefits that the bank can gain by making some of its services available on
the Internet. [6 marks]

(d) Describe ONE security risk that the bank may face by offering some of its services on the
fnternet and explain how this risk may be reduced. [6 marks]

Total 30 marks

SECTION C

MODULE 3: COMPUTER-BASED PROBLEM SOLVING

Answer ONE question from this section.

5. (a) A cement manufacturing company in Jamaica is facing a temporary financial crisis.


However, the firm has been prosperous over the past 10 years. The company wishes to
attract investors from the public, so it can solve some of its temporary financial problems.

(i) Identify THREE appropriate software tools that can be used in the company's
venture to attract investors. [3 marks]

(ii) Select TWO of the tools which you identified in 5 (a) (i) and for EACH, describe
TWO features that would be useful to the company. [8 marks]

(iii) Discuss TWO advantages of the tools you have chosen in 5 (a) (ii) over the one
that was not chosen. [4 marks]

GO ON TO THE NEXT PAGE


02115020/CAPE 2005
-5-

(b) Describe ONE advantage and TWO disadvantages of gathering information by personal
contact. [6 marks]

(c) Discuss THREE characteristics of the Internet as an information source. [9 marks]

Total 30 m ar ks

6. (a) The management of Gulf View Hotel decided to invest U.S. $50,000.00 in the shares of
a company called Property Management Limited , lrading on Lhe New York Stock
Exchange. The chief accountanl had read an article on a Web site stating that Property
Management Limiled was performing well and its shares would be worth twice its value
in two months. However, Gulf View Hotel lost most of its investment in three months
because Property Management Limited, once a very profitable company, had been
unprofitable for two years.

(i) Identify FOUR other sources of information that could have been used to confim1
the information found on the Web site. [4 marks]

(ii) Discuss TWO evaluative criteria that the management of Gulf View Hotel could
have used to accept or reject the information found on the Web site.
[8 m arks]

(b) Di scuss TWO ways in which an organisation can benefit from using the Internet as an
informalion source. [6 ma rks]

(c) Identify and describe FOUR stages of the problem solving process that one should follow
in order to develop a computer-based solution for a business problem. [12 marks]

Total 30 marks

END OFTEST

02115020/CAPE 2005
TEST CODE 02215010
FORM TP 2005187 MAY/JUNE 2005

CARIBBEAN EXAMINATIONS COUNCIL


ADVANCED PROFICIENCY EXAMINATION
COMPUTER SCIENCE
UNIT2-SOFfWARE ENGINEERJNGAND PROGRAMMING
PAPEROl

2-'ll hours

( 15 JUNE 2005 (a.m.))

INSTRUCTIONS TO CA NDIDATES

1. This paper consists of THREE sections.

2. Answer ALL questions.

Copyright © 2004 Caribbean Examinations Council.


All rights reserved.

02215010/CPJPE 2005
-2 -

SECTION A

MODULE 1: SOFTWARE AND SYSTEM DEVELOPMENT

Answer ALL questions in this section.

1. (a) Name and describe THREE important attributes of well-engineered software.


[6 marks]

(b) Li st FOUR fundamental activities that are common to all software development
approaches. [4 marks]

Total 10 marks

2. (a) What are the MAIN features of the waterfall model of software development?
[4 marks]

(b) In what stages of the waterfall model are users most involved? [2 marks]

(c) Briefly discuss ONE advantage and ONE disadvantage of evolutionary development
over the watetfall approach. [4 marks ]

TotallO marks

3. (a) Briefly describe THREE techniques that can be used to gather the requirements for a new
system. [6 marks]

(b) A feas ibility report is normally produced earl.y in the analysis phase.

(i) What does this report contain?

(ii) Why is this report produced? [4 marks]

TotallO m a rks

4. (a) Draw THREE of the symbols used in a data flow diagram and say why EACH is used.
[6 marks]

(b) Differentiate between functional requirements and non-functional requirements.


[4 marks]

Total 10 marks

GO ON TO THE NEXT PAGE


02215010/CAPE 2005
-3 -

5. (a) Briefl y discuss ONE advantage and ONE disadvantage of the command language style
of user interface over the me nu selection interface. [4 marks]

(b) In a certain hospital, a graphical user interface is used to allow nurses to obtain informati on
on intensive-care patients. To view a patient's current condition, the following screen is
used.

Please type the patient name then click on OK

Patient Name:

Flinstone, F.

Suppose a nurse enters an incorrect name of a patient. Discuss THREE features that
should be considered when displaying the error message, to help the user to recover from
the error.
[6 marks]

Total 10 m a t·ks

SECTION B

MODULE 2: PROGRAMMING LANGUAGES

Answer ALL questions in this section.

6. A retail finn has asked you to write an in ventory manageme nt progra m using a procedural
programming la nguage.

(a) List SIX mai n steps you must take in formulating the program. [6 m arks]

(b) E xplain how your design approach would have been di fferent if you were asked to write
the same program using an object-oriented progra mming language. [4 marks]

Total 10 marks

GO ON TO THE NEXT PAGE


022 150 10/CA PE 200 5
-4 -

7. Briefly describe EACH of the foll owing classifications of programming lang uages :

(a) ( i) Functional
(ii) Decl.arative
(iii) Impe rative (procedural) [6 ma rksl

( b) Discuss TWO advantages of a top-down modular approach to programming.


[4 m arks]

Total 10 marks

8. (a) Briefly describe the characteristics of:

(i) 2"d generation prog ranuning languages


(ii) 3ro generation programming languages [4 ma rks]

(b) Briefly explain how EACH of the following three factors can influence the c hoice of a
particular programming language:

(i) Run-time
(ii) Portability
(iii) Maintainabil ity [6 marks]

Total 10 ma rks

9. A soft-drink manufacture r sells fi ve soft-drink flavours: banana, cherry, mango, orange and
pineapple. The company knows that banana and pineapple are the two best-sel ling flavours and
is carrying out a poll to dete rmine w hich of these two flavours is the more popular a mong its
customers.

Write an algorithm to find the more popular flavour and the number of votes it obtained. Assume
that 100 c ustome rs partic ipate in the poll and that there is no tie .
TotallO marks

10. (a) Define the term a lgorithm. [2 m arks]

(b) Using ex.amples, di sting ui s h between bounded and unbounded iteratio n as used in
s tructured programming. [4 marks]

(c) Distinguish between the fo llow ing terms as used in o bject-oriented programm ing:

( i) Object and c lass


( i i) Pri va tc method and public method [4 marks]

Tota l 10 ma rks

GO ON TO TH E NEXT PAG E
022 150 I 0/CA PE 2005
-5-

SECTION C

MOD ULE 3: PROGRAM DEVELOPMENT

Answer ALL questions in th is section.

11. A program is written to accept two integers and calculate thei r sum. l t uses the following graphical
user interface in an event driven environment:

Add Two Integers

Fonts Window

Textfields

~ ~-+---- Button

The sum is: «'---1---- Textfielcl


L-------~

(a) D escribe the purpose of EAC H type of user interface object shown in the diagram.
[5 marks]

(b) ( i) lclenlify the most important event that the program should anticipate.
[1 mark ]

(ii ) Write an algorithm to define the processing steps that should take place w hen the
event identified in (b) ( i) occurs. [4 marks)

Total 10 marks

GO ON TO THE NEXT PAGE


022 L50 I 0/CAPE 2005
-6-

12. The f ol low ing algorithm accepts a string of characters and uses the stack abstract data type to
process the characters one by one. The only character s in the string are left parentheses and right
parentheses, i.e. the characters •( • and ' ) ' .

Algor ithm M ystery (String inputString):

length +- number of characters in inputString


create a new stack, stk

For i = 1 to l ength do
ch +- i1h character of inputStri ng
If ch is a left parenthesis, ' ( '
Push Ch onto stk
El se
If stk is empty then
Pr int " Failure 1"
Ex it A lgorithm M ystery
Else
Pop the topmost character from stk
End i f
End if
End for

I f stk is not empty then


Print " Fai lure 2 "
El se
Print " Success "
End if

End A lgorithm M ystery

(a ) B y show ing each step in the processing of the input stri ng, determine the output that the
Myste1y algorithm w ill generate given the following inpu t stri ngs:

( i) ()) [3 marks]

(ii) (()) [4 marks]

( i ii ) (() [2 marks]

(b) Deduce the purpose of the Mystery algorithm . 11 mark J

Total 10 marks

GO ON TO T HE NEXT PAGE
022 150 I 0/CA PE 2005
..

-7 -

13. An Account obj ect has two instance variables, accNum (a11 integer value) and balance (a floating
point value), and the following methods:

deposit: accepts a parameter, a11wtm1 (a floating point value) and increa:ses the balance by
01/lQU/l[

withdraw: accepts a parameter, a mount (a floating point value) and decreases the balance by
Cl/11011111
getBalance: returns the current balance in the account

U sing an object-oriented programming language of your choice, write the code to define the
Account class.
Total 10 marks

14. Modern programming environments provide a number of tools to simplify the process of creating
computer programs.

(a) Identify FOUR tools that are typi ca lly provided in a programming environment.
[4 marks]

(b) Briefl y ex plain how any THREE of the tools identifi ed in (a) above :s implify the
development of a program. [6 marks]

Total 10 marks

15. (a) (i) Briefly distingui sh between 'unit testing' and 'system testing' . [2 marks]

(i i ) A Temperature obj ect has a method toFahrenheit. which accepts a parameter,


cenLigrade (a floating point va lue) and converts thi s va lue to a fahrenheit
temperature using the follow ing calculati on:

fahrenheit = (9/5) * centigrade + 32


Describe the steps that shou ld be taken in order to unit t est the roFahrenhe it
method . [4 marks]

(b) Briefl y describe TWO types of documentation normall y included in a software package.
[4 marks]

TotallO marks

END OF TEST

022 150 I 0/CA PE 2005


TEST CODE 02115010
FORM TP 2006191 MAY/JUNE 2006

CARIBBEAN EXAMINATIONS COUNCIL


ADVANCED PROFICIENCY EXAMINATION
COMPUTER SCIENCE
UNIT 1- INFORMATION SYSTEMS

PAPER 01

21 /zours

( 08 JUNE 2006 (a.m.))

INSTRUCTIONS TO CANDIDATES

I. This paper consists of THREE sections.

2. Answer ALL questions.

Copyright © 2005 Caribbean Examinations Counci l ®


All rights reserved.

021150 10/CAPE 2006


- 2-

SECTION A

MOD ULE !: COMPONENTS OFCOMPUTER SYSTEMS

Answer ALL questions in tbis section.

1. (a) Explain how a UPS (Uninterruptable Power Supply) can help protect a computer.
[4 marks]

(b) John wishes to keep his existing computer system for the next 20 years. James advised him to
change computers more frequently as port connectivity may eventually be a problem.

Explain, with an example, the term 'port connectivity'. (3 marks)

(c) Briefly describe 'satellites' as a transmission medium. [3 marks]

TotallO marks

2. (a) Explain wbat is meant by tbe 'instruction set' of a computer. (2 marks]

(b) One type of software is 'client software'.

(i) Give an example of'client software'. [1 mark]

(ii) Explain the purpose of the client software you named in 2 (b) (i) above.
(2 marks]

(iii) Explain how the corresponding server software works in conjunction with the client
software mentioned in 2 (b) (i) above. [3 marks]

(c) What is a peer-to-peer network? [2 marks]

TotallO marks

3. (a) Most operating systems ship witb disk management software. Describe TWO features normally
provided by disk management software. (4 marks]

(b) What is meant by the term 'memory management' as it relates to operating systems?
(2 marks]

(c) Explain and give an example ofEACH of the fo llowing:

(i) Multitas king

(ii) Multiprocessing [4 marks]

Total 10 marks

GO ON TO THE NEXT PAGE


02115010/CAPE 2006
-3-

4. (a) Explain THREE features normally provided by network operating system software.
[6 marks]

(b) Describe TWO other utilities, other than disk management software, typically present in system
software. [4 marks]

Total 10 marks

5. (a) (i) Explain how an extranet is similar to the Internet. [2 marks)

(ii) Explain how an extranet is different from the Internet. f2 marks]

(b) (i) What is meant by the phrase 'capacity of a storage device'? l2 marksj
(ii) Some storage devices are preferred over others because of 'access speed' . Explain
what is ' access speed' . [2 marks]

(iii) What is meant by 'pOitability'? [2 marksj

TotallO marks

GO ON TO THE NEXT PAGE


021150 l 0/CAPE 2006
-4-

SECTION B

MODULE 2: APPLICATIONS OF COMPUTERS

Answer ALL questions in this section.

6. To support management decision making, organizations are increasingly using special-purpose computer
applications such as ' expert systems' or applications based on data warehousing and data mining
techniques.

(a) (i) Explain what is an 'expert system'. [3 marks]

(ii) Discuss briefly how an expert system can be used to support management decision-
making. [2 marks]

(b) (i) Explain what is a data warehouse. [3 marks]

(ii) Briefly discuss what happens during data mining. [2 marks]

TotallO marks

7. (a) Using an example, explain the purpose of 'monitoring and control' systems.
[4 marks]

(b) Discuss ONE way in which user interfaces are constantly improving. (2 marks]

(c) Describe TWO factors that determine the suitability of a computer application for an
organization. [4 marks]

TotallO marks

8. (a) Describe TWO forms of data security. (4 marks]

(b) System back-up is one strategy for enhancing data security. Using an example, explain bow
a system back-up is performed. [3 marks]

(c) Another strategy for enhancing data security is ' real-time updating offiles '. Using an example,
explain what is meant by the term ' real-time updating of files ' . (3 marks]

TotallO marks

GO ON TO THE NEXT PAGE


02 11501 0/CAPE 2006
-5-

9. (a) Explain how EACH of the following can help protect an organization's data from unauthorised
access:

(i) Firewall r2marks]


(ii) Encryption [2 marl<s]

(b) A company has just been established to provide a new range of financial services. Suggest
TWO ways in which computers can help the organization. [4 marks)

(c) Distinguish between batch and on-line processing. [2 marks]

Total 10 marks

10. Computers have changed the way in which individuals work, entertain themselves and communicate
with each other.

(a) (i) One way computers have changed the way in which individuals work is telecommuting.
Explain the concept of telecommuting. [2 marks]

(ii) State TWO advantages of telecommuting. r2marks]


(b) State TWO ways in which computers have changed the way in which individuals enteJtain
themselves. (2 marks]

(c) Describe TWO ways in which computers have changed the way in which individuals
communicate with each other. (4 marks]

TotallO marks

GO ON TO THE NEXT PAGE


021150 I 0/CAPE 2006
- 6-

SECTIONC

MODULE 3: COMPUTER-BASED PROBLEM SOLVING

Answer ALL questions in this section.

11. (a) Give TWO similarities and TWO differences between information stored on a CD-ROM and
information stored in a digital library. [4 marks)

(b) A hurricane is heading rapidly towards a country where Melissa lives. Melissa has been
monitoring the progress of the hurricane by reading the newspapers.

(i) Explain ONE reason why the newspaper may be a good source of information on the
hurricane. [2 marks]

(ii) Explain ONE reason why the newspaper may NOT be a good source of information
on the hurricane. [2 marks]

(iii) Describe another source of information that Melissa could have checked for
infonnation on the hurricane. [2 marks]

TotallO marks

12. A wealthy businessman from the U.S.A. got an anonymous email indicating that a patticular Caribbean
country was a good place to set up a fumiture company. The businessman went ahead and invested in
the business, but six months later he had to close the business because of poor sales.

(a) Explain THREE reasons wby the businessman should NOT have trusted the information from
the anonymous email. [6 marks]

(b) Identify and explain TWO other sources the businessman should have checked before making
the investment. [4 marks]

TotallO marks

13. (a) Jeffrey wishes to gather information for a government ministry on the average income of
households. Persons who earn less than a certain amount of income would be eligible for
grants from the government.

(i) Apart from direct personal contact, describe TWO other sources from which Jeffrey
can get information on the average household income. [4 marks]

(ii) Discuss TWO disadvantages that Jeffrey may face if he decided to use direct personal
contact with individuals to gather the required information. [4 marks!

(b) Explain what is meant by the tem1 ' depth of coverage' as it relates to an information source.
rzmarks)
TotallO marks

GO ON TO THE NEXT PAGE


021150 I 0/CAPE 2006
-7-

14. (a) State TWO similarities and ONE difference between DVD-ROM and CD-ROM as sources of
information. [3 m arks1

(b) Francis is thinking about studying at either a local university or one in the U.S.A. He would
like to obtain as much information as possible before making a decision.

(i) Identify THREE relevant sources from which he can obtain information on the local
universities and those in the U.S.A. [3 mar ks]

(ii) For TWO of the sources identified in 14 (b) (i) above, explain why EACH is appropriate
for obtaining the required information. [4 marks)

Total 10 marks

15. (a) 'Toyland Kids' is a toy store that has peak sales at Christmas time. Management bas asked for
a report that shows the trends in sales during the Christmas season over the past five years.

(i) Identify a software tool that can BEST show the trends in sales over the required
period. [1 mark ]

(ii) Describe a feature of the tool listed in 15 (a) (i) above that would show the required
trends. [2 marks]

(iii) Management needs to keep adequate records ofall items in stock, including description
and product number, so that they can eventually keep track of all the toys sold as well
as maintain proper records.

Describe a software tool that is suitable for this purpose. [2 m arks)

(b) An instructor wishes to teach students about how the Internet can be used for deploying
multimedia applications.

(i) Identify and describe a software tool that is BEST suited for this purpose.
[3 marks]

(ii) Describe a precaution the instructor should take when using the software tool
identified in 15 (b) (i) above. l2 marks]

Total 10 ma rks

END O F TEST

02115010/CAPE 2006
TEST CODE 02115020
FORM TP 2006192 MAY/JUNE 2006

CARIBBEAN EXAMINATIONS COU NC IL


ADVANCED PROFICIENCY EXAMINATION
COMPUTER SCIENCE
UNIT 1 - INFORMATION SYSTEMS
PAPER02
I
J hours
2

( 19 MAY 2006 (a.m.))

INSTRUCTIONS TO CANDIDATES

1. This paper consists of THREE sections.

2. Answer O NE question from EACH section.

Copyright © 2005 Caribbean Examinations Council ®


All rights reserved.

02115020/CAPE 2006
- 2-

SECTION A

MODULE 1: COMPONENTS OF COMPUTER SYSTEMS

Answer ONE question from tbis section.

1. (a) Differentiate between EACH of the following as they pertain to computers and infonnation
systems:

(i) RAM and EPROM [2 marks]

(ii) Centralized and di stributed network configurations [2 marksl

(iii) Cache memory and RAM [2 marks]

(iv) EPROM and EEPROM [2 marks]

(v) Modem and network interface card [2 marks]

(b) Explain in detail how an operating system can execute THREE processes at the same time.
[8 marks]

(c) A university wishes to purchase a human resource software package to maintain data on
employees from different departments. All departments are networked together.

(i) Describe FOUR data requirements that the package should meet. [8 marks]

(ii) Describe TWO communication requirements that the package should meet.
[4 marks]

Total 30 marks

GO ON TO THE NEXT PAGE


021 15020/CAPE 2006
- 3-

2. (a) Consider the following diagram of a computer network.

Star
Network

I !Ill I IIIII!

Identify and describe the overall network topology that is being used in the figure above.
[3 marks]

(b) Describe TWO advantages of fibre-optic cable over coaxial cable. [4 marks]

(c) (i) Draw a diagram to show the layers of the OSI model for computer conununication.
[7 marks]

(ii) With respect to the diagram drawn in 2 (c) (i), clearly state ONE function of EACH of
the layers drawn. [7 marks]

(d) Explain how a computer transmits data to another computer in

(i) a bus network [4 marks]

(ii) a ring network [5 marks]

Total 30 marks

GO ON TO THE NEXT PAGE


02115020/CAPE 2006
-4 -

SECTIONB

MODULE 2: APPLICATIONS OF COMPUTERS

Answer ONE question from this section.

3. (a) With the aid of examples, distinguish between data loss and data corruption. [4 marks]

(b) A certain company has three levels of management: lower, middle and top.

(i) Describe the types of decisions made at EACH level of the company.
[9 marks]

(ii) State the type of infom1ation system that would be appropriate for EACH level of
decision-making in the company. [3 marks]

(iii) Describe the characteristics of EACH information system stated in 3 (b) (ii) above.
[9 marks]

(c) A series of hurricanes recently caused extensive data loss and damage to the computers of
several organizations in a Caribbean country.

(i) State TWO precautions these organizations could have taken to minimize the effects
of data loss. [2 marks]

(ii) For ONE of the precautions stated in 3 (c) (i) above, discuss how the organizations
could have implemented that precaution. [3 marks]

Total 30 marks

4. (a) Several banks in the Caribbean are now offering limited financial services to customers on the
Internet. Describe TWO techniques that can be employed to prevent or deter unauthorised
access of their Web-based systems. [6 marks]

(b) Recently, a popular singer discovered that someone was making copies of his music. He
in formed the police and the person was arrested. Explain why this person was arrested for
making copies of the singer's music. [6 marks]

(c) Using examples, describe THREE ways in which an organisation can benefit from automation .
[9 marks]

(d) Discuss THREE ways in which computer applications have affected the j ob market.
[9 marks]

Total 30 marks

GO ON TO THE NEXT PAGE


02115020/CAPE 2006
- 5-

SECTIONC

MODULE 3: COMPUTER-BASED PROBLEM SOLVING

Answer ONE question from this section.

5. (a) Carib Merchant and Finance is a company operating in the financial sector in a large Carib-
bean country. Four years ago, its management read a report on a Web site that forecasted that
in three years time, similar companies around the world would be conducting most of their
business on the Internet. To prepare for this, Carib Merchant and Finance borrowed and
spent millions of dollars on a suitable Internet infrastructure for customers to conduct transac-
tions using their Web site. However, after four years, less than one per cent of the company's
customers are using the Web site. This has caused the company to experience a big loss in its
investment, which now threatens its survival in the competitive fmancial sector.

(i) Describe THREE other sources of information that could have been used to confirm
the information found on the Web site. [6 marks]

(ii) Discuss THREE evaluative criteria that the management of Carib Merchant and Fi-
nance could have used to accept or reject the information found on the Web site.
[9 marks]

(b) Discuss TWO ways in which an organization can benefit from using the Internet as an infor-
mation source. [6 marks]

(c) Discuss EACH of the following as it pertains to an information source:

(i) Cost [3 marks]

(ii) Currency [3 marks]

(iii) Accuracy [3 marks]

Total 30 marks

GO ON TO THE NEXT PAGE


02115020/CAPE 2006
-6-

6. At a certain university, the staff members need to access information on students (for example, name,
address, marital status and courses). The university's governing council requires summary infonna-
tion on the number of students in the university and where they come from, information on new
students, the courses being offered, and the number of students registered, as well as, fees paid.

(a) (i) Select a software tool that is MOST appropriate for storing and retrieving infonna-
tion on students and their courses of study. [1 mark ]

(ii) Describe THREE features of the software tool chosen in 6 (a) (i) above that make it
most appropriate. [9 marks]

(b) (i) Select a software tool that is MOST appropriate for analysing and generating infor-
mation on students. [1 mark ]

(ii) Discuss TWO features of the software tool chosen in 6 (b) (i) above that make it
MOST appropriate. [6 marks]

(c) The Chancellor of the university is required to make a presentation to a group of regional
leaders on students registered for each graduate and post-graduate programme. Describe how
the presentation should be put together using appropriate software tools.
[6 marks]

(d) The university periodically sends newsletters to its former students, and often sends brochures
on new programmes offered at the post-graduate level. Select a software tool that is MOST
appropriate for producing the newsletter and brochures. Give TWO reasons why you think
that the selected tool is MOST appropriate. [7 marks]

Total 30 marks

END OFTEST

021 15020/CAPE 2006


TEST CODE 02215010
FORM TP 2006193 MAY/JUNE 2006

CARIBBEAN EXAMINAT IO NS COUNCIL


ADVANCED PROFICIENCY EXAMINATION
COMPUTER SCIENCE
UNJT 2 - SOFTWARE ENGI EERING AND PROGRAMMING
PAPER 01
21 hours
( 14 JUNE 2006 (a.m.))

INSTRUCTIONS TO CANDIDATES

I. This paper consists of THREE sections.

2. Answer ALL questions.

Copyright © 2005 Caribbean Examinations Council ®


All rights reserved.

022 150 10/CAPE 2006


-2-

SECTION A

MODULE 1: S OFTWARE AND SYSTEM DEVELOPMENT

Answer ALL questions in this section.

1. One of the most widely known models of a software development process is the waterfall model,
which is sometimes called the software life cycle.

(a) Explain what is a software development process. l2 marks)


(b) Describe THREE major stages of the waterfal l model. [6 marks]

(c) Outline a major weakness of the waterfall model. [2 marks)

TotallO marks

2. A large company has several branches in North America and the Caribbean. The company is about to
replace a key software system that is heavily used throughout the company with a new system that
uses modern technology. Sunil and Camille, the lead developers in the project, are considering whether
to use interviews or questionnaires to gather information during analysis.

(a) Explain what is involved in conducting interviews and administering questionnaires to collect
information during analysis. [4 marks]

(b) Sunil argues that interviews would be better to obtain the required information. Give ONE
reason to support his argument. [2 marks]

(c) Camille feels that questionnaires would be more appropriate. Give TWO reasons to support
her claim. [4 marks]

Total tO marks

3. (a) Briefly explain what is a CASE tool. [2 marks]

(b) Describe THREE ways in which a CASE tool can be used in a software process.
[6 marks]

(c) State ONE advantage and ONE disadvantage of using a CASE tool. [2 marks]

Total 10 marks

GO ON TO THE NEXT PAGE


022 1501 0/CAPE 2006
-3-

4. Architectural design is an important design process activity which involves system structuring and
modular decomposition.

(a) Explain what happens during system structuring. [2 marks)

(b) State what happens during modular decomposition. [1 mark]

(c) Distinguish between a sub-system and a module. [4 marks]

(d) Describe the output of the architectural design activity. [3 marks]

Total 10 marks

5. (a) Outline THREE guidelines for designing a user interface. [6 marks]

(b) Briefly describe TWO guidelines for designing a report. [4 marks]

Total 10 marks

GO ON TO THE NEXT PAGE


0221 501 0/CAPE 2006
-4-

SECTION B

M ODULE 2: PROGRAMMING LANGUAGES

Answer ALL questions in this section.

6. (a) An Account class has two instance variables, number and balance. It has two methods, withdraw
(amount) and deposit (amount). Draw this information in a class diagram. [4 marks]

(b) In an object-oriented program, a Customer object, C, needs to send a withdraw message to a


related Account object, A.

Explain how this can be achieved. [2 marks]

(c) Explain what is meant by the term inheritance as used in object-oriented programming.
[4 marks]

TotallO marks

7. (a) Distinguish between the following terms as used in object-oriented programming:

(i) Object and class

(ii) Private method and public method

(iii) Accessor (or getter) and mutator (or setter) methods. [6 marks]

(b) Explain the technique of encapsulation in object-oriented programming. [2 marks]

(c) "Public instance variables violate encapsulation". Explain this statement. [2 marks]

Total 10 marks

8. (a) Identify TWO other ways of categorizing programming languages apart from classifying
programming languages by generations. [2 marks]

(b) Compilers and interpreters are both language translators. State TWO reasons why a compiler
is preferred over an interpreter. (4 marks]

(c) In developing a program to solve a particular problem, an appropriate high-level language is


usually chosen. State FOUR criteria that should be considered when choosing a programming
language. [4 marks]

Total l Omarks

GO ON TO THE NEXT PAGE


0221501 0/CAPE 2006
-5-

9. Trace through the execution of the following algorithm and draw the output in your answer booklet
exactly as would be generated by the algorithm. You should carefully note the following:

• printSpaces(n) prints n spaces from the current cursor position


• print co11tinues output on the cunent line from the cun·ent cursor position
• println causes output on the current line to be terminated, and subsequent output begins on a
new line

set SIZE= 10

for i =1 to SIZE
print (" *")
end for
println ()

fori= 1 to 3
print (" *")
printSpaces (SIZE - 2)
println ("*")
endfor

for i = l to SIZE
print ("*")
endfor
println ()

TotallO marks

10. You are required to write an algorithm that prints all the odd numbers between 1 and I 00 (inclusive).

(a) Write an algorithm that uses bounded iteration to solve this problem. [5 marks]

(b) Write an algorithm that uses unbounded iteration to solve this problem. [5 marks]

TotallO marks

GO ON TO THE NEXT PAGE


0221501 0/CAPE 2006
-6-

SECTION C

MODULE 3: PROGRAM D EVELOPMENT

An swer ALL questions in this section.

11. A dialog box .is needed to perform a specific task. This task requires a user to enter two integers and
the dialog box displays a message that says which is the larger of the two integers.

Draw a clearly labelled dialog box that would be appropriate for performing the required task. The
dialog box should contain at least one of EACH of the following:

(i) Textfield
(ii) Window
(iii) Font
(iv) Label
(v) Button

TotallO marks

12. Five elements were inserted into a queue QJ that was initially empty. Figure 1 below shows the queue
after the fifth element was inserted.

Figure 1: Queue QJ

2 3 4 5

(a) What is the first number that was inserted into QJ? [lmark]

(b) State TWO ADT operations of a queue. [2 marks]

(c) Using only queue ADT operations, write an algorithm to remove the elements ofQI and place
them in a second queue called Q2. Assume that Q2 is initially empty. [5 marks]

(d) Draw a diagram simi lar to the one above showing the elements of Q2 after three clements
have been moved from Ql to Q2. [2 marks]

Total 10 m a rks

GO ON TO THE NEXT PAGE


022150 I 0/CA PE 2006
-7-

13. A Job object in a human resource application has THREE instance variables:

- title (a string representing the name of the job, e.g. "Software Engineer")

- description (a string containing a detailed description of the job)

- salary (the starting salary of the job)

ln addition to an appropriate constructor, the Job object contains the following methods:

setDescription: accepts a parameter, jobDescr (a string value) and sets the description of the Job
object to jobDescr

increaseSalary: accepts a parameter amount representing a percentage increase in salary (e.g. I0.5
represents a 10.5% increase in salary) and increases the salary of the Job object by
amount per cent.

Using an object-oriented programming language of your choice, write the code to define the Job
class.
Total l Omarks

14. Many tools exist to simplify the process of creating computer programs. One such tool is a tracer.

(a) Name FOUR other tools that are typically provided in a programming environment.
[4 marks]

(b) Briefly explain how any THREE of the tools named in 14 (a) above can aid in the develop-
ment of a computer program. [6 marks]

TotallO marks

15. An unknown number of positive integers are stored in a stackS. Using only stack ADT operations,
write an algorithm to find the sum of every other element inS. For example, if S contains ten elements
as fol lows:

1 2 3 4 5 6 7 8 9 10

the algorithm finds the sum of 1 + 3 + 5 + 7 + 9.

TotallO marks

ENDOF TEST

02215010/CAPE 2006
TEST CODE 02215020
FORM TP 2006194 MAY/JUNE 2006

C ARIBB E A N EXA M I N ATIO NS CO UN CIL


ADVANCED PROFICIENCY EXAMINATION
COMPUTER SCIENCE
UNIT 2 - SOFTWARE ENGINEERING AND PROGRAMMING
PAPE R02

11hours
( 07 JUNE 2006 (a.m.) )

INSTRUCTIONS TO CANDIDAT ES

1. This paper consists of THREE sections.

2. Answer ONE question from E AC H section.

Copyright © 2005 Caribbean Examinations Council ®


All rights reserved.

02215020/CAPE 2006
-2-

SECTION A

MODULE 1: SOFTWARE AND SYSTEM DEVELOPMENT

Answer ONE question from this section.

I. (a) A certain company rents costumes to customers. Customers submit orders for renting costumes.
An order is processed by checking if the desired costumes are available in the inventory
(given the rental dates) and checking the customer file for credit information. If the order is
accepted, it is stored in an orders file. At the appropriate time to ship the items to the customer,
a shipment process reads the orders file, and using the address of the customer from the
customer file, sends the cosh1mes to the customer with an accompanying invoice. At the
same time, the inventory is updated with the rental information.

Draw a level-0 data flow diagram that depicts the above scenario. [16 marks]

(b) (i) State TWO advantages of the evolutionary approach to software development.
[2 marks]

(ii) Discuss TWO weaknesses of the evolutionary approach. [6 marks]

(c) (i) Discuss the reuse-oriented approach for developing software. (4 marks]

(ii) State TWO advantages of the reuse-oriented approach. (2 marks]

Total 30 marks

2. (a) A conceptual data model is a representation of an organization 's data. During analysis, it is
common to obtain a conceptual data model using a technique known as entity-relationship
modelling.

(i) Describe THREE main components of an entity-relationship model.


[6 marks]

(ii) State TWO sources where a systems analyst can get infonnation to draw an entity-
relationship model. [2 marks]

(iii) A certain bank has many customers who may choose to open one or more accounts.
Data stored on accounts include account number and balance. A customer can open
more than one account and an account can be owned by more than one customer.
Withdrawals and deposits may be performed on each account. When a withdrawal or
deposit takes place, the amount and date of the transaction is recorded.

Draw an entity-relationship model based on the above narrative. [16 marksj

(b) A data dictionary is often used to supplement the infonnation contained in an entity-relationship
model.

(i) Explain what is a data dictionary. [3 marks]

(ii) Describe the contents of an entry made in the data dictionary. [3 marks]

Total 30 marks

GO ON TO THE NEXT PAGE


02215020/CAPE 2006
- 3-

SECTIO N B

MODULE 2: PROGRAMM ING LANGUAGES

Answer ONE question from this section .

3. (a) Assume that an anay arr is filled to capacity with 100 integers.

(i) Write a recursive function in pseudocode to search arr for a value called key. If key is
present in arr then your function should retum the location at which it was found. If
key is not fOtmd in arr, your function should return the value -1.
lll marks]
(ii) Write a segment of code that prompts the user for key, and then calls the search func-
tion in 3 (a) (i) above to look for key. If key is not found print an enor message,
otherwise print the location at which it was fotmd. (5 marks]

(b) Identify and describe FOUR steps (or stages) of the object-oriented process.
[8 marks]

(c) Janet's Computer Science instructor advised her to always aim for portability and
maintainability when writing her computer programs. Explain why it is a good idea to always
write programs that are portable and maintainable. [6 marks j

Tota l 30 marks

4. (a) A list called Ll is filled to capacity with 100 elements. A second list L2, of size 150, has 20
elements loaded in its first 20 locations, and its remaining 130 locations are empty.

Write an algorithm to move the elements of Ll and place them in L2 starting from the first
location inL2. The existing elements in L2 must not be erased, but should be placed immedi-
ately after the elements that came from Ll. At the end of the algorithm, erase the values in Ll,
by setting all its elements to zero. [9 marks]

(b) Assume that LJ is filled with 100 integer elements. Write an algorithm to reverse the ele-
ments of Ll. [7 marks]

(c) Describe the following:

(i) 2nd generation programming languages

(ii) J'd generation programming languages l6 marksl


(d) What is meant by structured programming? l4 marks]
(c) Explain bow a program written in a hjgh-levcllanguage is executed on a computer.
[4 m arks]

Total 30 ma rks

GO ON TO THE NEXT PAGE


02215020/CAPE 2006
-4-

SECTIONC

MODULE 3: PROGRAM DEVELOPMENT

Answer ONE question from this section.

5. A GUI program is needed for calculating simple interest as well as the monthly instalment on bank
loans. The GUI should allow the user to enter a principal amount to be borrowed, the interest rate as
a percentage, and the loan amount in years. Using tllis data, the GUl calculates and displays the total
amount of interest to be paid on the loan and the monthly instalment to be paid to the bank.

The following formula is used for calculating simple interest:

Simple Interest= (Principal x Rate x Time) I 100, where Time is in years

The monthly instalment is calculated as follows:

Monthly Instalment= (Principal+ Simple Interest) I (Timex 12), where Time is in years

This question requires you to design and implement the GUI for calculating simple interest. Note that
you are required to use an appropriate GUl object called L for entering the Year, where L allows a user
to pick a value from 1 to 30, instead of having to type it in.

(a) Identify the GUI objects that you would use in this application and state the purpose of EACH
~ ~~~

(b) Draw the layout of the GUI and label the GU1 objects identified in 5 (a) above.
[4 marks]

(c) Explain TWO events that the program should anticipate. [4 marks]

(d) Write the code to create L, populate it with the numbers 1 through 30 and then place it on the
GUI. [6 marks]

(e) Write the code to retrieve the relevant data entered by the user and calculate the Simple Inter-
est, which is then displayed in the corresponding GUI component. [6 marks]

(f) Using the result calculated for Simple Interest in 5 (e) above, write the code to calculate the
monthly instalment on the loan and then display it in the corresponding GUI component.
[4 marks]

Total30 marks

GO ON TO THE NEXT PAGE


022I50201CAPE 2006
-5-

6. A company wishes to keep information on the products that it sells. For each product, the following
data must be stored:

name: The name of the product


inventory amount: The amount of the product cunently in stock
reorder level: The reorder level quantity. If the inventory amount is less than the reorder level
then the product should be reordered
price: The cost of the product

(a) Write the code for a l:'roduct class that includes the instance variables named above. The
Product class must provide a suitable constmctor, accessors (getters) for the instance vari-
ables, and a toStringO method that returns a string containing all the data stored within a
Product object. In addition, the Product class must provide the following two methods:

Method Parameters Functionality

reduceltems amt (an integer) Checks to see if am t does not exceed the
amount in stock (i.e. the inventory
amount) of the product. If amt is less
than or equal to the amount in stock, then
reduce amount in stock by amt. Other-
wise print an appropriate enor message.

reorder() none Returns tme if the product needs to be


reordered and false otherwise.

[16 marks]

(b) Write a fragment of code to do the following:

(i) Create TWO (2) Product objects using data of your choice and store them in separate
object variables. [2 marks]

(ii) Create or instantiate a NAMED data structure for storing all the Product objects in
the application, and then put the two Product objects created in 6 (b) (i) in this data
stn1cture. (3 marks I

(iii) Print out the names of all the Product objects that have to be reordered.
rs marks]
(c) The company wishes lo reuse the Product class in another application, but would like to
implement the reorderO method differently as well as add a few more instance variables.
Discuss the easiest way to reuse the functionality of the Product class.
[4 marks]

Total30 marks

END OF TEST

02215020/CAPE 2006
TEST CODE 02115020
FORM TP 2008175 MAY/JUNE 2008

CARIBBEAN EXAMINATIONS COUNCIL

ADVANCED PROFICIENCY EXAMINATION


C O M PU T E R SCIENCE

U N IT 1 - INFO R M ATIO N SYSTEM


£MSS

PAPER 02

1~ hours

a.m.) J)
Q 16 MAY 2008 (a.

INSTRUCTIONS TO CANDIDATES

1. This paper consists of THREE sections.

2. Answer ONE question from EACH section.

Copyright © 2007 Caribbean Examinations Council®.


All rights reserved.
02115020/CAPE 2008
-2-

SECTION A

M ODULE 1: COM PONENTS OF COMPUTER SYSTEMS


Answer O NE question from this section.

1. (a) Explain why extranets are generally more insecure than intranets. [ 4 marks]

(b) Describe ONE example of software that can be stored in


(i) ROM

(ii) RAM. [ 4 ma r ks]

(c) Whi le John was in the USA, he decided to purchase an exlernal CD-ROM drive for
his friend , Peter. When he retumed and gave Peter the drive, it would not work on
Peter's computer. Explain TWO reasons why the drive may not have worked.
[ 4 marks]

(d) Describe and give ONE example of

(i) syslems software

(ii) application software. [ 6 ma r ks]

(e) (i) What are deadlocks? Describe an example where a deadlock can occur in an
operating system. [ 4 marks]

(ii) Explain how an interrupt is handled in the operating system of a computer.


[ 4 ma rks]

(iii) Describe TWO functions that a typical disk management utility should be able
to perform. [ 4 marks]

Total 30 mar ks

2. (a) Discuss what happens at the sending computer wht:.n the OSI model for networking is
involved in the transmission of a text file from one computer to another computer. Use
a diagram in your response, clearly showing the direction of flow of data using the OSI
model. [12 marks]

(b) Differentiate between 'HITP' and 'FfP' . [ 6 ma r ks]

(c) Explain how EACH of the following approaches can be used to share files over the
Internet.

(i) Client/server

(ii) Peer-to-peer [ 6marks]

(d) Explain THREE reasons why a distributed network configuration may be preferred
rather than a centralised configuration. [ 6 marks]

Tota l 30 marks

GO ON TO THE NEXT PAGE


02115020/CAPE 2008
-3-

SECTION B

MODULE 2: APPLICATIONS OF COMPUTERS

Answer ONE question from this section.

3. (a) Management at a certain cafeteria has decided to install vending machines for customers
to purchase snacks and drinks. The vending machines contain small computer applications
that are responsible for dispensing the item requested to the customer and returning
change, if necessary.

(i) D iscuss TWO economic implications of installi ng the vending machines.


[ 4 marks]

(ii) Discuss TWO social implications of installing the vending machines.


[ 4 ma rks]

(b) In a certain business, the clerical assistants keep track of customer records using manual
paper files. The manager of the company recently became aware of the benefits of
computer technology and quickly introduced computers in her business. She also
instructed the clerical assistants to use ONLY computer applications for storing
customers' data from now on.

(i) Discuss ONE reason why the manager may have made a mistake in her decision
to use only computer applications to store the customers' records. [ 3 mnrks]

(ii) Suggest TWO advantages of using computer applications to store the customers'
records. [ 4 ma rks]

(c) At a certain university, the principal ruled that the university's management has the
right to view the emails of all lecturers. Some lecturers did not agree.

Briefly discuss ONE reason to support the principal's ruling and ONE reason why the
lecturers may have disagreed with the principal's ruling. [ 6 marks]

(d) (i) Discuss TWO ways to help prevent or control the unauthorized disclosure of
data in an organization. [ 6 marks]

(ii) An organization may employ passwords to prevent unauthorized access to


files on its Web site.

Describe ONE other strategy that can be used to prevent unauthorized access
to files on its Web site. [ 3 marks]

Total 30 m a rks

GO ON TO THE NEXT PAGE


02115020/CAPE 2008
- 4-

4. (a) Explain what is meant by 'real-time updating of files' in a computer application and
outline ONE situation where this approach to updating files is necessary. [ 3 marks]

(b) Kiran, the manager of a retail store, recently had some problems with the computer
system being used at the store. A computer consultant examined the system and told
Kiran, ' You have data loss and data corruption in your computer system. There has
also been unauthorized access.'

(i) Explain the meaning of EACH of the underlined terms. [ 3 marks]

(ii) For EACH of the underlined problems, suggest ONE way in which the
computer consultant may have determined the existence of that problem.
[ 6 marks]

(c) (i) Describe TWO strategies that can be used to back-up critical data in a government
organization located in a country lying in a region prone to hurricanes.
[ 6 marks]

(ii) Suppose a hurricane occurs and destroys all the computer systems and associated
data in the organization mentioned in (c) (i) above. Describe the steps that can
be taken to restore the computer systems and data, for ONE of the strategies
described in (c) (i) above. [ 4 marks]

(d) Suggest TWO ways in which computer applications designed for the strategic level of
an organization differ from computer applications designed for the operational level.
[ 4 marks]

(e) State TWO advantages of videoconferencing over email as a means of communicating


information. [ 4 marks]

Total 30 marks

GO ON TO THE NEXT PAGE


02115020/CAPE 2008
- 5-

SECTIONC

MODULE 3: COMPUTER-BASED PROBLEM SOLVING

Answer ONE question from this section.

5. (a) Professional organizations that publish scholarly articles are increasingly making these
articles available online to readers who subscribe to their digital libraries. Previously,
these readers may have obtained the articles through paper subscriptions or through a
traditional library.

(i) Describe TWO benefits of a digital library to readers who subscribe to the
service. [ 4 marks]

(ii) Describe TWO benefits of a digital library to organiza tions tha t publish the
scholarly articles. [ 4 marks]

(b) Explain how EACH of the followi ng characteristics affects the usefulness and value of
information:

(i) Accuracy [ 3 ma rks]

(ii) Depth of coverage [ 3 marks]

(iii) Bias [ 3 marks]

(c) Diana lives on a hilltop that is visible from several surrounding communities. A local
cellular phone provider has approached Diana to rent part of her property to install
a cellular tower. Diana is very happy with the amount of rental income that she will
receive. However, she is worried about the negative remarks she recently heard on
television about the health risks of cellular towers.

Discuss THREE sources of information that Diana can use to get more rei iable informa-
tion on the health risks of cellular lowers. [ 9 mar"ks]

(d) Briefly discuss the validity of the following statements:

(i) Information on the Internet is reliable since it must be refereed before it is


placed on the Internet. [ 2 marks]

(ii) Information on the Internet is always current since it is available to users as


soon as it is placed on the Internet. [ 2 marks]

Total 30 marks

GO ON TO THE NEXT PAGE


02115020/CAPE 2008
- 6-

6. (a) A local foreign-used car dealership sells five different types of cars. At the end of each
month, salespersons are required to submit to management the amount of each type of
car sold. Management would like to use this information to generate summaries of the
cars sold such as:

• the total number of cars sold per month


• the average number of cars of each type sold per month
• the total number of cars sold per year
• the number of cars sold in each type per year
• the average monthly sales of each type of car

(j) Design the layout of a spreadsheet to generate the requh·ed summary information,
CLEARLY specifying the formulae that you will use in the spreadsheet.
[10 ma r ks]

(ii) Describe TWO types of graphs that can be generated from the spreadsheet to
make it easier for management to grasp trends in the sales information.
[ 4 marks]

(b) Management at a certain private hospital needs to keep information on its patients
such as personal information, appointments, attending doctors, diagnoses and
treatment administered. Several thousand patients have visited the hospital since its
inception.

(i) What is the BEST computer-based tool that can be used to store the information
specified above? [ 1 mar k]

(ii) Discuss FIVE features of the tool that make it appropriate for managing patient
information in a hospital context. [IS marks]

Total 30 marks

ENDOFTEST

021 15020/CAPE 2008


TEST CODE 22115020
FORM TP 2008175 MAY/JUNE 2008
CARIBBEAN EXAMINATIONS COUNCIL
ADVANCED PROFICIENCY EXAMINATION
COMPUTER SCIENCE
UNIT 1 - INFORMATION SYSTEMS
PAPER 02
l j hours
17 JULY 2008 (p.^ 7 )

INSTRUCTIONS TO CANDIDATES
1. This paper consists of THREE sections.
2. Answer ONE question from EACH section.

SI 75

Copyright © 2008 Caribbean Examinations Council®.


All rights reserved.
22115020/CAPE 2008
- 2-

SECTION A
MODULE 1: COMPONENTS OF COMPUTER SYSTEMS
Answer ONE question from this section.

1. (a) (i) State TWO characteristics of ROM. [ 2mar ks]

(ii) Distinguish between ROM and PROM ( 2marks]

(b) You are using a friend's computer to type your school-based assessment. When you
have fi nished, you realize that your friend 's printer is not working. Your friend finds
a floppy diskette in a drawer, and as she is about to insert the diskette to save the file,
you stop her from doing so.

(i) Describe TWO of your concerns regarding the use of the floppy diskette.
[ 4 marks]

(ii) Explain how you would address EACH concern that you have identified.
[ 4 marks]

(iii) Suggest ONE other secondary storage device that would be appropriate in this
case. Justify your response. [ 4 marks]

(iv) Your friend had Internet access. Explain ONE other way that you could have
saved your file to print later. [ 2 marks]

(c) You have received the latest computer racing game un a CD as a gift. The game runs
properly on your neighbour's new computer, but does NOT run at all on your computer.

(i) Give TWO likely reasons why the game works on your neighbour 's computer,
but does not work on your computer. [ 4 marks]

(ii) For EACH of the reasons, given at (c) (i) explain what you may need to do, so
that the game works on your computer [ 2 marks]

(d) Name and briefly describe TWO types of user interfaces. [ 6marks]

Total 30 marks

GO ON TO THE NEXT PAGE


22l15020/CAPE 2008
- 3-

2. (a) The Accounting Department of a company has 12 computers. Eleven of the computers
can only exchange messages with each other via the twelfth computer.

(i) State the type of network that this department is using. [ 1 mark]

(ii) State the term used to describe the twelfth computer. [ 1 mark]

(iii) Sketch and label the network identified in (a) (i) , clearly illustrating the
connections of the workstations or nodes. [ 4 marks]

(iv) Explajn TWO situations that would cause the network to fail. [ 3marks]

(v) Sketch TWO other network topologies and discuss ONE advantage and ONE
disadvantage of EACH. [ 8 marks]

(b) One of your colleagues in another country has completed her part of a project and you
need to download the file to your computer using communications hardware and a suitable
networking protocol.

(i) Define the term ' networking protocol ' . [ 2marks]

(ii) Identify the networking protocol that can be used to retrieve the file.
[ 1 mark]

(iii) Explain how the protocol you identified in (b) (ii) above works to retrieve the
file. [ 8 marks]

(c) Explain the role of a router. [ 2marks]

Total 30 m arks

GO ON TO THE NEXT PAGE


22115020/CAPE 2008
-4-

SECTIONB

MODULE 2: APPLICATIONS OF COMPUTERS

Answer ONE question from this section.

3. (a) 1\venty years ago, customers would form long lines in banks to conduct their business
of deposits and withdrawals of funds. Recently, many banks have introduced banking
machines in public areas, such as supermarkets and shopping malls, to service these
routine tasks.

Describe TWO benefits and TWO challenges of introducing the banking machine to
customers [ 8 marks]

(b) Telecommuting is an option that some employees consider, and there are some advantages
and challenges.

(i) Explain what is meant by 'telecommuting'. [ 2 marks]

(ii) Describe TWO benefits and TWO challenges of telecommuting for the employer.
[ 8 marks]

(iii) Describe TWO conditions that are required for telecommuting to be successful.
[ 4 marks]

(c) Identity theft bas become a big social issue world wide. A common attack method is to
create a website that appears to be authentic and prompt users for their Identity and
password details. Another technique is to create an email which appears to come from
an authentic organization like a bank or credit card issuer, requesting the confirmation
of account numbers and other personal information. This information is later used by
hackers to make large purchases or even completely take over a person's identity.

(i) Discuss TWO ways in which Intemet users can protect themselves from identity
theft. [ 4 marks]

(ii) Discuss TWO precautions that one can take when making purchases on the
Internet, using a credit card. [ 4 marks]

Total30 marks

GO ON TO THE NEXT PAGE


22115020/CAPE 2008
-5-

4. Ten years ago, Mrs Mcintosh opened a small department store in Jamaica, selling a range of
small and large household appliances. Her business has grown steadily and now she has 11
outlets across the island, as well as an outlet each in St. Lucia and Dominica.

(a) Discuss THREE application areas of the business where the data processing needs would
have changed. [ 9 marks]

(b) For TWO of the application areas discussed in (a), describe how innovations in
information technology would have facilitated the changing needs of the business over
the ten years. [ 6 marks]

(c) (i) Discuss TWO kinds of information processing activities that would take place
at the operational and strategic levels of Mrs Mcintosh's business.
[ 6 marks]
(ii) Identify THREE types of information systems that could be used at the business
and describe the oatu1·e of the processing that would be performed by EACH
one.
[ 9 marks]

Total 30 marks

SECTIONC
MODULE 3: COMPUTER-BASED PROBLEM SOLVING

Answer ONE question from this section.

5. (a) You have been asked to collect medical data on persons who live in a certain part of a
Caribbean country. The data to be collected should include name, age, marital status
and illnesses suffered in the previous five years.
(i) Identify FOUR techniques that can be used to gather the required data.
[ 4 marks]

(ii) Describe TWO of the techniques that you identified in 5 (a) (i), clearly stating
how EACH is administered or used . [ 8 marks]
(ill) For EACH of the techniques identified in 5 (a) (i), state ONE problem that may
be encountered when using that approach for gathering data. [ 4 marks]

(iv) For TWO of the techniques identified in 5 (a) (i), describe ONE advantage of
using EACH technique. [ 4 marks]
(b) Explain, with the aid of an example, what is meant by the term 'breadth of coverage', as
it pertains to an information source. [ 3 marks]

(c) What is the relationship between a 'digital library' and an 'electronic database' ?
[ 2 marks]
(d) List FIVE reasons why information derived from an electoral manifesto may be mis-
leading. [ 5 marks]

Total 30 marks

GO ON TO THE NEXT PAGE


22115020/CAPE 2008
- 6-

6. At a certain university, the staff members need to access information on students (for example,
name, address, marital status and comses). The university's governing council requires sum-
mary information on the number of students in the university, their country of origin, the comses
being offered, and the fees paid.

(a) (i) Identify the MOST appropriate software tool for storing and retrieving infor-
mation on students and their courses of study. [ 1 mark ]

(ii) Describe THREE features of the software tool chosen in 6 (a) (i), that make it
suitable for this task. [ 9 marks]

(b) (i) Identify the MOST appropriate software tool for analysing and generating
summary information on students. [ 1 mark]

(ii) Discuss TWO features of the software tool chosen in 6 (b) (i), that make it
MOST appropriate for this task. [ 6 marks]

(c) The Chancellor of the university is requi1·ed to make a presentation to a group of regional
leaders on students registered for each graduate and post-graduate programme. Describe
how the presentation should be put together using appropriate software tools.
[ 6 marks]

(d) The university periodically sends newsletters to its former students, and often sends
brochures on new programmes offered at the post-graduate level.

(i) Identify the MOST appropriate software tool for produdng the newsletters
and brochures. [ 1 mark ]

(ii) Justify your selection of the software tool in d (i) by discussing TWO reasons
for the choice. [ 6 marks]

Total 30 marks

ENDOF TEST

22115020/CAPE 2008
,
TEST CODE 02115020
FORM TP 2009166 MAY/JUNE 2009

CARIBBEAN EXAMINATIONS COUNCIL


ADVANCED PROFICIENCY EXAMINATION
COMPUTER SCIENCE
UNIT 1 - FUNDAMENTALS OF COMPUTER SCIENCE
PAPER02
21 hours
( 15 MAY 2009 (a.m.) )

INSTRUCTIONS TO CANDIDATES

1. Do NOT open this examination paper until instructed to do so.

2. Answer ALL questions from the THREE sections.

Copyright© 2008 Caribbean Exam inations Council ®.


A ll rights reserved.
02115020/CAPE 2009
-2-

SECTION A

COMPUTER ARCIDTECTURE AND ORGANISATION

Answer BOTH questions.

1. (a) Draw the symbol and give the corresponding truth table for THREE primary logic gates.
r 6 marksl
(b) The following is the truth table for an exclusive-OR gate:

X y z
0 0 0
0 1 1
1 0 1
1 0

Using the primary logic gates from (a) above, de ign and draw a circuit which behaves
exactly like an exclusive-OR gate. [ 6 marks]

(c) Draw a clearly labelled block diagram of a 4 x I multiplexer (4 inputs. I output).


[ 6 marks]

(d) (i) Calculate the decimal equivalent of 00011011 2 . [ 1 mark ]

(ii) Determine if the result of 0111 + llJ 0 can be stored as a 4 bit binary number.
[ 2 marks]

( iii) Showing all working, find the largest and smallest integers that can be represented
using 4 bits signed magnitude.

Hint: the leftmost bit is to be used for the sign and the other bits are used for
representing the integer itself. [ 2 marks]

(iv) Find the 4 bit two's complement of -5. [ 2 marks]

Total 25 marks

GO ON TO THE NEXT PAGE


02115020/CAPE 2009
-3-

2. (a) Explain what is meant by EACH of the following terms:

(i) Word size


(ii) Cache memory
(iii) Clock speed
[ 6 marks]

(b) Distinguish between EACH of the following pairs of terms as they pertain to computer
memory:

(i) ROMandRAM
(ii) Access speed and access method
(iii) Volatility and capacity [ 6 marks]

(c) (i) Define the terms, 'instruction set' and 'instruction formaf. [ 2 marks]

(i i) State THREE types of instructions that arc typically included in an instruction set.
[ 3 marks]

(iii) Suppose 16 bits are used for representing instructions in a certain computer. Using
a diagram, explain how a 2-address instruction can be formatted using the 16 bits
available. [ 3 marks]

(iv) Describe what happens in a typical instruction cycle, assuming that direct addressing
is used. [ 5 marks]

Total 25 marks

GO ON TO THE NEXT PAGE


02115020/CAPE 2009
-4-

SECTION B

PROBLEM SOLVING WITH COMPUTERS

Answer BOTH questions.

3. (a) What is an algorithm? [ 2 marks]

(b) Name THREE basic control constructs used in structured programming. [ 3 marks]

(c) The algorithm below is designed to generate, print and count the odd numbers between
I (inclus ive) to 99 (inclusive). However there arc errors.

1. begin
2. j =2
3. c =1
4. while ( j < 99)
5. print j
6. j=J + 2
7. c= c + 1
8. endwhile
9. print (' c =. c)
,
10. print ( 'j = , j)
II. end

(i) What are the final values in the variables c and j when the algorithm terminates?
[ 2 marks]

(ii) By refening to the specific line number :

ldeotjfy and correct the errors in the algorithm. [ 6 mar ks]

(iii) Using the corrected algorithm. give the value of variable cat the end of execution.
[ 1 m a rk ]

GO ON TO THE NEXT PAGE


021 J5020/CAPE 2009
-5-

(d) Construct a flowchart to represent the following algorithm.

begin
read name
if name = 'enddata'
print 'no data supplied'
else
while name <> 'enddata'
read amount
read quantity
sale = amount * quantity
print 'This sale = ' . sale
read name
end while
endif
end

[11 marks]

Total 25 marks

GO ON TO THE NEXT PAGE


02115020/CAPE 2009
-6 -

4. (a) BuyLo is a grocery. Management has decided that it needs to track aJJ the goods that
are sold on a daily basis by using a computer-based solution.

Discuss what the' Identifying and evaluating possible solutions' stage of problem solving
would involve for BuyLo. [ 6 marks]

(b) Trace through the execution of the following algorithm and draw the output in your
answer booklet exactly as i t would be generated by the algorithm. You should carefully
note the following:

• printSpaces(n) prints n spaces from the current cursor position, use a dash ' - ' to
indicate a space
• print continues output on the current line f rom the current cursor position
• println conti nues output on the current line from the current cursor position but any
subsequent output begins on a new line

SIZE= 10
begin
printSpaces ( SIZE)
println (' *')
j = SIZE-2
whi lej >= 0
begin
printSpaces ( j + I )
print ( ' * ')
printSpaces ( 8 - j )
println ( ' * ' )
j =j - I
endwhi le
for j = I to (SIZE + 1 ) do
print ( ' * ')
end for
println ()
end
[11 mar ks]

(c) Write an algorithm that uses repetition to find the sum of all multiples of 7 between 14
(inclusive) and 126 (inclusive). [ 8 marks]

Total 25 mar ks

GO ON TO THE NEXT PAGE


02115020/CA PE 2009
- 7-

SECTION C

PROGRAM:MING

Answer BOTH questions.

5. (a) Describe the 'lexical analysis' and 'semantic analysis ' stages of the translation process.
[ 6 marks]

(b) Write a C function which accepts two integer parameters, a and b, and returns the larger of
the two. Assume the integers are different. [ 4 marks]

(c) Write a C program with the following functionality. The steps MUST be followed exactly
as stated.

Accept 10 integers from the user and place them in a lext file 'in.dat', one integer per line.
Assume all integers are valid.

Close the file 'in.dat', reopen it, read the data and find and print the average oftbe integers
stored in the file.

Print an appropriate message if the file cannot be found .

[Note: You cannot use arrays to solve this problem.]


[15 marks]

Total 25 marks

GO ON TO THE NEXT PAGE


02115020/CAPE 2009
- 8-

6. (a) Briefly describe EACH of the following classifications of programming languages:

(i) Declarative
(ii) Imperative (procedural)
(iii) Scripting
[ 6 marks]

(b) Distinguish between 'syntax' and 'semantics' as used in computer programming.


[ 3 m arks]

(c) You are given the following declarations in a C program:

struct payRec {
long int id:
float totaiPay;
int nurnDays;
};

void main ( ) I I start of main function


{ intempld;
float pay. rate;
int hrs;
struct payRec Smith, Jones, Singh;

The declaration is used to create records to manipulate data on three employees Smith,
Jones and Singh. working for a small company. 'id' represent the identification number of
the employee, 'totalPay' the amount of money he earns, 'numDays' the number of days
worked and 'rate· the hourly rate of pay. Assume that Smith's id is 1000, Jones' id is I 00 I
and Singh's id is 1002 and all numDays fields are set to 0 initially.

Using the C program declaration, complete the main program by

reading input data (explained later) and updating the totaiPay and numDays fields
for each employee.

prompting the user for id. hr and rate. Calculate the salary by multiplying hrs by
rate for the employee and adding that result to the totalPay.
NOTE:

An employee can have more than one set of data, where each set COITesponds to a
day worked by the employee.

Data are tem1inated by the sentinel id of 999.

At the end, print each employee id, total pay and number of days worked.

GO ON TO THE NEXT PAGE


021 150201CAPE 2009
.
. ,, '

-9-

Sample scr een:

Please enter ID: 1000


Enter hours worked: I 0
Enter rate of pay: 10.50

Please enter ID: 1000


Enter hours worked: 3
Enter rate of pay: 10.50

Please enter lD: 1001


Enter hours worked: 5
Enter rate of pay: 5.50

Please enter ID: 1002


Enter hours worked: 10
Enter rate of pay: 10.50

Please enter ID: 999


NAME ID TOTAL PAY DAYS WORKED.
Smith 1000 136.50 2
Jones 1001 27.50
Singh 1002 105.00

[16 marks]

Total 25 marks

El\TJ) O F TEST

02115020/CAPE 2009
TEST CODE 02215020
FORM TP 2009168 MAY/JUNE 2009

CARIBBEAN EXAMINATIONS COUNCIL


ADVANCED PROFICIENCY EXAMINATION
COMPUTER SCIENCE
UNIT 2 - FURTHER TOPICS IN COMPUTER SCIENCE
PAPER02

21 hours
( 18 MAY 2009 (p.m.) )

INSTRUCTIONS TO CANDIDATES

1. DO NOT open this examination paper until instructed to do so.

2. Answer ALL questions from the THREE sections.

Copyright© 2008 Caribbean Examinalions Council®.


All rights reserved.
02215020/CAPE 2009
•,

- 2-

SECTION A

DATA STRUCT URES

Answer BOTH questions.

1. (a) The Stack Abstract Data Type (ADT) provides a pop (Stack) operation, a push (Stack.
data) operation, and an isEmpty (Stack) operation.

(i) Suppose that you need to implement a Stack for storing integers. Describe how
you will implement the THREE stack operations above using static computer
storage. [ 4 marks]

(ii) Write the C code for a function that implements the push (Stack, data) operation
assuming that data is an integer value. Your function must deal with stack overflow
conditions. [ 5 marks]

(b) Consider the following algoritlun where expr is a lring containing a postfix expression
(that is, an expression containing '+', ·-·, '*',and '/'characters as well as digits) and n is
the number of characters in expr.

char ch
int digit. X, y

for (i = I ton) begin


ch =expr [i]
if (isdigit (ch)) begin II isDigit returns true if ch is a digit
digit= value (ch) II value returns the integer value of ch
push (stk, digit) II stk is the name of the stack
end
else begin
y =pop (stk)
x =pop (stk)
if (ch ='+') newval =x + y
else if (ch ='-') newval = x- y
else if (ch = '*') newval = x * y
else newval = x I y
push (stk. newval)
end
end
x =pop (stk)
print ("The value of expr is"+ x)

Assume that stk is initially empty. Determine the output of the above algorithm if n is 9
and expr is 923*- 821+.

Draw the stack on EACH iteration of the for loop.


[10 marks]

GO ON TO THE NEXT PAGE


022l5020/CAPE 2009
- 3-

(c) A string is a palindrome if it spells the same way forwards and backwards (for example.
"madam"). Explain how a stack can be used to determine if a string is a palindrome.
[ 6 marks]

Total 25 marks

2. (a) (i) Write a function. !search, which accepts the following parameters

arr, an anay of integers,


n, the amount of elements in arr, and
key, the integer being searched for

and performs a linear search on arr for key. If key is found, yoW' function should
return the location in the array arr, where it was found . Otherwise, it should
return -1 .
[10 marks]

(i i) Assume that key is not present in arr. How many elements in arr will be checked
before -1 is returned? [ 1 mark ]

(b) (i) A function is required that accepts the same parameters and returns the same values
as stated in (a) (i) above. T he function however. performs the binary search on arr.

Using an algorithm or otherwi e, de cribe the Lep that will be performed during
the binary search of arr.
[10 marks]

(ii) Assume that arr contains the following elements (in the order given) and key is
40:

7 10 15 17 18 25 35 37 40 45 50 55 56 57 58 62 63 71 75 78 81

How many elements of arr will be checked before the con·ect location is returned?
Show your working.
[ 4 marks]

Total 25 marks

GO ON TO THE NEXT PAGE


02215020/CAPE 2009
-4-

SECTION B
SOFTWARE ENGINEERING
Answer BOTH questions.

3. (a) (i) Briefly explain what is involved in the evolutionary development of software.
[ 3 marks]
(ii) State TWO problems of using the evolutionruy development approach.
[ 2 marks]
(b) In a typical visit to a doctor, when the doctor consults with the patient, the patient tells the
doctor the symptoms of his/her problem. The doctor uses his/her medical knowledge and
experience together with any historical information avai lable on the pati.e nt (from a patient
file) and makes a diagnosis. This diagnosis is reported to the patient and recorded in the
patient file. Based on the diagnosis, the doctor prescribes a course of medication for the
patient. In order to bill the patient, the doctor submits the Jist of tests and services performed
to the accounting section. The prices for the tests and services are obtained from an
accounting file and the cost of the visit is calculated and recorded in the file. A bill is then
given to the patient.
Draw a Level-0 data flow diagram for the above scenario. (14 marks]
(c) (i) Describe TWO ways in which a CASE tool can be used in a software development
process. [ 4 marks]
(ii) State ONE advantage and ONE disadvantage of using a CASE tool. [ 2 marks]
Total 25 marks

4. (a) (i) What are functional requirements? [ 2 mar ks]

(ii) Discuss how functional requirements are obtained during analysis of a software
system. [ 3 marks]
(b) A certain private hospital bas a number of wards. Several doctors are hired by the hospital
to treat patients who seek medical services. A patient may be seen by one or more doctors
but is assigned to one ward. When a patient is assigned to a ward, the patient is prescribed
one or more drugs for a certain period. The patient's first name, last name, and address are
recorded and a patient id is used to uniquely identify each patient at the hospital.
Draw an entity-relationship model for the above scenario. [14 marks]
(c) A one-dimensional array num consists of 20 integers. The integers are NOT sorted.
Consider C progrrunming code that is written to accept an integer, target, from the user
and detennines if target is present in num. If target is found in num, the location in which
it was found is printed. If target is not present in num, an appropriate error message is
printed.
Briefly describe THREE tests which can be used to determine if the code is working
correctly. [ 6 marks]

Total25 marks

GO ON TO THE NEXT PAGE


02215020/CAPE 2009
·.

-5.

SECTIONC
OPERATING SYSTEMS AND COMPUTER NETWORKS
Answer BOTH questions.

5. (a) Briefly explain how EACH of the following features can aid in network management:
(i) User accounts
(ii) Access logs [ 6 marks]

(b) (i) State the first FOUR layers (that is, layers 1 to 4) of the OS! model for computer
communication. [ 2 marks]

(ii) Explain how EACH of the layers stated in 5(b)(i) above are involved in the
transmission of a large file. [ 8 marks]

(c) Explain how data are communicated in an IEEE802. I I b network? Use a diagram in your
response. [ 7 marks]

(d) Distinguish between the CDMA and TDMA acce method for mobile networks.
[ 2 marks]

Total 25 marks

6. (a) Describe the function of a device driver. [ 3 marks]

(b) What is a hybrid network? [ 2 marks]

(c) A user is working on a document in a word processor and then selects the "Print" option of
the word processor. The document then begins to spool.

(i) Explain what happens dw·ing spooling. [ 3 marks]


(ii) Discuss ONE advantage of spooling. [ 2 marks]

(d) (i) Give ONE reason why a menu interface may be prefen·cd over a command interface.
[ 2 marks]

(ii) Give ONE reason why a command interface may be preferred over a menu interface.
[ 2 marks]

(e) De cribe TWO possible interrupts that can occur while a user is running a game on a
computer. [ 6 marks]

(f) A user is running an application that requires more RAM (Random Access Memory) than
that which is physically installed in the computer. Briefly discuss how the concept of
paging can be used to solve the memory problem experienced by the user. [ 5 marks]

Total 25 marks
ENDOFTEST

02215020/CAPE 2009
TEST CODE 02115020
FORM TP 2010159 MAY/JUNE 2010

CARIBBEAN E XAM I NAT I O N S COUNCIL

ADVANCED PROFICIENCY EXAMINATION


COMPUTER SCIENCE

UNIT 1 – FUNDAMENTALS OF COMPUTER SCIENCE

PAPER 02

2½ hours

14 MAY 2010 (a.m.)

INSTRUCTIONS TO CANDIDATES

1. DO NOT open this examination paper until instructed to do so.

2. Answer ALL questions from the THREE sections.

Copyright © 2009 Caribbean Examinations Council ®.


All rights reserved.

02115020/CAPE 2010
-2-

SECTION A

COMPUTER ARCHITECTURE AND ORGANISATION

Answer BOTH questions.

1. (a) Give the truth tables of the THREE primary logic gates. Your truth tables should be
appropriately labelled. [3 marks]

(b) Explain how a 4-bit binary counter works, clearly specifying the range of values counted.
[4 marks]

(c) (i) Draw a clearly labelled block diagram of a 2-to-4 line decoder. [3 marks]

(ii) Give the truth table of a 2-to-4 line decoder. [2 marks]

(iii) Draw a clearly labelled circuit of a 2-to-4 line decoder constructed from one or
more of the primary logic gates. [6 marks]

(d) (i) Calculate the decimal equivalent of 001010012. [1 mark ]

(ii) Determine if the result of 0110 + 0101 can be stored as a 4-bit binary number.
[2 marks]

(iii) Showing all working, find the largest and smallest integers that can be represented
using 6 bits if signed magnitude is used.

Hint: the leftmost bit is to be used for the sign and the other bits are used for
representing the integer itself. [2 marks]

(iv) Find the 4-bit two’s complement representation of –4. [2 marks]

Total 25 marks

GO ON TO THE NEXT PAGE


02115020/CAPE 2010
-3-

2. (a) Consider the following four devices used for storing data in a computer: ROM, RAM, hard
disk and CD-RW. Compare these four devices in terms of storage capacity and access
speed. [6 marks]

(b) (i) Explain how cache memory works. [2 marks]

(ii) Explain ONE benefit of cache memory. [2 marks]

(c) (i) Explain what is meant by the ‘instruction set’ of a central processing unit.
[2 marks]

(ii) State THREE types of instructions that are typically included in an instruction
set. [3 marks]

(iii)
Instruction formats differ in the number of addresses contained in an instruction.
Using a diagram in EACH case, describe THREE typical instruction formats.
[6 marks]

(iv) Describe the MAIN activities that take place in an instruction cycle.
[4 marks]

Total 25 marks

GO ON TO THE NEXT PAGE


02115020/CAPE 2010
-4-

SECTION B

PROBLEM SOLVING WITH COMPUTERS

Answer BOTH questions.

3. (a) State THREE basic control structures. [3 marks]

(b) Figure 1 shows an algorithm using pseudocode.

pcount = 0 : counter for pineapples


bcount = 0 : counter for bananas
for j = 1 to 100 do
input choice
if choice = ' banana' then
bcount = bcount + 1
else
pcount = pcount + 1
end if
end for
print ' pineapples = ', pcount
print ' bananas = ', bcount

Figure 1

Using the algorithm in Figure 1 above, give an explanation of EACH control structure
stated in (a). [6 marks]

(c) Some programmers prefer to use a graphical form to represent algorithms. Provide a
graphical representation of the algorithm in Figure 1. [7 marks]

(d)
The algorithm in Figure 1 assumes that the choice can only be banana or pineapple. Amend
the algorithm for an additional choice – cherry. In addition, the algorithm should keep a
count of errors made, such as, when a choice is incorrectly spelt or is not one of the three
choices. The counter should be displayed just before the algorithm terminates.
[9 marks]

Total 25 marks

GO ON TO THE NEXT PAGE


02115020/CAPE 2010
-5-

4. (a) Trace through the execution of the following algorithm and draw the output in your answer
booklet, exactly as it would be generated by the algorithm. You should carefully note the
following:

• printSpaces(n) prints n spaces from the current cursor position


• print continues output on the current line from the current cursor position
• println terminates output on the current line at the current cursor position.
Any subsequent output begins on a new line (e.g. line 21)
• println (output-list) outputs ‘output-list’ on the current line and then places
the cursor at beginning of the following line (e.g. line 4)

1. begin
2. SIZE = 10
3. printSpaces ( SIZE )
4. println ( ' * ' )
5. j = SIZE – 2
6. r = 1
7. while ( j > = 5 ) do
8. begin
9. printSpaces ( j + 1 )
10. print ( ' * ' )
11. printSpaces ( r )
12. println ( ' * ' )
13. j = j – 1
14. r = r + 2
15. end
16. for j = 1 to 5 do
17. begin
18. printSpaces ( SIZE )
19. println ( ' * ' )
20. end
21. println
22. end
[11 marks]

(b) Write an algorithm that uses iteration to find the sum of all multiples of 3 and all multiples
of 4 between 3 (inclusive) and 150 (exclusive). [8 marks]

(c) A video club has just purchased software that can be used for tracking DVD rentals, number
in stock, new titles and other system management functions. The software is to be used
at one site only. The company has two computers.

Briefly explain what the ‘Implementation and Review’ stage of the problem solving process
would involve for the video club. [6 marks]

Total 25 marks

GO ON TO THE NEXT PAGE


02115020/CAPE 2010
-6-

SECTION C

PROGRAMMING

Answer BOTH questions.

5. (a)
Explain TWO ways in which a programming language for a mobile device (for example,
a cellular phone) would differ from a programming language for a desktop computer.
[4 marks]

(b) How does a character variable differ from a string variable? [2 marks]

(c) A text file “salary.dat” contains employee records for a company. Each line contains an
employee name 30 characters in length (only surname is stored), hours worked, hourly rate
and deductions. For employee Smith below, hours worked is 100, hourly rate is $10.50
and deduction is $34.75. The number of records is unknown beforehand, but the last line
of the file contains the fictitious name “ENDDATA” only.

A sample salary.dat file containing three records is given below:

Smith 100 10.50 34.75


Jones 20 12 5
Janet 50 30 10
ENDDATA

Write a C program which reads the data and:

• calculates and prints the gross salary for each employee; gross salary is calculated
as hours worked multiplied by hourly rate
• calculates and prints the net pay for each employee (gross pay minus deductions)
• calculates and prints the total overall net pay (the sum of EACH employee’s net pay)

Marks will be awarded for the overall degree of accuracy of your program.
[19 marks]

Total 25 marks

GO ON TO THE NEXT PAGE


02115020/CAPE 2010
-7-

6. (a) The program below demonstrates poor programming style. Describe THREE different
ways in which the programming style can be improved. Use line numbers in your response.


1. # include <stdio.h>

2. void main ( )
3. { int arr [10];
4.
5. int test;
6. float Val;
7. for (J = 0; J < 10; J++) {
8. printf( Please enter integer number %d: '' , J);
9. scanf ( '' %d '' , &arr [J]);
10. }//for
11. }

[6 marks]

(b) What is the purpose of a ‘struct’ in C? [2 marks]

(c) (i) Write a function which accepts two integers, x and y, and returns the larger of
the two. Assume that the integers are unique. Show how your function would be
called. [6 marks]

(ii)
Write a function which accepts a character, ch, and returns 1 if the character is a
letter of the alphabet or 0 otherwise. Show how your function would be called.
[6 marks]

(iii) Write a function which accepts a character, ch, and returns 1 if the character is
present in the string “CAPECOMPUTERSCIENCE”. The function should return
0 if ch is not present in the string. [5 marks]

Total 25 marks

END OF TEST

02115020/CAPE 2010
TEST CODE 02215020
FORM TP 2010161 MAY/JUNE 2010

CARIBBEAN E XAM I NAT I O N S COUNCIL

ADVANCED PROFICIENCY EXAMINATION


COMPUTER SCIENCE

UNIT 2 – FURTHER TOPICS IN COMPUTER SCIENCE

PAPER 02

2½ hours

17 MAY 2010 (p.m.)

INSTRUCTIONS TO CANDIDATES

1. DO NOT open this examination paper until instructed to do so.

2. Answer ALL questions from the THREE sections.

Copyright © 2009 Caribbean Examinations Council ®.


All rights reserved.

02215020/CAPE 2010
-2-

SECTION A

DATA STRUCTURES

Answer BOTH questions.

1. (a) Define the term abstract data type (ADT). [2 marks]

(b) (i) Give an ADT operation that can be used to store an element in a singly linked list.
[1 mark ]

(ii) A singly linked list is created and the following elements are placed in the linked
list in the order given:

25, 50, 75

Draw the list after all three elements have been placed in the list using the ADT
operation at (i) above, clearly indicating the beginning and end of the list.
[3 marks]

(c) The Queue ADT provides an enqueue (Queue, data) operation and a dequeue (Queue)
operation.

(i) Suppose that you need to implement a Queue for storing a set of integer values.
Describe the computer storage that you will use for implementing the queue
operations. [4 marks]

(ii) Write the C code for a function that implements the enqueue (Queue, data)
operation assuming that data is an integer value. Your function must deal with
queue overflow conditions. [5 marks]

(d) The Stack Abstract Data Type (ADT) provides a pop (Stack) operation, a push (Stack,
data) operation, and an isEmpty (Stack) operation.

You are given a queue, q, with a set of elements. Using a stack, stk, write an algorithm to
reverse the order of all the elements in q. Your algorithm must only use Stack and Queue
ADT operations. [6 marks]

(e) A stack can be implemented using a singly linked list.

Explain how the Stack ADT operations will be implemented if a singly linked list is used.
[4 marks]

Total 25 marks

GO ON TO THE NEXT PAGE


02215020/CAPE 2010
-3-

2. (a) A set of 10 integers is stored in a one-dimensional array as follows:


location 0 1 2 3 4 5 6 7 8 9

data 10 3 2 15 6 5 8 11 20 19

A selection sort algorithm must be used to sort the 10 integers in ascending order (i.e.
smaller values must come before bigger values).

(i)
Describe how the selection sort algorithm works to sort a set of 10 integers in
ascending order.
[10 marks]

(ii) Draw the array after the first, second, and third passes of the selection sort algorithm
(i.e. three diagrams in all). [3 marks]

(b) A one-dimensional array num consists of 20 integers. The integers are not sorted.

Write C programming code to accept an integer, target, from the user and determine if
target is present in num. If target is found in num, print the location in which it was
found. If target is not present in num, print an appropriate error message.
[10 marks]

(c) When should binary search be used on an array? [2 marks]

Total 25 marks

GO ON TO THE NEXT PAGE


02215020/CAPE 2010
-4-

SECTION B

SOFTWARE ENGINEERING

Answer BOTH questions.

3. (a) A critical attribute of a well-engineered software product is maintainability. Briefly discuss


TWO other attributes of well-engineered software. [4 marks]

(b) Explain, giving TWO reasons, why it is important to involve end users and management
in the development of a software product. [4 marks]

(c) Explain why a software system that is used in a real-world environment must be upgraded
or become progressively less useful. [3 marks]

(d) The hiring process of a certain organisation after a vacancy is advertised is as follows:

Applications are accepted from interested persons and stored in a file. An acknowledge-
ment letter is sent to each applicant indicating that his/her application has been received.
At a later date, the applications are retrieved from the file, examined and eligible applicants
are selected for an interview. The selected applicants are informed of the date and time of
their interviews. After the interviews are held, the successful applicant’s data is moved to
the personnel file since this person will now be an employee of the organisation. Finally,
letters are sent to each applicant informing him or her of the outcome of the application.

Draw a Level-0 data flow diagram to represent the above scenario. [14 marks]

Total 25 marks

GO ON TO THE NEXT PAGE


02215020/CAPE 2010
-5-

4. (a) Two deliverables of the analysis phase of software engineering are a feasibility study and
a requirements specification document.

(i) State TWO reasons why the feasibility study is undertaken. [2 marks]

(ii) Describe the contents of the requirements specification document. [3 marks]

(b) A certain organisation consists of a number of departments. Each department employs one
or more employees but an employee is employed in only one department. The organisation
stores the first name, last name, address, and telephone number of each employee, as well
as an employee number to uniquely identify each employee. Employees have one or more
skills. A department undertakes various kinds of projects. Employees may be assigned to
one or more projects being undertaken. A project consists of a set of tasks and employees
use one or more of their skills when performing tasks on projects.

Draw an entity-relationship model for the above scenario. [14 marks]

(c) Consider a function, lsearch, which accepts the following parameters:

arr, an array of integers as a parameter,


n, the amount of elements in arr, and
key, an integer being searched for

and performs a linear search on arr for key. If key is found, the function returns the
location where the key was found, otherwise, it returns –1.

Briefly describe THREE tests which can be used to determine if lsearch is working
correctly. [6 marks]

Total 25 marks

GO ON TO THE NEXT PAGE


02215020/CAPE 2010
-6-

SECTION C

OPERATING SYSTEMS AND COMPUTER NETWORKS

Answer BOTH questions.

5. (a) (i) Draw a diagram to show the layers of the OSI model for computer communication.
[6 marks]

(ii) Describe the role of EACH of the top THREE layers of the model drawn in 5 (a)
(i) above. [6 marks]

(b) What is meant by a ‘page fault’, in an operating system that uses paging? How is it
handled? [4 marks]

(c) State and describe TWO applications that use or can use GPRS. [6 marks]

(d) In an operating system, explain what can cause a process to move from the running state
to the ready state. [3 marks]

Total 25 marks

6. The diagram below shows the network design of a company which utilizes a client-server model
for its data and applications.

A ISP
C
Firewall

GO ON TO THE NEXT PAGE


02215020/CAPE 2010
-7-

(a) Complete the labelling of the diagram, giving the names of A, B and C. [3 marks]

(b) State, giving a reason, which network topology is being employed. [2 marks]

(c) Give ONE disadvantage of the topology identified in (b). [2 marks]

(d) List ONE device which is NOT shown in the diagram that may also be found on the
network. [1 mark ]

(e) Briefly describe the function of the firewall. [3 marks]

(f) What is the meaning of the abbreviation ISP? [1 mark ]

(g) What service would the company likely use from the ISP? [1 mark ]

(h) If the company had an Intranet, on what protocol would it be running? [1 mark ]

(i) Differentiate between a peer-to-peer and a client server configuration. [3 marks]

(j) Give ONE disadvantage of a client server configuration. [2 marks]

(k) Both devices labelled A and B are running computer programs classified as operating
systems.

(i) Describe ONE function of modern operating systems. [2 marks]

(ii) What is the difference between the type of operating system running on A and
that running on B? [2 marks]

(iii) Give ONE method used to secure files. [2 marks]

Total 25 marks

END OF TEST

02215020/CAPE 2010
TEST CODE 02115020

FORM TP 2011163 MAY/JUNE 2011

CARIBBEAN E XAM I NAT I O N S COUNCIL

ADVANCED PROFICIENCY EXAMINATION


COMPUTER SCIENCE
UNIT 1: FUNDAMENTALS OF COMPUTER SCIENCE

PAPER 02
2½ hours

13 MAY 2011 (a.m.)

This examination paper consists of THREE sections: Computer Architecture and Organisation,
Problem Solving with Computers and Programming.

Each section consists of 2 questions


The maximum mark for each section is 50.
The maximum mark for this examination is 150.
This examination consists of 7 printed pages.

INSTRUCTIONS TO CANDIDATES

1. Do NOT open this examination paper until instructed to do so.

2. Answer ALL questions from the THREE sections.


Copyright © 2009 Caribbean Examinations Council.


All rights reserved.
02115020/CAPE 2011
- 2-

SECTION A

COMPUTER ARCHITECTURE AND ORGANISATION

Answer BOTH questions.

1. (a) The following is the truth table of a certain circuit:

x y z
0 0 1
0 1 1
1 0 0
1 1 0

Using only primary logic gates, design and draw the circuit. [ 6 marks]


(b) Write down the truth table (i.e. list all possible input bit patterns and their corresponding
outputs) for the circuit in Figure 1.
p
q

Figure 1
[ 4 marks]

(c) Explain what is meant by the terms:

(i) Flip-flop [ 2 marks]

(ii) Multiplexor [ 2 marks]

GO ON TO THE NEXT PAGE


02115020/CAPE 2011
- 3-


(d) (i) Draw a clearly labelled block diagram of a 2-to-4 line decoder. [ 3 marks]

(ii) A circuit is required for a television game show. The circuit must control four
light bulbs, B1, B2, B3, and B4. Only ONE of the light bulbs can be on at any
time.

State how a 2-to-4 line decoder can be used in the circuit and explain how the
bulbs are switched on. [ 3 marks]

(e) Find the 4–bit two’s complement of – 6. [ 2 marks]

(f) Consider the following floating point representation:


1–bit sign, 3–bit exponent, 5– mantissa.
Calculate the decimal representation of 0 0 1 0 0 0 1 0 1 .
(Show all working.) [ 3 marks]

Total 25 marks

2. (a) Name and state the function of THREE registers found in the Central Processing Unit
(CPU). [ 6 marks]

(b) Compare main memory and TWO storage devices in terms of capacity and access speed.
[ 6 marks]

(c) Besides registers, name TWO other components in the CPU and state the function of
EACH. [ 4 marks]

(d) Define the term ‘cache memory’ and explain how it increases the efficiency of data
retrieval. [ 4 marks]

(e) (i) State what is an ‘instruction format’. [ 1 mark ]

(ii) Name and describe TWO addressing modes. [ 4 marks]

Total 25 marks

GO ON TO THE NEXT PAGE


02115020/CAPE 2011
- 4-

SECTION B

PROBLEM SOLVING WITH COMPUTERS


Answer BOTH questions.

3. (a) Describe any THREE stages in the problem solving process. [ 6 marks]
(b) The algorithm below finds the average age of a set of students. Construct a flowchart
to represent the algorithm.

Algorithm

AverageAge
Sum = 0
Counter = 0
Read Age
While Age ! = 0
Sum = Sum + Age
Counter = Counter + 1
Read Age
End while
Average = Sum/Counter
Print Average
End

[11 marks]

(c) The algorithm below is designed to print a table of squares of all the even numbers
between 1 and 100 (inclusive). However, there are errors in the algorithm.

1. j=1
2. while j < 100
3. print “Even Number Square”
4. print “========== =====”
5. j * j = square
6. print j, square
7. end while

By referring to the specific line number, identify and correct the errors in the algorithm
so that it will achieve its objective. [ 8 marks]

Total 25 marks

GO ON TO THE NEXT PAGE


02115020/CAPE 2011
- 5-

4. (a) State THREE properties of a well-designed algorithm. [ 3 marks]

(b) Trace through the execution of the following algorithm and draw the output in your
answer booklet exactly as it would be generated by the algorithm. You should carefully
note the following:

• printSpaces(n) prints n spaces from the current cursor position; use a dash ‘-’ to
indicate a space in your answer booklet.

• print() continues output on the current line from the current cursor position.

• println() continues output on the current line from the current cursor position
but any subsequent output begins on a new line

SIZE = 10
begin

i = SIZE - 1
while (i > 0) {
printSpaces (i)
print ("*")
y = (SIZE - i - 1) * 2
printSpaces (y)
println ("*")
i=i-1
}

for (i=1; i<=2*SIZE; i=i+1)


print ("*")

println()

end
[11 marks]

(c) (i) Write an algorithm that uses iteration to print the sum of ALL multiples of 11
(integers) between 0 and 5 000, inclusive. [ 8 marks]

(ii) Indicate whether ‘bounded’ or ‘unbounded’ iteration was used in your response
for 4 (c) (i) and state ONE reason for its use. [ 3 marks]

Total 25 marks

GO ON TO THE NEXT PAGE


02115020/CAPE 2011
- 6-

SECTION C

PROGRAMMING

Answer BOTH questions.

5. (a) Apart from intermediate code generation, list TWO other stages of the translation
process. [ 2 marks]

(b) Give TWO advantages of using a modular approach in programming. [ 2 marks]

(c) Write a C function which accepts an integer array and an integer variable indicating the
size of the array. The function should return the sum of all the numbers in the array that
are NOT greater than 100. [ 6 marks]

(d) A gym is having a contest. Members are asked to guess the number of jellybeans in
a jar. The winner is the member who accurately guesses the number of jellybeans or
whose guess is closest to this value without going over.

All the information related to the contest is stored in a file ‘contest.txt’. The first line of
the file gives that actual number of jellybeans in the jar. Each line thereafter contains
the guess of a member followed by his/her member identification code (which is a four
digit integer). Data is terminated by – 1 (which appears on a line by itself).

Write a C program that determines and outputs to a file, “winner.txt”, the winning guess
and the winner’s identification code.

You may assume all guesses are unique and a winner exists. You may not use arrays in
your solution. [15 marks]

Total 25 marks

GO ON TO THE NEXT PAGE


02115020/CAPE 2011
-7-

6. (a) Explain the term ‘white space’. [ 2 marks]

(b) Define the term ‘debugging’. [ 2 marks]

(c) Explain why programmers should practise proper indentation. [ 2 marks]

(d) For any THREE integer values the following rules apply:

– The values cannot be the sides of a triangle if any value is 0 or negative and, if
any value is greater than the sum of the other two.

– The values can represent the sides of an equilateral triangle if all the values are
equal.

– The values can represent the sides of an isosceles triangle if two values are equal.

– The values can represent the sides of a scalene triangle if all the values are
different.

Write a C program that prompts the user for THREE integers and prints to the standard
output what triangle is represented. If no triangle is represented print “No triangle is
represented.” [11 marks]

(e) (i) In your answer booklet show the output generated by the following segment of
code.

int i, j;

for (i = 1 ; i < 5; i++)


{
for (j = 1 ; j < = 5 ; j++)
{
print (“%d”, i);
}
print (“\n”);
} [ 4 marks]

(ii) Modify the code in e (i) so that the following output is generated.

1 2 3 4 5
2 3 4 5
3 4 5
4 5

5 [ 4 marks]

Total 25 marks

END OF TEST

02115010/CAPE 2011
TEST CODE 02215020

FORM TP 2011165 MAY/JUNE 2011

CARIBBEAN E XAM I NAT I O N S COUNCIL

ADVANCED PROFICIENCY EXAMINATION


COMPUTER SCIENCE
UNIT 2: FURTHER TOPICS IN COMPUTER SCIENCE

PAPER 02
2½ hours

16 MAY 2011 (p.m.)

This examination paper consists of THREE sections: Data Structures, Software Engineering and
Operating Systems and Computer Networks.

Each section consists of 2 questions


The maximum mark for each section is 50.
The maximum mark for this examination is 150.
This examination consists of 5 printed pages.

INSTRUCTIONS TO CANDIDATES

1. Do NOT open this examination paper until instructed to do so.

2. Answer ALL questions from the THREE sections.


Copyright © 2009 Caribbean Examinations Council.


All rights reserved.
02215020/CAPE 2011
- 2-

SECTION A

DATA STRUCTURES

Answer BOTH questions.

1. (a) (i) Define the term ʻAbstract Data Typeʼ (ADT). [ 2 marks]

(ii) Explain how a stack ADT is implemented. [ 3 marks]

(b) A certain element is at the bottom of a stack. Write an algorithm to remove the element
from the stack, leaving the other elements in their same relative positions. (You may
use an appropriate auxiliary structure in your solution.) [ 8 marks]

(c) Assume that a queue implemented in a circular fashion is in the state indicated in the
diagram below.

Q L M O C R D S F
↑ ↑
Head Tail
Pointer Pointer

Draw a diagram showing the queue after the letters L and Y are inserted, three letters
are removed, and the letters E and Z are then inserted. [ 7 marks]

(d) Describe how you would sort an array of n items using a bubble sort. [ 5 marks]

Total 25 marks

2. (a) Using a labelled diagram, explain what is a linked list. [ 6 marks]


(b) Consider the following array arr.

arr 3 12 9 10 5 4

0 1 2 3 4 5

Write a C program to store and then sort the values in the array arr, using simple selection
sort. [12 marks]

(c) Explain what is involved in EACH of the following search techniques:

(i) linear search [ 3 marks]

(ii) binary search [ 4 marks]



Total 25 marks

GO ON TO THE NEXT PAGE


02215020/CAPE 2011
- 3-

SECTION B

SOFTWARE ENGINEERING

Answer BOTH questions.

3. (a) Explain the ʻwaterfall approachʼ to systems development. [ 3 marks]

(b) Describe FOUR tasks which must be performed during the design phase of systems
development. [ 8 marks]

(c) A mail order company receives orders from customers at its sales department. The sales
department prepares an internal order form which it dispatches to the warehouse and
sends an acknowledgement to the customer. The warehouse checks for the availability of
the item. If the item is in stock the order is prepared and dispatch instructions are sent to
the dispatch department which sends a copy to the sales department and the accounting
department. The sales department receives a copy of the invoice from accounts and
sends summary financial statements of the customer to accounts and to the customer.
Accounts also sends an invoice to the customer.

Draw a Level-O data flow diagram that shows the flow of information between the
customer, the company and the various departments within the firm. [14 marks]

Total 25 marks

4. (a) In undertaking the development of a new software system, the systems analyst is required
to undertake a fact-finding exercise.

(i) Identify THREE methods of fact-finding available to the analyst. [ 3 marks]

(ii) Outline TWO deliverables from the analysis phase of the systems development
life cycle. [ 4 marks]

(b) (i) Describe TWO ways in which a CASE tool can be used in a software development
process. [ 4 marks]

(ii) State ONE advantage and ONE disadvantage of using CASE tools in a pro-
ject. [ 2 marks]

(c) A certain university has a number of colleges. Each college has one or more departments.
A lecturer is hired by one or more departments. A department can teach many courses
and a course can be taught by one or more lecturers. The following information is stored
on a course: code (primary key), name, and credit hours.

Draw an entity-relationship model for the above scenario. [12 marks]

Total 25 marks

GO ON TO THE NEXT PAGE


02215020/CAPE 2011
- 4-

SECTION C

OPERATING SYSTEMS AND COMPUTER NETWORKS

Answer BOTH questions.

5. (a) Explain ONE difference between an analog signal and a digital signal. [ 2 marks]

(b) State TWO examples of EACH of the following:

(i) wired transmission media [ 2 marks]

(ii) wireless transmission [ 2 marks]

(c) Using examples, explain the client-server model of computing. [ 4 marks]

(d) The College of Enquiry has decided to install a Local Area Network (LAN) to be used
by both staff and students. It is expected that both groups will connect to the Internet to
do research and communicate with stakeholders external to the College from different
points within the campus. It is also expected that the college will connect its LAN to
other LANs.

(i) Describe FOUR network devices that may be used by the college. [ 8 marks]

(ii) Describe how TWO types of transmission media can be used by the college
LAN. [ 4 marks]

(iii) State THREE ways in which different users may be granted access to the various
data and resources on the network. [ 3 marks]

Total 25 marks

GO ON TO THE NEXT PAGE


02215020/CAPE 2011
-5-

6. (a) (i) Distinguish between a ʻbatch processing systemʼ and a ʻmulti-user systemʼ.
[ 4 marks]

(ii) Name ONE application for which a batch processing system is used.
[ 1 mark ]

(iii) Name ONE application for which a multi-user system would be appropriate.
[ 1 mark ]

(b) Describe TWO ways in which files can be protected. [ 4 marks]

(c) Program A is currently running. It needs to retrieve data from a disk, so an interrupt is
generated.

(i) What is an interrupt? [ 1 mark ]

(ii) Briefly explain how an interrupt is handled by the processor. [ 3 marks]

(d) The diagram below depicts a difficulty that can occur in a multiprogramming system.

Resource 1

Process A Process B

Resource 2

(i) What is the term used to describe the difficulty that has occurred?
[ 1 mark ]

(ii) Outline the conditions under which such an event would occur.
[ 3 marks]

(iii) Explain TWO ways in which the difficulty outlined in d (i) could be resolved.
[ 4 marks]

(e) Briefly explain how the round-robin scheduling algorithm works. [ 3 marks]

Total 25 marks

END OF TEST

02215020/CAPE 2011
TEST CODE 02115020

FORM TP 2012163 MAY/JUNE 2012

CARIBBEAN E XAM I NAT I O N S COUNCIL

ADVANCED PROFICIENCY EXAMINATION


COMPUTER SCIENCE
FUNDAMENTALS OF COMPUTER SCIENCE

UNIT 1 – Paper 02
2 hours 30 minutes

15 MAY 2012 (a.m.)

This examination paper consists of THREE sections: Computer Architecture and Organisation,
Problem Solving with Computers and Programming.

Each section consists of 2 questions


The maximum mark for each section is 50.
The maximum mark for this examination is 150.
This examination consists of 6 printed pages.

READ THE FOLLOWING INSTRUCTIONS CAREFULLY.

1. Do NOT open this examination paper until instructed to do so.

2. Answer ALL questions from the THREE sections.


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

Copyright © 2011 Caribbean Examinations Council


All rights reserved.
02115020/CAPE 2012
- 2-

SECTION A

COMPUTER ARCHITECTURE AND ORGANIZATION

Answer BOTH questions.

1. (a) A certain circuit has two inputs, x and y. Its output is given by the boolean function, F,
where

F = xy´ + x´y

(i) Give the truth table of the circuit. [4 marks]

(ii) Using only the primary logic gates, design and draw the circuit. [6 marks]

(b) (i) Draw a clearly labelled block diagram of a 4-to-1 line multiplexer. [4 marks]

(ii) In a security system, four sensors must transmit data to a single line for alarm
notification. Each sensor transmits data for 1 second.

Explain how a multiplexer can be used for the purpose described above and
discuss how data from each sensor is transmitted through the alarm notification
line. [6 marks]

(c) (i) Showing all working, find the largest and smallest integers that can be stored in
four bits when signed magnitude representation is used. [2 marks]

(ii) Consider the following floating point representation:

1-bit sign, 3-bit exponent, 5-bit mantissa

Calculate the decimal equivalent of 101100011. [3 marks]

Total 25 marks

2. (a) (i) Explain what is meant by the ‘instruction set’ of a central processing unit (CPU).
[2 marks]

(ii) Briefly describe THREE types of instructions that are typically included in an
instruction set. [6 marks]

(iii) Explain how cache memory can increase the efficiency of data retrieval.
[3 marks]

GO ON TO THE NEXT PAGE


02115020/CAPE 2012
- 3-

(b) (i) Distinguish between the opcode and the operands of an instruction. [2 marks]

(ii) Two typical instruction formats are one-address and two-address. Describe
how the operands are obtained in EACH case and specify where the results are
stored. [6 marks]

(c) (i) Explain how a hard disk differs from RAM in terms of access method and access
speed. [3 marks]

(ii) Explain how RAM differs from a CD-R device in terms of volatility and storage
capacity. [3 marks]

Total 25 marks

SECTION B

PROBLEM SOLVING WITH COMPUTERS

Answer BOTH questions.

3. (a) Explain the role of an algorithm in the problem-solving process. [2 marks]

(b) Examine the TWO algorithms below (labelled Algorithm 1 and Algorithm 2) and answer
the questions that follow.

Algorithm 1

FOR X = 0 TO 15 DO
PRINT X
END FOR

Algorithm 2

READ X
WHILE X ! = 999 DO {Note that ! = means “not equal to”}
SUM = SUM + X
READ X
END WHILE

(i) Which of the algorithms above illustrates bounded iteration? Justify your
answer. [3 marks]

(ii) Which of the algorithms above illustrates unbounded iteration? Justify your
answer. [3 marks]

GO ON TO THE NEXT PAGE


02115020/CAPE 2012
- 4-

(c) A primary school is conducting a survey on the popularity of certain colours. Students
are asked to vote for any of four choices: red, blue, green, none. If red, blue or green is
not the favourite, students vote for ‘none’.
Write an algorithm to find and print the

(i) number of students that voted for EACH of the colours: red, blue, green.
(ii) TOTAL number of students that voted for red, blue or green.

Assume that on the day of the survey, 150 students are present. Also assume that all
votes are valid. [10 marks]

(d) Write an algorithm that uses iteration to find the sum of all multiples of 4 and all multiples
of 7 between m (inclusive) and n (inclusive) where m and n are two positive integers
entered via the keyboard. Assume that n > m. [7 marks]
Total 25 marks

4. (a) Construct a flow chart to represent the following algorithm.


begin
Prompt for numDays
Read numDays
Set day to 1
Set totalComm to 0
While day <= numDays do
read numItemsSold
if numItemsSold < 500 then
comm = numItemsSold * 4
else comm = numItemsSold * 5
endif
totalComm = totalComm + comm
Print comm
Add 1 to day
Endwhile
Print numDays, totalComm
stop
[12 marks]

(b) An algorithm is shown below.


read j
sum = 0
while j < 5 do
sum = sum + j
print j
read j
endwhile
print ‘sum =’, sum

What would the algorithm print given the line of input data below? Show your working.

3 2 1 5 7 4 [3 marks]

GO ON TO THE NEXT PAGE


02115020/CAPE 2012
- 5-

(c) Trace through the execution of the following algorithm and draw the output in your
answer booklet, exactly as it would be generated by the algorithm. You should carefully
note the following:

● printSpaces (n) prints n spaces from the current cursor position


● print continues output on the current line from the current cursor position
● println terminates output on the current line at the current cursor position.
Any subsequent output begins on a new line (e.g., line 18)
● println (output-list) outputs ‘output-listʼ on the current line and then places the
cursor at the beginning of the following line (e.g., line 4).
1. begin
2. SIZE = 10
3. printSpaces ( SIZE + 1 )
4. println ( ' * ' )
5. j = SIZE – 2
6. while j >= 0
7. begin
8. printSpaces ( j + 1 )
9. print ( ' $ ' )
10. printSpaces ( SIZE – j )
11. println ( ' & ' )
12. j=j –2
13. endwhile
14. printSpaces (1)
15. for j = 1 to (SIZE + 1) do
16 print ( ' + ' )
17. endfor
18. println
19. end [10 marks]

Total 25 marks

SECTION C

PROGRAMMING

Answer BOTH questions

5. (a) Briefly describe THREE stages of the program translation process. [6 marks]

(b) Write a C function which accepts a positive integer, n, and returns 2n. State any assumptions
made. [7 marks]
(c) (i) Write C code to store the even numbers from 2 (inclusive) to 40 (inclusive) in
a file called “num.dat”. [7 marks]

(ii) Write C code to read the integers from the file “num.dat” created in c (i), add 5
to each integer and then print the result on the screen. [5 marks]

Total 25 marks

GO ON TO THE NEXT PAGE


02115020/CAPE 2012
- 6-
6. (a) Explain THREE ways in which good programming style can be maintained.
[6 marks]

(b) A grocer needs to store data about some products using a C application. Each product
has an ID (integer), a quantity in stock (integer) and a price (floating point).

(i) Write a declaration for a C struct productRec that can store the record for each
product. [2 marks]

(ii) Declare TWO variables, item1 and item2, that have the record structure declared
in b (i) above. [1 mark ]

(iii) Write C code to put data in the item1 struct from b (ii) above. You can use any
values you like. [2 marks]

(iv) Assume that two productRec structs, item3 and item4, are already loaded with
data. Write C code to exchange the values in item3 and item4. [3 marks]

(c) Write C code to read a string entered by the user at the keyboard, store it in a character
array and print the vowels that are present in the string. If no vowels are present, print
“NO VOWELS”. Assume that the string is entered in upper case letters and that the
string is exactly 7 characters in length. Also, count and print the number of occurrences
of the letter ‘A’ in the string.

Example:

Please enter name: MICHAEL

Vowel I present. Vowel A present. Vowel E present.


Number of As = 1 [11 marks]

Total 25 marks

END OF TEST

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

02115020/CAPE 2012
TEST CODE 02215020

FORM TP 2012165 MAY/JUNE 2012

CARIBBEAN E XAM I NAT I O N S COUNCIL

ADVANCED PROFICIENCY EXAMINATION


COMPUTER SCIENCE
FURTHER TOPICS IN COMPUTER SCIENCE

UNIT 2 – Paper 02
2 hours 30 minutes

16 MAY 2012 (p.m.)

This examination paper consists of THREE sections: Data Structures, Software Engineering and
Operating Systems and Computer Networks.

Each section consists of 2 questions


The maximum mark for each section is 50.
The maximum mark for this examination is 150.
This examination consists of 6 printed pages.

READ THE FOLLOWING INSTRUCTIONS CAREFULLY.

1. Do NOT open this examination paper until instructed to do so.

2. Answer ALL questions from the THREE sections.


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

Copyright © 2011 Caribbean Examinations Council


All rights reserved.
02215020/CAPE 2012
- 2-

SECTION A

DATA STRUCTURES

Answer BOTH questions.

1. (a) A Stack abstract data type (ADT) is implemented in C using appropriate variables and
functions.

(i) Explain the difference between the Stack ADT and the C implementation of the
stack. [ 3 marks]

(ii) Declare the variables that are needed for the implementation of the stack in C
and describe the purpose of EACH. Assume that the stack will store at most
100 integer elements. [ 4 marks]

(iii) Write the C code for the push (element) and pop () operations. You must cater
for stack overflow and underflow conditions. [ 8 marks]

(b) The linked list ADT provides an insert operation which inserts new elements at the
beginning of the list.

A certain linked list is initially empty. Draw the linked list after the following elements
are inserted in the order given (from left to right):

43 38 25

[You must clearly indicate the beginning and ending of the list.] [4 marks]

(c) The Queue ADT provides an enqueue (element) operation and a dequeue () operation.
You are given a queue, q, with an unknown number of elements. Using a stack, stk,
write an algorithm to reverse the order of the elements in q. Your algorithm must use
Stack and Queue ADT operations only. [ 6 marks]

Total 25 marks

2. (a) A one-dimensional array contains the marks of 100 students in a certain subject. The
marks are not sorted.

Write the C programming code which inputs two integers, lower and upper (where lower
is less than upper), and finds and prints the number of marks in the array between lower
and upper (inclusive). If no mark is found in the range, print an appropriate error mes-
sage.

[You do NOT have to input the marks in the array.] [10 marks]

GO ON TO THE NEXT PAGE


02215020/CAPE 2012
- 3-

(b) The following 10 integers are stored in a sorted array, arr.

location 0 1 2 3 4 5 6 7 8 9

data 7 9 16 22 27 45 50 51 80 91

Describe how a binary search algorithm will search arr for the following keys:

(i) 16 [6 marks]

(ii) 63 [6 marks]

You must show the portion of the array being searched each time in the loop until the
key is found or until it is determined that the key is not present.

(c) The following 10 integers are stored in an array, arr.

location 0 1 2 3 4 5 6 7 8 9

data 80 91 50 22 27 45 16 51 7 9

Draw the array after the first, second, and third passes of the selection sort algorithm
(i.e., three diagrams in all). [3 marks]

Total 25 marks

GO ON TO THE NEXT PAGE


02215020/CAPE 2012
- 4-

SECTION B

SOFTWARE ENGINEERING

Answer BOTH questions

3. (a) In a university registration system, a student sends an application form containing his/her
personal details and the course he/she would like to register for. The university checks
a course file to find out if the course is available. If the course is available, the student
is enrolled in the course by updating the student file and course file. The university
confirms the enrolment by sending a confirmation letter to the student. If the course is
unavailable, the student is sent a rejection letter.

Draw a level-0 data flow diagram (first level of decomposition) that depicts the above
scenario. [14 marks]

(b) Describe ONE advantage and ONE disadvantage of the evolutionary approach to soft-
ware development. [4 marks]

(c) Describe FOUR phases in the waterfall approach for software development and state
the order in which they will be undertaken. [5 marks]

(d) Discuss ONE reason why it is important to involve end users in the development of a
software product. [2 marks]

Total 25 marks

4. (a) A conceptual data model is a representation of an organization’s data. During analysis,


it is common to obtain a conceptual data model using a technique known as entity-
relationship modelling.

(i) Describe the main components of an entity-relationship model. [6 marks]

(ii) A certain company undertakes software development projects. A project con-


sists of a set of tasks and each task requires various skills such as coding and
testing. The company stores the first name, last name, address and telephone
number of each employee as well as an employee number to uniquely identify
the employee. Each employee has a number of competencies; however, other
employees could have similar competencies. Employees may be assigned to
only one project being undertaken. However, they can be assigned to one or
more tasks based on their competencies.

Draw an entity-relationship model for the above scenario. [13 marks]

GO ON TO THE NEXT PAGE


02215020/CAPE 2012
- 5-

(b) A function, binarySearch, performs a binary search on an integer array, arr, to determine
if a certain key is present. If key is found, binarySearch returns the location where the
key was found. Otherwise, it returns -1. Its parameters are as follows:

arr, an array of integers


n, the amount of elements in arr, and
key, the integer being searched for.

Describe THREE tests which can be used to determine if binarySearch is working


correctly. [6 marks]

Total 25 marks

SECTION C

OPERATING SYSTEMS AND COMPUTER NETWORKS

Answer BOTH questions.

5. (a) Describe the characteristics of EACH of the following transmission media:

(i) twisted pair [2 marks]

(ii) fibre optic cables [2 marks]

(b) A ring network has four computers, but one of the computers has failed. Explain ONE
modification to the ring network that will allow the three remaining computers to still
transmit data. Use a diagram in your response. [4 marks]

(c) With the aid of a diagram, explain the role of a hub in a local area network.
[3 marks]

(d) With the aid of a diagram, explain how is data communicated in an IEEE802.11a
network. [6 marks]

(e) Outline the role of a firewall on a computer network. [3 marks]

(f) State the role of EACH of layers 1 – 5 of the OSI model for network communication.
[5 marks]

Total 25 marks

GO ON TO THE NEXT PAGE


02215020/CAPE 2012
- 6-

6. (a) Using a diagram, explain how a deadlock can occur in an operating system.
[4 marks]

(b) Briefly explain how a software interrupt is handled in a system that contains one processor.
[4 marks]

(c) List and describe THREE states that a process may be in during execution. [9 marks]

(d) Describe THREE components of a process control block (PCB). [6 marks]

(e) State ONE advantage of a menu interface over a command interface. [2 marks]

Total 25 marks

END OF TEST

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

02215020/CAPE 2012
TEST CODE 02115020

FORM TP 2013163 MAY/JUNE 2013

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

17 MAY 2013 (a.m.)

This examination paper consists of THREE sections: Computer Architecture and Organization,
Problem Solving with Computers, and Programming.

Each section consists of 2 questions


The maximum mark for each section is 50.
The maximum mark for this examination is 150.
This examination consists of 7 printed pages.

READ THE FOLLOWING INSTRUCTIONS CAREFULLY.

1. Do NOT open this examination paper until instructed to do so.

2. Answer ALL questions from the THREE sections.


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

Copyright © 2012 Caribbean Examinations Council


All rights reserved.
02115020/CAPE 2013
- 2-

SECTION A

COMPUTER ARCHITECTURE AND ORGANIZATION

Answer BOTH questions.

1. (a) (i) Draw a clearly labelled block diagram of a 4 to 1 line multiplexer. [4 marks]

(ii) Four lines, l0, l1, l2, l3, are connected to the input lines of a 4 to 1 line multiplexer.
Explain how the multiplexer can send the signal in l1 as output for one second
followed by the signal in l3. [4 marks]

(iii) Give TWO properties of a flip-flop and state ONE use of this device.
[3 marks]

(b) (i) Find the 4-bit signed magnitude representation of –5. [2 marks ]

(ii) Find the 4-bit one's complement representation of –5. [1 mark ]

(iii) Find the 4-bit two's complement representation of –5. [2 marks ]


(c) A certain system represents decimal numbers by storing sign (S), mantissa (M) and
exponent (E).

One bit is used for the sign, 3 bits for the exponent and 4 bits for the mantissa.

What decimal number is represented below?

S E M

1 010 0101 [3 marks]

(d) Draw the truth tables for the following logic gates.

(i) x [2 marks]

(ii)
x
[2 marks]
y


x
(iii) [2 marks]
y

Total 25 marks

GO ON TO THE NEXT PAGE


02115020/CAPE 2013
- 3-

2. (a) A student wishes to keep a computer system for 10 years. His teacher said that ‘port
connectivity’ could be a problem in a few years.

Explain, with ONE example, the term ‘port connectivity’ . [3 marks]

(b) Differentiate between the following items as they pertain to computer systems:

(i) ROM and EPROM [2 marks]

(ii) EPROM and EEPROM [2 marks]

(c) Arrange the following in order of size from smallest to largest:

supercomputer, pda, laptop, microcomputer [2 marks]

(d) (i) Explain what is meant by the ʻinstruction setʼ of a computer. [2 marks]

(ii) State THREE types of instructions that are typically present in an instruction set
and give ONE example of EACH type. [6 marks]

(iii) Briefly explain the term ʻdirect addressingʼ. [2 marks]

(e) Explain how the ʻfetchʼ, ʻdecodeʼ, ʻexecuteʼ cycle works in a computer. [6 marks]

Total 25 marks

GO ON TO THE NEXT PAGE


02115020/CAPE 2013
- 4-

SECTION B

PROBLEM SOLVING WITH COMPUTERS

Answer BOTH questions.

3. (a) A company called DVDR sells used DVD movies and wishes to acquire software to track
purchases, customer information and the quantities of movies in stock. The company
has contracted the services of a software company called SoftSol which writes software
applications.

Briefly describe any THREE stages that SoftSol would generally follow when creating
the software for DVDR. [6 marks]

(b) A certain cellular company provides the following rates for voice calls.

First 10 minutes $1.50 per minute

Any additional minutes $0.50 per minute

Write an algorithm that reads an integer value representing the number of minutes used
for voice calls, calculates and prints the cost of calls. [6 marks]

(c) Construct a flow chart to represent a solution to the following problem.

A set of data exists for students in a class. Each line contains a student ID number
followed by the scores in 3 subjects. Data is terminated by the fictitious student ID:
9999.

Sample data

1111 34 56 78
4444 67 98 99
2654 88 89 90
9999

Requirements

(i) Read the data and for each student, calculate and print the average scored in the
3 subjects.

(ii) Print the number of students in the class; for example, the message ‘There are
3 students in the class’ is printed. [13 marks]
Total 25 marks

GO ON TO THE NEXT PAGE


02115020/CAPE 2013
- 5-

4. (a) Trace through the execution of the following algorithm and draw the output in your
answer booklet exactly as it would be generated by the algorithm. You should carefully
note the following:

• printSym(n) prints n ‘∧’from the current cursor position


for example, printSym(5) would print:
∧∧∧∧∧

• write (output-list) continues output on the current line from the current cursor
position

• writeln (output-list) continues output on the current line and then terminates
output on that line. Subsequent output would therefore begin on a new line

begin
SIZE = 10
j=6
printSym ( j + 1 )
writeln (' * ')
while j > −1
begin
printSym ( j )
write ( '@' )
printSym ( SIZE − j − 4 )
writeln ('*')
j = j − 1
endwhile
end
[11 marks]

(b) Write an algorithm to find the product of all multiples of 6 between 12 (inclusive) and
600 (exclusive). [8 marks]

(c) Explain THREE properties of well-designed algorithms, using an example in EACH


case. [6 marks]

Total 25 marks

GO ON TO THE NEXT PAGE


02115020/CAPE 2013
- 6-

SECTION C

PROGRAMMING

Answer BOTH questions

5. (a) Explain TWO differences between compilers and interpreters. [6 marks]

(b) Write a function swap that accepts an integer array and two integers pos1, pos2,
representing two locations in the array. The function should swap the contents of the
two locations. Assume that pos1 and pos2 are valid. [4 marks]

(c) Write a C program that reads a text file ʻin.dat’ and obtains two integers. Assume the
file contains two integers separated by a space. Next, print out the integers in reverse
order, followed by their sum and product.

Example

Given: 5 10
The program outputs 10 5 15 50 [7 marks]

(d) Write a program that prompts the user to enter an integer r and prints r!
where
0! = 1
r! = r(r−1)(r−2)...1 for r > 0

For example 4! = 4(3)(2)(1) = 24 [8 marks]

Total 25 marks

GO ON TO THE NEXT PAGE


02115020/CAPE 2013
- 7-

6. (a) Identify and briefly describe any TWO programming paradigms. [4 marks]
(b) Explain ONE reason why programming languages implementations used on mobile
devices are different from those for desktop computers. [2 marks]
(c) What output would the following C program produce when executed?

#include <stdio.h>

int main ()
{ int i, j, final = 1;
for (j = 6; j > 0; j = j − 2) {
i = j / 2;
while (i <= j) {
printf("i is %d j is %d\n",i, j);
j--;
final = final + i * j;
} //while
printf("New i = %d", i);
}//for
printf("\nFinal Output: %d\n", final);
return 0;
}//main [6 marks]

(d) (i) Write a C declaration for a struct in C that can hold 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 two variables to represent two customers, Andrew and Jamie. Next, set
their record values as follows:
ID Balance
Andrew 1200 1000
Jamie 1500 3000
[4 marks]

(iii) Assume that Andrew pays full price for any purchases made and Jamie gets a
10% discount on all purchases.

Write C code to read two values representing the purchases of Andrew


and Jamie respectively, from the keyboard. Next, adjust each customer’s balance
based on the purchases. [3 marks]

(iv) Write C code to interchange the records of Andrew and Jamie. [3 marks]

Total 25 marks

END OF TEST

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

02115020/CAPE 2013
TEST CODE 02215020

FORM TP 2013165 MAY/JUNE 2013

CARIBBEAN E XAM I NAT I O N S COUNCIL


CARIBBEAN ADVANCED PROFICIENCY EXAMINATION®
COMPUTER SCIENCE
FURTHER TOPICS IN COMPUTER SCIENCE

UNIT 2 – Paper 02
2 hours 30 minutes

20 MAY 2013 (p.m.)

This examination paper consists of THREE sections: Data Structures, Software Engineering, and
Operating Systems and Computer Networks.

Each section consists of 2 questions


The maximum mark for each section is 50.
The maximum mark for this examination is 150.
This examination consists of 6 printed pages.

READ THE FOLLOWING INSTRUCTIONS CAREFULLY.

1. Do NOT open this examination paper until instructed to do so.

2. Answer ALL questions from the THREE sections.


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

Copyright © 2012 Caribbean Examinations Council


All rights reserved.
02215020/CAPE 2013
- 2-

SECTION A

DATA STRUCTURES

Answer BOTH questions.

1. (a) A stack is required to store a set of characters.

(i) Write code to declare the variables that will be needed by the stack.
Assume that the stack size is 1000 characters. [ 2 marks]

(ii) Write the function that pushes a character, c, onto the stack. You must cater for
stack overflow. [ 4 marks]

(iii) Write the function that pops a character from the stack. You must cater for stack
underflow. [ 6 marks]

(b) (i) Using a labelled diagram, explain what is a ‘linked list’. [ 7 marks]

(ii) A linked list contains two nodes. With the aid of a diagram in EACH case,
explain how a new node can be inserted at the

a) top of the linked list [ 3 marks]

b) bottom of the linked list. [ 3 marks]

Total 25 marks

2. (a) The following bubbleSort() function implements the bubble sort algorithm on an array
of integers.

void bubbleSort (int a[ ], int numItems)


{
int i, j, temp;

for (i=0; i<numItems−1; i++) {


for (j=0; j<numItems−i; j++) {
if (a [j] > a [j+1]) {
temp = a [j] ;
a [j] = a [j+1];
a [j+1] = temp;
}
}
}
}

GO ON TO THE NEXT PAGE


02215020/CAPE 2013
- 3-

(i) Explain the purpose of the outer ‘for’ loop. [ 2 marks]

(ii) Explain carefully the process that occurs in the inner ‘for’ loop. [ 3 marks]

(iii) State why the upper limit for j in the inner ‘for’ loop is (numitems − i) and not
(numitems). [ 1 mark ]

(iv) The array a contains the following five values:

Location 0 1 2 3 4

Value 5 1 4 8 2

a) Show the contents of the array after each stage during the FIRST pass
of the bubble sort. [ 4 marks]

b) Show the contents of the array at the end of the SECOND and THIRD
passes of the bubble sort. [ 2 marks]

(b) The following 7 integers are stored in an array.

Location 0 1 2 3 4 5 6

Value 34 5 10 1 9 23 14

Using the selection sort algorithm, show the contents of the array after each of the first
four passes of the sort. [ 4 marks]

(c) Describe the principles behind the binary search when searching for an item in an array.
[ 6 marks]

(d) The following 16 integers are stored in an array:

Location 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Value 1 5 7 15 19 23 24 28 31 36 54 57 67 72 79 80

(i) How many comparisons does a linear search make before it determines that
the value 50 is not present in the array? [ 1 mark ]

(ii) How many comparisons does a binary search make before it determines that
the value 50 is not present in the array? Show your working. [ 2 marks]

Total 25 marks

GO ON TO THE NEXT PAGE


02215020/CAPE 2013
- 4-

SECTION B

SOFTWARE ENGINEERING

Answer BOTH questions.

3. (a) (i) Explain what is meant by the term ‘prototyping’. [4 marks]

(ii) Explain how prototyping can be used during the development of a software
product. [4 marks]

(iii) State TWO weaknesses of the protyping approach (that is, evolutionary
development). [2 marks]

(b) In a certain hospital, patients are assigned to a single ward where they are treated by one
doctor. A ward may have one or more doctors and a doctor can work in one or more
wards. There are a number of healthcare assistants who work on each ward and each
one may take care of one or more patients in that ward. A patient can also be taken care
of by one or more of the healthcare assistants. Each patient has a unique patient ID
(primary key). The hospital keeps track of the name of each patient, his/her address,
and an emergency contact number. Each patient is administered one or more treatments
to deal with his/her specific condition.

Draw an entity-relationship model for the above scenario. Relationships should be


named and the cardinality of each relationship should be clearly specified.
[9 marks]

(c) Consider the function binarySearch() with the following protype:

int binarySearch (in[] items, int numItems, int key)

The function searches for an integer key in the items array. There are numItems items
in the array. If key is found, binarySearch() returns the position where it is found.
Otherwise, it returns −1.

Describe THREE tests that should be part of the test plan to unit test the binarySearch()
function. [ 6 marks]

Total 25 marks

GO ON TO THE NEXT PAGE


02215020/CAPE 2013
- 5-

4. (a) State THREE traditional methods of determining requirements of a new software system
and identify ONE advantage and ONE disadvantage of each method. [ 9 marks]

(b) A data flow diagram (DFD) typically contains symbols representing external entities,
data stores, and processes.

(i) State the purpose of EACH of those symbols when it is used in a DFD.
[ 3 marks]

(ii) For EACH symbol, give a diagram showing how it is used in a DFD.
[ 3 marks]

(iii) A customer sends an order to the order processing system. The system checks
if the items ordered are in the inventory. If the items are available, a shipping
notice is sent to the warehouse which dispatches the items to the customer and
updates the number of items in the inventory. If the items are not available, the
order is rejected and returned to the customer.

Draw a level-0 data flow diagram for the scenario above. [ 6 marks]

(c) Distintuish between ‘functional requirements’ and ‘non-functional requirements’ and


give ONE example of EACH type of requirement. [ 4 marks]

Total 25 marks

GO ON TO THE NEXT PAGE


02215020/CAPE 2013
- 6-

SECTION C

OPERATING SYSTEMS AND COMPUTER NETWORKS

Answer BOTH questions.

5. (a) Explain why a peer-to-peer network is generally considered a special case of a


client/server network. [ 4 marks]

(b) Briefly discuss the following THREE issues that should be considered when developing
a computer network:

(i) Network security

(ii) Expandability

(iii) Interconnectivity [ 6 marks]

(c) (i) List, in the correct order, the LAST FIVE layers of the open system interconnection
(OSI) model for computer communication. [ 5 marks]

(ii) For any THREE of the layers listed in (c) (i), describe the role EACH plays in
data communication. [ 6 marks]

(d) A company has FOUR desktop computers and ONE server and wishes to network them.
The company has a twisted pair cable as well as a switch. Draw a diagram to illustrate
how the devices can be connected. Carefully label all components. [ 4 marks]

Total 25 marks

6. (a) A user is running a game on a computer. Indicate what situation would cause the game
process to move from

(i) ready to running

(ii) ready to blocked. [ 4 marks]

(b) (i) Outline the function of the process control block (PCB) in an operating system.
[ 1 mark ]

(ii) Briefly describe FOUR components of a PCB. [ 8 marks]

(c) (i) Explain how device drivers function in an operating system. [ 3 marks]

(ii) State THREE reasons why device drivers may need to be updated. [ 3 marks]

(d) Batch systems, multi-programming systems, and multi-user systems were significant
developments in the history of operating systems. Briefly describe EACH type of
operating system. [ 6 marks]

Total 25 marks
END OF TEST

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

02215020/CAPE 2013

TEST CODE 02115020
FORM TP 2014160 MAY/JUNE 2014

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

16 MAY 2014 (a.m.)

READ THE FOLLOWING INSTRUCTIONS CAREFULLY.

1. This paper consists of THREE sections.

2. Answer ALL questions from the THREE sections. Each section consists
of TWO questions.

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


114662

Copyright © 2013 Caribbean Examinations Council


All rights reserved.
02115020/CAPE 2014
- 2-

SECTION A

COMPUTER ARCHITECTURE AND ORGANIZATION

Answer BOTH questions.

1. (a) Draw a clearly labelled block diagram of a 2 to 1 line multiplexer. [5 marks]

(b) Explain what is meant by the term ‘logic gate’. [2 marks]

(c) Write the truth table for the circuit shown in Figure 1 by listing all possible input bit patterns
and their corresponding outputs.

Figure 1.
[4 marks]

(d) State which of the following terms are associated with a single output value:

• Decoder
• Fip-flop
• Multiplexor [2 marks]

GO ON TO THE NEXT PAGE


02115020/CAPE 2014
- 3-

(e) A decoder is used to display the number of the teller who is available to serve the next
customer in a bank. The seven-segment configuration illustrated in Figure 2 is used to
form the number of the teller.

F G B

E C

Figure 2.

(i) If there are three bits needed to display a digit, calculate how many digits this
decoder can display. [2 marks]

(ii) List the letters of the segments that must be switched on to display the number 5.
[5 marks]

(f) Find the 4-bit two’s complement of –7. [2 marks]

(g) Consider the following floating point representation:

1-bit sign, 3-bit exponent, 5-bit mantissa

Calculate the decimal representation of 001110110. [3 marks]

Total 25 marks

GO ON TO THE NEXT PAGE


02115020/CAPE 2014
- 4-

2. (a) Describe the THREE main activities that take place in an instruction cycle, stating the
correct order. [5 marks]

(b) (i) Give ONE similarity and ONE difference between RAM and hard disks as used
in computer systems. [2 marks]

(ii) Give TWO reasons why registers are included in the CPU of a computer.
[4 marks]

(c) Briefly describe a situation where EACH of the following can be used:

(i) Supercomputer

(ii) PDA

(iii) Mainframe [6 marks]

(d) Describe the kind of information that is typically stored in the ROM of a computer.
[2 marks]

(e)
Discuss TWO reasons why current computers may not be able to work efficiently with
new storage devices developed ten years from now. [6 marks]

Total 25 marks

GO ON TO THE NEXT PAGE


02115020/CAPE 2014
- 5-

SECTION B

PROBLEM SOLVING WITH COMPUTERS

Answer BOTH questions.

3. (a) Give ONE example of EACH of the following control constructs:

(i) Sequence

(ii) Selection

(iii) Iteration [6 marks]

(b) A secondary school is doing a survey on students’ favourite subjects. Students are asked
to vote for any of four choices: Mathematics, English, Spanish, none. If Mathematics,
English or Spanish is not the favourite, students vote “none”.

Write an algorithm to find and print:

(i) The number of students that voted for EACH of the subjects: Mathematics, English,
Spanish

(ii) The TOTAL number of students that voted for Mathematics, English or Spanish

Assume that on the day of the survey, 100 students are present. Also assume that all votes
are valid. [10 marks]

(c) Write an algorithm that uses iteration to find the sum of all multiples of six and all multiples
of seven between 100 and 250 exclusive. Use one variable, for example, sumMult, to
accumulate the sum of the multiples of both numbers in the given range. [9 marks]

Total 25 marks

GO ON TO THE NEXT PAGE


02115020/CAPE 2014
- 6-

4. (a) Construct an algorithm to solve the following problem.

Data exists for ten items. Each line of data consists of a product name, price and
discount %. You are required to read the data and complete the following tasks.

(i) Print the product name, the discount for that product followed by the new price.
For example, given

Shirt 120 25

The algorithm should print

Shirt 30 90

where “Shirt” is the product, $30 is the discount of 25% and $90 is the price after
the discount.

(ii) Print the TOTAL amount of product discounts overall.


If the total amount of discounts is greater than $500, print “Discounts exceeded.”
[12 marks]

(b) Construct a flow chart to represent the algorithm given in 4 (a) above. [6 marks]

(c) Read the following algorithm and answer the questions that follow.

read x
sum1 = 1
while x < 10 do
sum1 = sum1 *(x-1)
print sum1
read x
endwhile
print ‘Sum=’, sum1

What would the algorithm print given the line of input data below? (Clearly show how
you arrived at your answer.)
5 3 2 6 12 4
[7 marks]

Total 25 marks

GO ON TO THE NEXT PAGE


02115020/CAPE 2014
- 7-

SECTION C

PROGRAMMING

Answer BOTH questions.

5. (a) State the stage of the translation process that represents EACH of the following descriptions:

(i) A stream of characters making up the source program is read from left to right and
grouped into tokens

(ii) A piece of code is transformed to make it more efficient without changing its output
or side effects [2 marks]

(b) Explain the role of a ‘watch’ in programming. [2 marks]

(c) Write a C function which accepts an integer array and an integer variable indicating the
size of the array. The function should return a count of the numbers in the array that are
LESS THAN 20. [6 marks]

(d) A nonprofit organization is asking for donations for a worthy cause. They hope to raise
$100,000.

All donations are stored in a file called ‘donations.txt’. The first line of the file gives the
amount the organization hopes to raise. Each line thereafter contains the amount of each
donation. The last line of data in the file contains –1 only.


Write a C program that determines and outputs to a file, “funds.txt”, the total funds raised
and how many donations were made. (You may not use arrays in your solution.)
[15 marks]

Total 25 marks

GO ON TO THE NEXT PAGE


02115020/CAPE 2014
- 8-

6. (a) Explain why indentation is important in programming. [2 marks]

(b) Why is it recommended that comments be used in programming code? [2 marks]

(c) What output is produced by the following C program? (For the output state the values
of i and j at each stage.)

#include <stdio.h>
int main ()
{ int i, j, final = 1;
for (j = 9; j > 0; j = j – 3) {
i = j / 3;
while (i < j) {
printf("\ni is %d j is %d\n",i, j);
j--;
i = i + 1;
final = final + 2*j;
} //while
printf("\nNew i = %d", i);
}//for
printf("\nFinal Output: %d\n", final);
scanf("%c");
return 0;
}//main
[11 marks]

(d) Write a C program that accepts two values, price and tax (both of type float). The
program applies tax to price and prints the old price and the new price in an appropriate
message. Note that tax is given as a percentage.

For example, given 1000 10

The program prints: Old price: $1000 New Price with tax: $1100 [6 marks]

(e) Write C code to read four integers and print their average. (Do not write an entire
program.) [4 marks]

Total 25 marks

END OF TEST

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

02115020/CAPE 2014
TEST CODE 02215020
FORM TP 2014162 MAY/JUNE 2014

CARIBBEAN E XAM I NAT I O N S COUNCIL


CARIBBEAN ADVANCED PROFICIENCY EXAMINATION®
COMPUTER SCIENCE
FURTHER TOPICS IN COMPUTER SCIENCE

UNIT 2 – Paper 02
2 hours 30 minutes

19 MAY 2014 (p.m.)

READ THE FOLLOWING INSTRUCTIONS CAREFULLY.

1. This paper consists of THREE sections.

2. Answer ALL questions from the THREE sections. Each section consists
of TWO questions.

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

Copyright © 2013 Caribbean Examinations Council


114680

All rights reserved.


02215020/CAPE 2014
- 2-

SECTION A

DATA STRUCTURES

Answer BOTH questions.

1. (a) State whether a stack must exist for each of the following operations:

(i)
CreateStack

(ii)
DestroyStack [2 marks]

(b) (i) In a searching application the procedures Add or Mult cause the following to
occur:

• The stack is popped twice


• The two popped items are added (Add) or multiplied (Mult)
• The result is pushed back onto the stack

Use the following sequence of procedure calls to determine the contents of the
stack below if X = 1, Y = 2, Z = 3, and W = 4. (Show all steps involved.)

Push (Stack, X)
Push (Stack, Y)
Add (Stack)
Push (Stack, Z)
Push (Stack, W)
Mult (Stack)
Add (Stack) [7 marks]

(ii) State ONE condition that must exist for the Add and Mult procedures to work
effectively. [1 mark]

(iii) If the ADD operation is continuously used on the stack, explain what would happen
to the stack. [2 marks]

(c) (i) Explain the purpose of Enqueue() and Dequeue() in a FIFO queue. [5 marks]

(ii) Using only the operations of the queue Abstract Data Type (ADT), write an
algorithm CountQueue that returns an integer count of the number of elements in
the queue. [8 marks]

Total 25 marks

GO ON TO THE NEXT PAGE


02215020/CAPE 2014
- 3-

2. (a) The numbers 5 and 15 are to be stored in a singly linked list. Explain how these numbers
would be inserted into the list. Draw the final linked list. [10 marks]

(b) (i) Write C code to declare an array num that can store 100 integers. [2 marks]

(ii) Write code to fill num with integers entered by the user. [4 marks]

(iii)
Write C code to accept an integer key from the user and search num to see if key
is present. If found, print the location of key; otherwise, print “Key Not found”.
[9 marks]

Total 25 marks

GO ON TO THE NEXT PAGE


02215020/CAPE 2014
- 4-

SECTION B

SOFTWARE ENGINEERING

Answer BOTH questions.

3. (a) Explain what is meant by a ‘deliverable’ in the systems development life cycle.
[3 marks]

(b)
Describe TWO factors that can cause an information system to be replaced. For each
factor describe why the development of a new information system would be necessary.
[4 marks]

(c) Describe THREE main factors that must be considered during a feasibility study of the
systems development life cycle. [6 marks]

(d) A popular diet drink is sold in many stores. Each store has one or more branches. A branch
is supervised by a manager who hires employees to run its day-to-day business activities.
Employees can be transferred to any branch. The following information is stored on a
drink: Barcode Num (primary key), size, and flavour.

Draw an entity–relationship diagram for the above scenario. [12 marks]

Total 25 marks

GO ON TO THE NEXT PAGE


02215020/CAPE 2014
- 5-

4. Students at a university are required to register for courses using an online system. Some of the
information to be entered is illustrated in the screen-based form below.

CAPE University
Student Registration Form
Student ID:
Date of Birth:
Course Code and Name:
Course Code and Name:
Course Code and Name:
Course Code and Name:
Course Code and Name:

(a) Answer the following questions based on the options below.

• Student ID
• Date of Birth
• Course Code and Name

For EACH option:

(i) Write TWO examples of data that may be entered in the form. [6 marks]

(ii) Explain whether a textbox, menu, command line, checkbox or other option would
be suitable. [3 marks]

(iii) Describe a test that could be used to ensure that valid data is entered.
[3 marks]

(b) A pharmaceutical company receives orders from pharmacies at its sales department. The
sales department prepares an internal order form that is sent to the warehouse and also
sends an acknowledgement to the pharmacy.

The data from the internal order form is stored in a database. The warehouse checks its
stock database for the availability of the items. For items in stock, the order is prepared
and shipping instructions are sent to the shipping department which sends a copy to the
sales department and to the accounting department. The accounting department sends the
invoice to the customer. All items not in stock are placed on backorder to be processed
by the shipping department.

Draw a Level-0 data flow diagram that shows the flow of information between the pharmacy,
pharmaceutical company and various departments within the company. [13 marks]

Total 25 marks

GO ON TO THE NEXT PAGE


02215020/CAPE 2014
- 6-

SECTION C

OPERATING SYSTEMS AND COMPUTER NETWORKS

Answer BOTH questions.

5. (a) You have been asked to set up a small home network for a friend. She needs Internet access
on computers. She has purchased a switch and a router. The Internet service provider has
already installed a modem which is providing Internet service to her home. She also has
a large supply of twisted pair cables and connectors.

(i) Draw a diagram to show how her network would be set up. [6 marks]

(ii) State the role of the modem, switch and router in the network drawn. [ 3 marks]

(b) What is a hybrid network topology? [1 mark]

(c) Describe ONE advantage and ONE disadvantage of using fibre optics as a transmission
medium. [4 marks]

(d) With the aid of a diagram, explain how data is communicated in an IEEE802.11b
network. [6 marks]

(e) Explain why the quality of voice over IP (VOIP) communication might be different from
telephone communication service as offered by the telephone company. [3 marks]

(f) What is the main purpose of general packet radio service (GPRS)? [2 marks]

Total 25 marks

GO ON TO THE NEXT PAGE


02215020/CAPE 2014
-7-

6. (a) Early operating systems were ‘primitive batch systems’. Currently there exists ‘sophisticated
multiuser systems’.

Describe EACH of the following terms:

(i)
Primitive batch systems

(ii)
Sophisticated multiuser systems [4 marks]

(b) An application process exists in a computer. Explain what is meant by a

(i) blocked process

(ii) running process. [4 marks]

(c) A user is playing a game that accesses a small file on a disk to get a high score. The game
process reads the file, gets the value and uses it in the process itself.

Explain how interrupts are used in the above scenario. [3 marks]

(d) What is pre-emptive scheduling of processes? [2 marks]

(e) Student records at Bayshore High School are stored in a database on a computer at the
school. Discuss THREE ways in which the students’ records can be secured from unauthorized
access. [9 marks]

(f) Explain the role of the special software used to allow the operating system to communicate
with devices. [3 marks]

Total 25 marks

END OF TEST

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

02215020/CAPE 2014
TEST CODE 02115020
FORM TP 2015165 MAY/JUNE 2015

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

15 MAY 2015 (a.m.)

READ THE FOLLOWING INSTRUCTIONS CAREFULLY.


5165

1. This paper consists of THREE sections.

2. EACH section consists of TWO questions.

3. Answer ALL questions in the THREE sections.

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


127112

Copyright © 2014 Caribbean Examinations Council


All rights reserved.

02115020/CAPE 2015
-2-

SECTION A

COMPUTER ARCHITECTURE AND ORGANIZATION

Answer BOTH questions.

1. (a) Your friend Samuel Carter would like you to design a security alarm system for his house.
The security alarm should sound if the alarm switch is enabled (turned on) and a window
or door is opened. For example, if the alarm switch is enabled and a window is opened,
the alarm should sound.

(i) Write down the truth table (that is, list all possible input bit patterns and their
corresponding outputs) for this scenario. [8 marks]

(ii) Using only primary logic gates, design and draw the associated circuit.
[4 marks]

(b) Explain what is meant by the term ‘demultiplexer’. [2 marks]

(c) Draw a clearly labelled block diagram of a 3-to-8 line decoder. [3 marks]

(d) Find the decimal equivalent of the hexadecimal number 1A53. Show ALL working.
[3 marks]

(e) Find the 8 bit two’s complement of –21. Show ALL working. [2 marks]

(f) Consider the following floating point representation:

1-bit sign, 3-bit exponent, 5-bit mantissa

Calculate the decimal representation of 001101011. Show ALL working. [3 marks]

Total 25 marks

GO ON TO THE NEXT PAGE


02115020/CAPE 2015
-3-

2. (a) Describe TWO main functions of the CPU. Include in your description a definition of the
CPU. [6 marks]

(b) The following questions are related to the fetch-decode-execute cycle:

(i) State the purpose of the ‘fetch’ operation. [1 mark]

(ii) State the purpose of the ‘decode’ and ‘execute’ operations. [2 marks]

(iii) Define the term ‘instruction set’. [1 mark]

(c) The following questions are related to memory.

(i) How does ROM differ from RAM? [4 marks]

(ii) Your friend is interested in purchasing a new computer. He is considering the


following options:

Option 1: Purchasing a large amount of cache and a small amount of RAM.

Option 2: Purchasing a large amount of RAM and a small amount of cache.

Advise your friend by explaining ONE advantage and ONE disadvantage of EACH
option. [4 marks]

(d) There are several registers found in the CPU.

(i) What is the collective purpose of these registers? [1 mark]

(ii) Name THREE registers found in the CPU and for EACH, describe its function.
[6 marks]

Total 25 marks

GO ON TO THE NEXT PAGE


02115020/CAPE 2015
-4-

SECTION B

PROBLEM SOLVING WITH COMPUTERS

Answer BOTH questions.

3. (a) Explain what happens during the ‘implementation and review’ phase of the problem-solving
process. [4 marks]

(b) Examine the following algorithms labelled Algorithm 1 and Algorithm 2 and answer the
questions that follow.

Algorithm 1

FOR Y = 1 TO 20 DO
PRINT Y
END FOR

Algorithm 2

READ Z
SUM1 = 0
WHILE Z > -1 DO
SUM1 = SUM1 + Z
READ Z
END WHILE

(i) Which of the algorithms above illustrates unbounded iteration? [1 mark]



(ii) Which of the algorithms above illustrates bounded iteration? [1 mark]

(iii) Explain how the loop in Algorithm 1 is expected to terminate. [2 marks]

(iv) Explain how the loop in Algorithm 2 is expected to terminate. [2 marks]

GO ON TO THE NEXT PAGE


02115020/CAPE 2015
-5-

(c) The following algorithm is designed to print a table of cubes of all the odd positive integers
between 7 (inclusive) and 121 (inclusive). However, there are errors in the algorithm.

1. print “Odd Number Cube”

2. print “========== =====”

3. j = 1

4. while j < 121

5. j * j * j = cube

6. print j, cube

7. j = j - 1

8. end while

By referring to the specific line number, identify and correct FOUR errors in the algorithm,
so that it would achieve its objective. [8 marks]

(d)
Write an algorithm that uses iteration to find the sum of all multiples of 8 and all multiples
of 11 between m (inclusive) and n (exclusive) where m and n are two positive integers
entered via the keyboard. Assume that n > m. [7 marks]

Total 25 marks

GO ON TO THE NEXT PAGE


02115020/CAPE 2015
-6-

4. (a) Trace through the execution of the following algorithm and draw the output in your answer
booklet exactly as it would be generated by the algorithm.

You should carefully note the following:

• writeSym(n) prints n ‘$’ from the current cursor position.


Example: writeSym(2) would print
$$

• write(list-1) continues output of list-1 on the current line, from the current
cursor position.

• writeln() terminates output on the current line. Subsequent output begins on a


new line

• writeln(list-1) continues output of list-1 on the current line from the current
cursor position but any subsequent output begins on a new line.

SIZE = 12

j = SIZE – 4

while j >= 2 do

writeSym(j + 2)

writeln(‘#’)

j = j – 3

endwhile

writeln(‘*’)

for k = 1 to (j + 5) do

write(‘@’)

writeln()

[12 marks]

GO ON TO THE NEXT PAGE


02115020/CAPE 2015
-7-

(b) Construct a flowchart to represent the following algorithm.

start

print ‘Enter a:’

read a

Set total to 1

while a > –1 do

a = 2 * a;

if a < 20 then

a = a – 1

else a = a + 1

endif

total = total + a

print ‘Enter a:’

read a

endwhile

print total

stop

[13 marks]

Total 25 marks

GO ON TO THE NEXT PAGE


02115020/CAPE 2015
--

SECTION C

PROGRAMMING

Answer BOTH questions.


5. (a) The translation process comprises several stages.

(i) Describe the purpose of the lexical analysis stage of this translation process.
[3 marks]

(ii) Comment on the existence of error detection in this lexical analysis stage.
[1 mark]

(b) What is modular programming and how does it encourage good programming practices?
[2 marks]

(c) Every term Mr James creates a file containing student IDs and the final mark for each
student in his Biology class. This term, Mr James would like to automatically determine
the number of students gaining grades A, B, C and F, as well as the highest mark gained.
He has asked you to write a C program to do this.

The file is formatted as follows, where 1223B represents a student ID and 50 represents
the student mark.

1223B 50
2345A 89
4567X 76
4432K 65
5434C ...

Input file: testgrades.txt

Write a C program which would read in the contents of the file, testgrades.txt, and output
the number of students gaining the grades A, B, C and F and the highest mark gained. The
grade categories are as follows:

A = 80 to 100
B = 70 to 79
C = 60 to 69
F < = 59 [10 marks]

(d) A palindrome is a sequence of characters which give the same word when read in both
directions. For example, madam.


Write a C program which accepts a string from a user and determines whether the string
is a palindrome or not. Assume that all letters are lower case. [9 marks]

Total 25 marks
GO ON TO THE NEXT PAGE
02115020/CAPE 2015
--

6. (a) Briefly describe EACH of the following types of programming languages:

(i) Declarative [2 marks]

(ii) Imperative (procedural) [2 marks]

(iii) Scripting [2 marks]


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

#include <stdio.h>

int main () {int x, i = 2, j = 10, final = 1;

while (i <= j * 2) {

i = j - 3;

for (x = j; x >= 0; x = x - 2) {

printf(“x is %d j is %d i is %d\n”,x, j, i);

j--;

i++;

final = final + (i - 1) * (j-2);

} //for

printf(“New i = %d”, i);

i = i + 3;

}//while

printf(“\nFinal Output: %d\n”, final);

return 0;

}//main

[9 marks]

GO ON TO THE NEXT PAGE


02115020/CAPE 2015
- 1 -

(c) A vendor needs to use a C application to store data about some fruits that he sells. Each
fruit has an ID (integer), a cost price (floating point), a selling price (floating point) and a
quantity in stock (integer).

(i) Write a declaration for a C struct fruitRec that can store the record for a fruit.
[2 marks]

(ii) Declare TWO variables, apple and pear, that have the record structure declared
in (c) (i) above. [1 mark]

(iii) Write C code to put data into the apple struct of (c) (ii) above. You can use any
values you like. [2 marks]

Assume that two fruitRec structs, pine and mango, are already loaded with data.
(iv)
Write C code to exchange the cost price and selling price values of pine and mango.
[2 marks]

(v) Assume that two fruitRec structs a, b are already loaded with data. Write C code
to print the total expected profit to be made from the sale of the two fruits.

Profit is calculated as shown below.

Profit = (Selling Price × Quantity) – (Cost Price × Quantity)


[3 marks]

Total 25 marks

END OF TEST

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

02115020/CAPE 2015
TEST CODE 02215020
FORM TP 2015167 MAY/JUNE 2015

CARIBBEAN E XAM I NAT I O N S COUNCIL

CARIBBEAN ADVANCED PROFICIENCY EXAMINATION®

COMPUTER SCIENCE

FURTHER TOPICS IN COMPUTER SCIENCE

UNIT 2 – Paper 02

2 hours 30 minutes

18 MAY 2015 (p.m.)

READ THE FOLLOWING INSTRUCTIONS CAREFULLY.

1. This paper consists of THREE sections.

2. EACH section consists of TWO questions.

3. Answer ALL questions in the THREE sections.


5167

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


127119

Copyright © 2014 Caribbean Examinations Council


All rights reserved.

02215020/CAPE 2015
-2-

SECTION A

DATA STRUCTURES

Answer BOTH questions.

1. (a) Why are stacks and queues classified as ADTs? [2 marks]

(b) Describe the main differences between stacks and queues. Support your answer by giving
a real-life example to illustrate how EACH ADT can be used.

Note: An example should be given for each ADT. [6 marks]

(c) Use C code to:

(i) Write a function that adds an integer to a stack. The arguments for your function
should be the stack and the number to be added. Your function should not call
any other functions. [7 marks]

(ii) Write a function that adds an integer to a queue. The arguments for your function
should be the queue and the number to be added. Your function should not call
any other functions. [7 marks]

(d) Letters A, C, X and E have been added to a stack in the given order. Draw a diagram to
illustrate how the letter C could be removed from this stack. Use the diagram to show the
changing contents of the stack at EACH stage of the process. [3 marks]

Total 25 marks

GO ON TO THE NEXT PAGE


02215020/CAPE 2015
-3-

2. (a) Consider the array called data below.

data 10 13 8 15 16 6 22 4

A selection sort algorithm is being used to sort the eight integers in ascending order
(that is, smaller values must come before bigger values).

Draw the array after the first, second and third passes of selection sort (that is, 3 diagrams
in all). [6 marks]

(b) A linked list contains three nodes with the integers 3, 4 and 5, where 3 is at the head of
the list, 4 is in the middle and 5 is at the end.

(i) Draw a diagram to show the linked list. [3 marks]

(ii) Explain how to delete the integer 3 from the linked list. [4 marks]

(c) Assume that an array, numbers, of size 50 is already loaded with 50 integers and sorted
in ascending order.

(i) Write code to obtain the value of an integer, target, from the user. [2 marks]

Using the array, numbers, write code to search for the value, target, using binary
(ii)
search. If target is found, print its location, otherwise print –1. [Target is the value
obtained from the user in (c) (i) above.] [10 marks]

Total 25 marks

GO ON TO THE NEXT PAGE


02215020/CAPE 2015
-4-

SECTION B

SOFTWARE ENGINEERING

Answer BOTH questions.

3. (a) Explain the rapid prototyping approach to systems development. [2 marks]

(b) Describe the main challenge which the rapid prototyping approach seeks to overcome.
[2 marks]

(c) Some systems analysts believe that the entire systems development life cycle can be
initiated and completed during the maintenance phase. Explain FOUR reasons why this
may be true. Your answer should contain FOUR major points. [8 marks]

(d) New Smiles is a doctor’s office operating in the busy town of Happy Ville. Patients book
appointments in advance to see Dr Sam. Typically, a patient calls into the office to request
an appointment. The receptionist asks for the person’s name to check whether their patient
record already exists in the patient database. If the record does not exist, a new patient
record must be created in the database using the following information gathered from the
patient: name, telephone number, address, and a brief medical history.

On completion of this standard procedure the receptionist books the appointment; that is,
the patient submits a preferred date/time, the receptionist checks the appointment database
for available dates/time and schedules a suitable appointment based on this. The scheduled
appointment is returned to the patient.

Finally, every day the receptionist calls patients one day before their appointment to provide
them with a reminder. A list of upcoming appointments is generated from the appointment
database to facilitate this.

Draw a Level-0 diagram to represent the flow of data described in the case above.
[13 marks]

Total 25 marks

GO ON TO THE NEXT PAGE


02215020/CAPE 2015
-5-

4. (a) Why are data flow diagrams developed during the analysis phase as well as the design
phase of the system development life cycle? [3 marks]

(b) State THREE benefits of the object oriented approach to software design. [3 marks]

(c) Describe TWO of the major deliverables resulting from the design phase of the system
development life cycle. [4 marks]

(d) In a certain company, employees are assigned to a single department. Each department is
managed by a manager and a manager can be assigned to more than one department. There
are a number of supervisors who work in each department and each one may supervise
one or more employees. Each employee has a unique employee ID (primary key). The
company keeps track of the name of each employee, his/her address, job title, next of kin
and an emergency contact number.

Draw an entity-relationship model for the above scenario. Relationships should be named
and the cardinality of each relationship should be clearly specified. All given attributes
should be clearly noted in your model. [15 marks]

Total 25 marks

GO ON TO THE NEXT PAGE


02215020/CAPE 2015
-6-

SECTION C

OPERATING SYSTEMS AND COMPUTER NETWORKS

Answer BOTH questions.


5. (a) Briefly describe TWO advantages of a client/server network over a peer to peer network.
[4 marks]

(b) (i) Explain what is meant by the term ‘firewall’. [2 marks]

(ii) Explain why firewall software needs to be frequently updated. [2 marks]

(c) State TWO differences between FDDI and Ethernet network architectures. [2 marks]

(d) Briefly explain the role of the network and transport layers in the OSI network model.
[4 marks]

(e) Outline THREE reasons why many users prefer wireless routers over wired routers.
[3 marks]

(f) (i) Explain the purpose of GPRS. [2 marks]

(ii) Name and describe TWO applications that use GPRS. [6 marks]

Total 25 marks

GO ON TO THE NEXT PAGE


02215020/CAPE 2015
-7-

6. (a) Carefully explain the role of a device driver in an operating system. [3 marks]

(b) Jeff received a message on his computer: “Document is currently spooling…”

Explain the meaning of the term ‘spooling’. [3 marks]

(c) Outline TWO advantages of a menu interface over a command interface. [4 marks]

(d) Briefly describe TWO components of a process control block in an operating system.
[4 marks]

(e) Besides passwords, explain TWO other ways in which files can be protected from
unauthorized access. [4 marks]

(f) Explain how processes can be scheduled in round-robin. [3 marks]



(g) Explain how an interrupt is handled by the processor in a computer. [4 marks]

Total 25 marks

END OF TEST

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

02215020/CAPE 2015
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 AREA      DO NOT WRITE IN THIS AREA      DO 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 AREA      DO NOT WRITE IN THIS AREA      DO 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 AREA      DO NOT WRITE IN THIS AREA      DO 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 AREA      DO NOT WRITE IN THIS AREA      DO 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 AREA      DO NOT WRITE IN THIS AREA      DO 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 AREA      DO NOT WRITE IN THIS AREA      DO 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 AREA      DO NOT WRITE IN THIS AREA      DO 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 AREA      DO NOT WRITE IN THIS AREA      DO 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 AREA      DO NOT WRITE IN THIS AREA      DO 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 customer’s 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 AREA      DO NOT WRITE IN THIS AREA      DO 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 AREA      DO NOT WRITE IN THIS AREA      DO 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 AREA      DO NOT WRITE IN THIS AREA      DO 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 AREA      DO NOT WRITE IN THIS AREA      DO 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 AREA      DO NOT WRITE IN THIS AREA      DO 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 AREA      DO NOT WRITE IN THIS AREA      DO 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 AREA      DO NOT WRITE IN THIS AREA      DO 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 AREA      DO NOT WRITE IN THIS AREA      DO 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 AREA      DO NOT WRITE IN THIS AREA      DO 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 AREA      DO NOT WRITE IN THIS AREA      DO 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 AREA      DO NOT WRITE IN THIS AREA      DO 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 AREA      DO NOT WRITE IN THIS AREA      DO 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 AREA      DO NOT WRITE IN THIS AREA      DO NOT WRITE IN THIS AREA  

(c) (i) Declare in C a structure called BookRec that can store data for a book. A book’s
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 AREA      DO NOT WRITE IN THIS AREA      DO 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
TEST CODE 02215020
FORM TP 2016177 MAY/JUNE 2016

CARIBBEAN E XAM I NAT I O N S COUNCIL

CARIBBEAN ADVANCED PROFICIENCY EXAMINATION®

COMPUTER SCIENCE

FURTHER TOPICS IN COMPUTER SCIENCE

UNIT 2 – 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”*”
02215020/CAPE 2016 Sequential Bar Code
-4-

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

DATA STRUCTURES

Answer BOTH questions.

1. (a) For EACH of the following scenarios, identify which data structure would be MOST
appropriate when writing software.

(i) For a call centre; ensure that calls are answered in first-in, first-out order

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

(ii) To allow the ‘Undo’ button to operate correctly in a word processing


application (for example, Microsoft Word)

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

(iii) To store an unknown number of data items and subsequently search this data
structure for different keys

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

(b) In the space provided below, write code to implement the following function. The function
accepts a string s, stores the string in a new node and inserts this node at the front of an
existing linked list. Assume that top points to the first node of the existing list.

public void insertToFront(String s)


[3 marks]

GO ON TO THE NEXT PAGE


02215020/CAPE 2016
‘‘*’’Barcode Area”*”
Sequential Bar Code
-5-
DO NOT WRITE IN THIS AREA      DO NOT WRITE IN THIS AREA      DO NOT WRITE IN THIS AREA  

(c) Q is an empty queue of size 5. In the space provided below, draw diagrams to show the
contents of the queue after each of the following lines is executed: Lines 3, 4 and 5. Show
all elements in the queue for each illustration.

Line 1 Q.enqueue (‘A’);


Line 2 Q.enqueue (‘B’);
Line 3 Q.enqueue (‘C’);
Line 4 Char c = Q.dequeue ( );
Line 5 Q.enqueue (‘A’);


[3 marks]

(d) Describe THREE operations that can be executed on a stack.

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

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

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

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

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

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

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

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

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

GO ON TO THE NEXT PAGE


02215020/CAPE 2016
‘‘*’’Barcode Area”*”
Sequential Bar Code
-6-

DO NOT WRITE IN THIS AREA      DO NOT WRITE IN THIS AREA      DO NOT WRITE IN THIS AREA  
(e) In the space provided below, write C code which will reverse the order of a set of items in
a queue. For example, if initially the queue contains the elements x1, x2, x3 … xN (with
x1 at the front of the queue) then your code should reverse this order to xN … x3, x2, x1
(where xN is at the front of the queue).


[10 marks]

Total 25 marks

GO ON TO THE NEXT PAGE


02215020/CAPE 2016
‘‘*’’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) A certain singly linked list is loaded with five integers. The head of the list is accessed via
top.

(i) Explain how the first node can be deleted.

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

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

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

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

(ii) Explain how the last node can be deleted.

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

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

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

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

(iii) Explain how any node between the first and last can be deleted.

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

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

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

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

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

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

GO ON TO THE NEXT PAGE


02215020/CAPE 2016
‘‘*’’Barcode Area”*”
Sequential Bar Code
-8-

DO NOT WRITE IN THIS AREA      DO NOT WRITE IN THIS AREA      DO NOT WRITE IN THIS AREA  
(b) (i) Write C code to declare an array number that can store 10 integers.

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

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

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

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

(ii) Write code to fill number with integers entered by the user.

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

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

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

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

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

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

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

GO ON TO THE NEXT PAGE


02215020/CAPE 2016
‘‘*’’Barcode Area”*”
Sequential Bar Code
-9-
DO NOT WRITE IN THIS AREA      DO NOT WRITE IN THIS AREA      DO NOT WRITE IN THIS AREA  

(iii) In the space provided below, write C code to accept an integer key from the user
and search number to see if key is present using linear search. If found, print
the location of key; otherwise, print “Key Not found”.


[9 marks]

Total 25 marks

GO ON TO THE NEXT PAGE


02215020/CAPE 2016
‘‘*’’Barcode Area”*”
Sequential Bar Code
- 10 -

DO NOT WRITE IN THIS AREA      DO NOT WRITE IN THIS AREA      DO NOT WRITE IN THIS AREA  
NOTHING HAS BEEN OMITTED

GO ON TO THE NEXT PAGE


02215020/CAPE 2016
‘‘*’’Barcode Area”*”
Sequential Bar Code
- 11 -
DO NOT WRITE IN THIS AREA      DO NOT WRITE IN THIS AREA      DO NOT WRITE IN THIS AREA  

SECTION B

SOFTWARE ENGINEERING

Answer BOTH questions.

3. (a) Apart from time and costs, outline TWO factors that may be considered when completing
a risk assessment for software development.

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

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

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

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

(b) What is meant by the term ‘CASE tools’?

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

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

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

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

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

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

GO ON TO THE NEXT PAGE


02215020/CAPE 2016
‘‘*’’Barcode Area”*”
Sequential Bar Code
- 12 -

DO NOT WRITE IN THIS AREA      DO NOT WRITE IN THIS AREA      DO NOT WRITE IN THIS AREA  
(c) List FOUR reasons why the Waterfall model might not be suitable for managing most
software projects.

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

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

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

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

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

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

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

(d) Describe TWO weaknesses of the Rapid Prototyping model of software development.

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

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

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

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

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

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

(e) The following case provides details for a university registration system. In the space
provided on page 13, draw a Level-0 dataflow diagram to detail the flow of data as described
in the case.

A prospective student sends an application in the hope of being accepted by a university.


Each application is inspected and a letter is sent to the prospective student to indicate
whether he/she was accepted by the university or not. Students who have been accepted
must take their acceptance letter and all supporting documents to the university in order
to register. Registration details are then stored in the student information file and a student
identification number is issued. To complete registration, the student uses his/her student
ID to pay university and other sundry fees via credit card. Fees are processed and financial
details are stored in the finance file. A receipt is issued to the student at the end of this
process to confirm fee payment and the completion of registration. Note that application
form data and student registration data are passed through the system after the related
processes.

GO ON TO THE NEXT PAGE


02215020/CAPE 2016
‘‘*’’Barcode Area”*”
Sequential Bar Code
- 13 -
DO NOT WRITE IN THIS AREA      DO NOT WRITE IN THIS AREA      DO NOT WRITE IN THIS AREA  


[12 marks]

Total 25 marks

GO ON TO THE NEXT PAGE


02215020/CAPE 2016
‘‘*’’Barcode Area”*”
Sequential Bar Code
- 14 -

DO NOT WRITE IN THIS AREA      DO NOT WRITE IN THIS AREA      DO NOT WRITE IN THIS AREA  
4. The following questions are related to software development and database design.

(a) What is cardinality? State ONE example.

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

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

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

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

(b) List THREE characteristics of a well-engineered software product.

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

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

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

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

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

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

(c) Differentiate between ‘functional’ and ‘nonfunctional’ requirements. Give ONE example
of EACH term.

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

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

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

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

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

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

GO ON TO THE NEXT PAGE


02215020/CAPE 2016
‘‘*’’Barcode Area”*”
Sequential Bar Code
- 15 -
DO NOT WRITE IN THIS AREA      DO NOT WRITE IN THIS AREA      DO NOT WRITE IN THIS AREA  

(d) Explain TWO types of tests completed during the testing phase, other than white box and
black box testing.

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

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

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

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

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

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

GO ON TO THE NEXT PAGE


02215020/CAPE 2016
‘‘*’’Barcode Area”*”
Sequential Bar Code
- 16 -

DO NOT WRITE IN THIS AREA      DO NOT WRITE IN THIS AREA      DO NOT WRITE IN THIS AREA  
(e) The Science College is a university which offers several pure and applied science courses.
The university employs 20 lecturers and enrolls several students. Lecturers teach many
courses and many students. Each course is completed by many students.

In the space provided below, draw an entity relationship diagram to represent the scenario
above. On your diagram, define ALL relationships and cardinalities in BOTH directions.
You MUST follow the conventions of ER diagramming to be awarded full marks.


[12 marks]

Total 25 marks

GO ON TO THE NEXT PAGE


02215020/CAPE 2016
‘‘*’’Barcode Area”*”
Sequential Bar Code
- 17 -
DO NOT WRITE IN THIS AREA      DO NOT WRITE IN THIS AREA      DO NOT WRITE IN THIS AREA  

SECTION C

OPERATING SYSTEMS AND COMPUTER NETWORKS

Answer BOTH questions.


5. (a) Describe the characteristics of EACH of the following transmission media:

(i) Coaxial cable

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

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

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

(ii) Fibre-optic cable

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

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

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

(b) Explain what is an IEEE802.16 network.

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

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

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

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

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

GO ON TO THE NEXT PAGE


02215020/CAPE 2016
‘‘*’’Barcode Area”*”
Sequential Bar Code
- 18 -

DO NOT WRITE IN THIS AREA      DO NOT WRITE IN THIS AREA      DO NOT WRITE IN THIS AREA  
(c) With the aid of a diagram, explain the role of a switch in a local area network.

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

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

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

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

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

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

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

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

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

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

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

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

GO ON TO THE NEXT PAGE


02215020/CAPE 2016
‘‘*’’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) How is data communicated in an IEEE802.11b network? Use a diagram in your response.

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

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

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

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

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

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


[6 marks]

GO ON TO THE NEXT PAGE


02215020/CAPE 2016
‘‘*’’Barcode Area”*”
Sequential Bar Code
- 20 -

DO NOT WRITE IN THIS AREA      DO NOT WRITE IN THIS AREA      DO NOT WRITE IN THIS AREA  
(e) Briefly explain EACH of the following factors that are considered when building a network.

(i) Cost

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

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

(ii) Security

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

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

(iii) Management

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

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

(iv) Expandability

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

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

(v) Interconnectivity

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

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

(f) Explain the role of any TWO of the first five layers of the OSI model for network
communication.

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

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

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

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

Total 25 marks

GO ON TO THE NEXT PAGE


02215020/CAPE 2016
‘‘*’’Barcode Area”*”
Sequential Bar Code
- 21 -
DO NOT WRITE IN THIS AREA      DO NOT WRITE IN THIS AREA      DO NOT WRITE IN THIS AREA  

6. (a) Explain EACH of the following terms:

(i) Virtual memory

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

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

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

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

(ii) Paging

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

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

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

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

(iii) Thrashing

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

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

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

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

(b) Explain how excessive paging affects a computer.

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

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

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

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

GO ON TO THE NEXT PAGE


02215020/CAPE 2016
‘‘*’’Barcode Area”*”
Sequential Bar Code
- 22 -

DO NOT WRITE IN THIS AREA      DO NOT WRITE IN THIS AREA      DO NOT WRITE IN THIS AREA  
(c) State the role of device drivers in an operating system.

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

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

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

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

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

(d) A computer application needs to read a special file on a disk to determine the temperature
at which the CPU is operating.

Explain how the operating system uses interrupts in the above scenario.

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

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

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

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

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

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

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

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

(e) Distinguish between a ʻmultiuser systemʼ and a ʻbatch processing systemʼ.

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

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

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

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

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

..............................................................................................................................................
[4 marks]
GO ON TO THE NEXT PAGE
02215020/CAPE 2016
‘‘*’’Barcode Area”*”
Sequential Bar Code
- 23 -
DO NOT WRITE IN THIS AREA      DO NOT WRITE IN THIS AREA      DO NOT WRITE IN THIS AREA  

(f) Besides passwords, outline ONE way in which files can be protected.

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

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

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

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

(g) Identify THREE components of a process control block (PCB).

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

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

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

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

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

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

Total 25 marks

END OF TEST

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

02215020/CAPE 2016
‘‘*’’Barcode Area”*”
Sequential Bar Code