Computing (9691) · May/June 2013 · Question paper 23

Cambridge Computing (9691) question paper for paper 23, May/June 2013 — 9691/23/M/J/13, file 9691_s13_qp_23.pdf.

Advertisement
Loading the paper…

More Computing (9691) papers

Paper 23 in other years

All Computing papers
Text of this paper

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

*2022544822*

9691/23

COMPUTING

May/June 2013

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 12 printed pages.
IB13 06_9691_23/3RP
© UCLES 2013

[Turn over

2
1

Meena wants to develop a program to keep a record of her examination results.
She will want to enter, sort and print out data which is stored as a file of records.

For
Examiner's
Use

Each record will contain at least the following data:
•
•
•
•
•

subject
examination title
level
date sat
mark

An example of an examination title is ‘General Certificate of Education’.
The DateSat field will contain only the month and year that the examination was taken.
For all subjects the mark is between 0 and 100 inclusive.
The level is 'O' or 'A'.
(a) Complete the table. Use a single value for the size.
Data
subject

Identifier
Subject

Data Type

Size (in bytes)

STRING

examination title
level

Level

date sat

DateSat

mark

Mark

1

[6]

(b) Estimate how many records could be held in the file if there are 5 KB available for the
file.

[4]

© UCLES 2013

9691/23/M/J/13

3
(c) (i) Each record needs another field to uniquely identify that record.

For
Examiner's
Use

State an appropriate identifier for this field and state a suitable data type for it.

[2]
(ii) In a programming language write the declaration for the record structure, giving it
the identifier Exam.
Programming language
Declaration

[4]

(d) Meena decides to modularise the solution.
Describe two ways in which a procedural programming language is appropriate when
modularising a solution.
1

2

[4]

© UCLES 2013

9691/23/M/J/13

[Turn over

4
(e) Describe what the function EOF() does when used in a program.

For
Examiner's
Use

[2]

2

The data in each field is validated as it is entered.
(a) Write the logic expression to validate Mark.

[3]

(b) The following table shows the four records currently stored in the file ExamResults for
the examinations sat so far.
Subject

Title

Level

DateSat

Mark

Art
Music
Biology
History

…
…
…
…

…
…
…
…

…
…
…
…

28
57
75
41

Meena will write a module based on the following pseudocode.
OPENFILE ExamResults FOR INPUT
Count ← 1
REPEAT
FILEREAD next ExamResults record
IF Mark > 70
THEN
Count ← Count + 1
ENDIF
UNTIL EOF()
OUTPUT Count
CLOSEFILE ExamResults

© UCLES 2013

9691/23/M/J/13

5
(i) Complete the trace table below using the file ExamResults.
Count

Mark

Mark > 70

For
Examiner's
Use

Output

[4]
(ii) There is an error in the pseudocode.
Write the correct statement.
[1]
(iii) State the type of error.
[1]
(iv) Write a suitable comment that could be added to explain the line
Count ← Count + 1.

[1]

© UCLES 2013

9691/23/M/J/13

[Turn over

6
(c) The pseudocode given in (b) uses a REPEAT-UNTIL loop:

For
Examiner's
Use

OPENFILE ExamResults FOR INPUT
Count ← 1
REPEAT
FILEREAD next ExamResults record
IF Mark > 70
THEN
Count ← Count + 1
ENDIF
UNTIL EOF()
OUTPUT Count
CLOSEFILE ExamResults
Rewrite the pseudocode to count how many records have a mark below 40. This time
use a WHILE-ENDWHILE loop.
OPENFILE ExamResults FOR INPUT

[4]

CLOSEFILE ExamResults

© UCLES 2013

9691/23/M/J/13

7
3

Meena needs to be aware of her average mark and declares a variable with identifier
MyAvMark which she decides will be a global variable.

For
Examiner's
Use

(a) State where in the program a global variable will be declared.
[1]

(b) Using only global variables is poor programming practice.
Give a possible problem that could result from this.

[1]

The program will read the marks from the file into a one-dimensional array, MyMarks. The
array has 50 elements, and marks range from 0 to 100 inclusive.
(c) State a suitable value to initialise each element of the array.
[1]

(d) In a programming language, write code that will declare and initialise MyMarks.
Programming language
Code

[4]

© UCLES 2013

9691/23/M/J/13

[Turn over

8
(e) 20 marks have been read into elements 1 to 20. In a programming language, write
code that will print out the highest and lowest marks that have been entered.
Programming language
Code

[6]

(f) MyAvMark is a variable of data type REAL.
Meena wants the value of MyAvMark converted to the nearest whole number.
State a function that will perform the conversion.
[1]

© UCLES 2013

9691/23/M/J/13

For
Examiner's
Use

9
The module to calculate the average mark could be written as a procedure or a function.

For
Examiner's
Use

(g) (i) State one difference between a procedure and a function.

[1]
(ii) State why the module to calculate the average mark could be written as a
procedure or a function.

[2]

© UCLES 2013

9691/23/M/J/13

[Turn over

10
4

(a) Meena hopes some of her friends will use her program. When designing the user
interface, state three design features she can incorporate if one of her friends has a
sight impairment.

[3]

(b) Design the interface. It must allow for entry of marks and the output of the average
mark. Remember, one of her friends has a sight impairment.

[6]

© UCLES 2013

9691/23/M/J/13

For
Examiner's
Use

11
(c) Meena has compiled the program and she thinks it is working.

For
Examiner's
Use

What two types of error could still occur in the program?
For each type give an example.
Error type 1
Example

Error type 2
Example

[4]

© UCLES 2013

9691/23/M/J/13

[Turn over

12
5

Meena wants to refine her program using the marks in MyMarks.
She wants the program to output:
•
•
•

For
Examiner's
Use

the word 'Failed' if the mark is less than 40,
the word 'Distinction' if the mark is over 70,
the phrase 'Well done' if there are more than three distinctions.

Using pseudocode, produce the algorithm that does this.

[9]

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 2013

9691/23/M/J/13

Advertisement