9608_s15_pre_22
9608_s15_pre_22
9608_s15_pre_22
Candidates should use this material in preparation for the examination. Candidates should attempt the
practical programming tasks using their chosen high-level, procedural programming language.
DC (LK) 107416
© UCLES 2015 [Turn over
2
This material is intended to be read by teachers and candidates prior to the June 2015 examination for
9608 Paper 2.
Reminders
The syllabus states:
• there will be questions on the examination paper which do not relate to this pre-release material
• you must choose a high-level programming language from this list:
o Visual Basic (Console Mode)
o Python
o Pascal / Delphi (Console Mode)
Declaration of variables
The syllabus document shows the syntax expected for a declaration statement in pseudocode.
It is appreciated that candidates who use Python as their chosen language will not be familiar with the
concept of declaring all variables with their data type before they are used.
However, answers using Python will be required, instead of a declaration statement, to include a
comment line documenting the identifier name with its intended data type.
The question rubric will clarify this with a wording and answer layout such as:
Visual Basic and Pascal: You should include the declaration statements for variables.
Python: You should show a comment statement for each variable used with its data type.
...............................................................................................................................................
...............................................................................................................................................
An algorithm written in pseudocode requires that all variables have been identified. This may not be
the case if the initial attempt at the algorithm design is in structured English. The candidate will then be
required to identify the variables from the question rubric.
TASK 1
• Riders complete one stage of a cycle race and their finishing position and time is recorded.
• The time is entered by the user as two integers:
o number of minutes
Key focus: Structured English
o followed by the number of seconds
• The rider’s stage race position is entered.
• The time is converted to seconds.
• If they finish in first, second or third position they get a time bonus, see table below.
• The time bonus is deducted from their race time.
TASK 1.1
Study the structured English and complete the identifier table below.
TASK 1.2
Line 08 in the structured English does not give sufficient detail to write program code from this
statement.
Use stepwise refinement to give the detail for Line 08. Key focus: Stepwise refinement
• How could arrays be used to store data from several riders which were input in sequence?
• Draw up test data for eight riders (which include the riders finishing first, second and third).
• Carry out a bubble sort to produce a list of the rider names in finishing order.
• Save the data for the eight riders to a text file RACE-DATA.
Operators
Arithmetic operators
In addition to the normal +, –, * and /, candidates should be familiar with the DIV and MOD operators.
17 MOD 7 evaluates to 3
& Operator
Built-in Functions
Any high-level programming language will have many built-in functions for the programmer to use.
It is appreciated that the three programming languages often implement these functions with very
different syntax. Candidates should be familiar with the syntax used in their chosen programming
language.
If a built-in function is to be used in pseudocode on the examination paper, the function will be shown
and explained. Examples of this follow.
TASK 2
6 x "BAMBI"
y CHARACTERCOUNT( SUBSTR(x, 3, 5) )
.................................................
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.
To avoid the issue of disclosure of answer-related information to candidates, all copyright acknowledgements are reproduced online in the Cambridge International
Examinations Copyright Acknowledgements Booklet. This is produced for each series of examinations and is freely available to download at www.cie.org.uk after
the live examination series.
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.