Computing (9691) · Oct/Nov 2012 · Question paper 21

Cambridge Computing (9691) question paper for paper 21, Oct/Nov 2012 — 9691/21/O/N/12, file 9691_w12_qp_21.pdf.

Advertisement
Loading the paper…

More Computing (9691) papers

Paper 21 in other years

All Computing papers
Text of this paper

w

w
ap
eP

m

e
tr
.X

w
om
.c

s
er

UNIVERSITY OF CAMBRIDGE INTERNATIONAL EXAMINATIONS
General Certificate of Education
Advanced Subsidiary Level and Advanced Level

*5751858000*

9691/21

COMPUTING

October/November 2012

Paper 2

2 hours
Candidates answer on the Question Paper.
No additional materials are required.
READ THESE INSTRUCTIONS FIRST
Write your Centre number, candidate number and name on all the work you hand in.
Write in dark blue or black pen.
You may use a soft pencil for any diagrams, graphs or rough working.
Do not use staples, paper clips, highlighters, glue or correction fluid.
DO NOT WRITE IN ANY BARCODES.
Answer all questions.
At the end of the examination, fasten all your work securely together.
The number of marks is given in brackets [ ] at the end of each question or part question.

This document consists of 14 printed pages and 2 blank pages.
IB12 11_9691_21/3RP
© UCLES 2012

[Turn over

2
1

Soni works for a software house which has been asked to design software for a cycle hire
company, Super Bikes.
Soni decides on the main tasks:
•
•
•
•

collecting the information about new bikes
entering details of repairs
entering details of hirer
entering details of payment

(a) Complete the structure diagram showing these tasks.
Super Bikes

[2]

(b) The collection of information about repairs has three subtasks:
•
•
•

input the repair needed
input the parts list
input the cost of the repair

Add these to the structure diagram in part (a).
© UCLES 2012

9691/21/O/N/12

[1]

For
Examiner's
Use

3
(c) State two reasons for dividing the main task into smaller tasks.

For
Examiner's
Use

1

2
[2]

(d) Each subtask is coded as a program module.
Explain how it is possible to use the same variable name for different variables in
different modules.

[2]

(e) When validating the type of bike (road, hybrid, track) Soni uses
INPUT Bike
IF (Bike = “road”)

(Bike = “hybrid”)

(Bike = “track”)

THEN
OUTPUT Bike “ is valid”
ELSE
OUTPUT “Invalid”
ENDIF
Insert the correct Boolean operator in each space.

© UCLES 2012

9691/21/O/N/12

[2]

[Turn over

4
(f) All bikes in stock have a bike ID. Each bike ID is six characters long and has the format
BIKEXX, where X is a digit.
For example, BIKE65 is a valid bike ID.
(i) In a high-level programming language write code that will validate the format of a
bike ID input into the variable BikeID and output a suitable message. (Add extra
line numbers if required.)
Programming language used
Code
1
2
3
4
5
6
7
8

[10]
© UCLES 2012

9691/21/O/N/12

For
Examiner's
Use

5
(ii) Explain why Bike46 is an invalid bike ID.

For
Examiner's
Use

State the line number of your code in part (f)(i) which detects that it is invalid.
Line Number

[2]

(g) (i) Soni will need to test the logic of this program module.
State whether this is black box testing or white box testing.
[1]
(ii) Soni is also planning to use alpha testing of the software.
Explain who will do the testing, when the testing would be carried out, and what
will be the purpose of this testing stage.
who

when

purpose
[3]

© UCLES 2012

9691/21/O/N/12

[Turn over

6
2

The company stores the bikes in bike racks. The bike racks are in 30 rows, each with 3
places. Each bike is always kept in the same place.
The array BikePlace[30,3] stores the bike ID.
Soni uses a flowchart to help him design a module to populate the array with bike IDs.
Row ← 1

Row <= 30?

No
To rest of program

Yes
Position ← 1

Position <= 3?

No

Yes
Input BikeID

BikePlace[Row, Position] ← BikeID

Position ← Position + 1

Row ← Row + 1

© UCLES 2012

9691/21/O/N/12

For
Examiner's
Use

7
(a) Complete the trace table for the flowchart with the first five bike IDs. The values to be
entered are BIKE34, BIKE56, BIKE70, BIKE51 and BIKE19.
The row with the headings will also have to be completed.
Row Position
1

1

Row<=30
TRUE

For
Examiner's
Use

BikePlace
[1,1]
BIKE34

[6]

© UCLES 2012

9691/21/O/N/12

[Turn over

8
(b) (i) From the flowchart write the module code, using nested FOR loops.
Ensure that your code demonstrates good programming practice.

Row ← 1

Row <= 30?

No
To rest of program

Yes
Position ← 1

Position <= 3?

No

Yes
Input BikeID

BikePlace[Row, Position] ← BikeID

Position ← Position + 1

Row ← Row + 1

© UCLES 2012

9691/21/O/N/12

For
Examiner's
Use

9
Programming language used

For
Examiner's
Use

Code

[7]
(ii) Describe what is meant by a reserved word.

[2]
(iii) Write down two reserved words from your code in (i).
Programming language
Words
[2]

© UCLES 2012

9691/21/O/N/12

[Turn over

10
(c) (i) One of the modules uses the expression:
BuildingArea - RackArea /(HandleBarWidth * BikeLength –
EmptySpaces)
State the value of the part of the expression inside the brackets when:
HandleBarWidth ← 2
BikeLength ← 4
EmptySpaces ← 8
[1]
(ii) If this expression is used with the above values, there will be an error.
State the name of this type of error.
[1]
(iii) Explain how the programmer can stop this error occurring during execution.

[2]

(d) There are a number of debugging tools associated with high-level languages.
Describe how a variable check is used.

[2]

© UCLES 2012

9691/21/O/N/12

For
Examiner's
Use

11
3

Super Bikes will need a report each month that shows how many times the 5 most used
bikes have been hired that month, the income each generated and any repairs needed.

For
Examiner's
Use

Design the layout of the report.

[7]

© UCLES 2012

9691/21/O/N/12

[Turn over

12
4

Super Bikes will store the data in files.

For
Examiner's
Use

(a) One file will store the following data:
•
•
•
•

bike ID
bike type
date bought
currently needs repair

Complete the following table. Use a single value for Field Size.
Field Name

Data Type

Field Size (in bytes)

BikeID
BikeType
DateBought
NeedsRepair
[4]

(b) Estimate the size, in kilobytes, of the file if it stores the details of 90 bikes. Show your
working.

[4]

© UCLES 2012

9691/21/O/N/12

13
(c) Using a high-level programming language, define a bike record with identifier
HireBike and the fields listed in part (a).

For
Examiner's
Use

Programming language used
Code

[5]

(d) Adding a HireBike record to the file could be programmed as procedure
AddBikeRecord.
(i) Explain why adding a HireBike record to the file would not be programmed as a
function.

[2]

© UCLES 2012

9691/21/O/N/12

[Turn over

14
(ii) Describe two different ways in which values can be passed between the main
program and a procedure.
1

2

[4]
(iii) State one parameter that would be passed to the procedure AddBikeRecord.
[1]

© UCLES 2012

9691/21/O/N/12

For
Examiner's
Use

15
BLANK PAGE

© UCLES 2012

9691/21/O/N/12

16
BLANK PAGE

Permission to reproduce items where third-party owned material protected by copyright is included has been sought and cleared where possible. Every
reasonable effort has been made by the publisher (UCLES) to trace copyright holders, but if any items requiring clearance have unwittingly been included, the
publisher will be pleased to make amends at the earliest possible opportunity.
University of Cambridge International Examinations is part of the Cambridge Assessment Group. Cambridge Assessment is the brand name of University of
Cambridge Local Examinations Syndicate (UCLES), which is itself a department of the University of Cambridge.

© UCLES 2012

9691/21/O/N/12

Advertisement