Professional Documents
Culture Documents
For
Examiner's
Use
Identifier
City1
City2
<Space>
City3
10
UCLES 2013
9691/31/M/J/13
19
(b) A programmer writes pseudocode to report whether or not a string value ThisValue is
found in the string array ThisArray. This is designed as a function StringFound
which returns a Boolean value.
For
Examiner's
Use
[3]
(ii) Use the following numbers to label your function header above.
1.
2.
Function parameter(s)
Where the return data type is stated
[2]
(iii) Write a single statement which calls the function StringFound to search for the
value LISBON in the array CapitalCities (upper bound 300). The function
returns the value to variable CityWasFound in the calling statement.
[2]
UCLES 2013
9691/31/M/J/13
[Turn over
19
7
For
Examiner's
Use
Identifier
10
List1
17
23
11
16
List2
13
16
16
20
22
20
19
11
23
List3
41
29
34
39
39
44
UCLES 2013
9691/33/M/J/13
[Turn over
20
(b) A programmer writes pseudocode to calculate an employees net pay with a function
CalcNetPay.
The calculation is done using:
[3]
For
Examiner's
Use
14
8
(a) A high-level programming language has the following built-in function ChangeString
defined as follows:
(i) State the function identifier and parameters for the above function.
Function identifier
Parameters
[2]
What value is returned from the following function calls?
(ii) ChangeString(Wesley, Lyons)
[1]
(iii) ChangeString(923, SMITH)
[1]
(iv) ChangeString(Zawinal)
[1]
2
[2]
UCLES 2012
9691/31/O/N/12
For
Examiner's
Use
14
8
has
the
following
built-in
function
[1]
(ii) State the function identifier for the function given above.
[1]
(iii) Explain what is meant by the term parameter.
[1]
(iv) State the parameter identifiers for the function given above.
[2]
UCLES 2012
9691/32/O/N/12
For
Examiner's
Use
15
(b) What is returned from the following function calls?
For
Examiner's
Use
UCLES 2012
9691/32/O/N/12
[Turn over
14
8
(a) A high-level programming language has the following built-in function SumRange
defined as follows:
(i) State the function identifier and parameters for the above function.
Function identifier
Parameters
[2]
What value is returned from the following function calls?
(ii) SumRange(1, 3)
[1]
(iii) SumRange(31, 33)
[1]
(iv) SumRange(1.5, 4.5)
[1]
(v) SumRange(78, 71)
[1]
[1]
UCLES 2012
9691/33/O/N/12
For
Examiner's
Use
16
7
High-level programming languages have two types of function. These are built-in and userdefined.
Explain the difference between them. You may give an example from your practical experience
for a built-in function.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...............................................................................................................................................[2]
18
The function Replace is documented as follows:
High-level programming languages have two types of function. These are built-in and
user-defined.
Explain the difference between them. You may give an example from your practical experience
for a built-in function.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...............................................................................................................................................[2]
UCLES 2014
9691/32/O/N/14
Page 9
7
Mark Scheme
GCE A LEVEL May/June 2013
Syllabus
9691
Paper
31
(a) (i) 2
[1]
[1]
(iii) 0
[1]
[1]
[1]
[1]
[1]
[1]
[1]
[1]
[1]
[Total: 11]
[1]
(ii) False / No
[1]
[1]
[1]
(b)
FUNCTION CalcNetPay (EmpGrade:CHAR/STRING, HoursWorked:SINGLE/INTEGER)
RETURN SINGLE
[1]
[1]
[1]
A: RETURN REAL/CURRENCY
[Total: 7]
[2]
(ii) Lyons W
[1]
(iii) SMITH 9
[1]
(iv) Error
[1]
[2]
[Total: 7]
[1]
(ii) CharacterCount
[1]
(iii) Value(s)/variable(s) which are given/passed (each time the function is called)
[1]
(iv) ThisChar
[1]
[1]
ThisString
(b) (i) 2
[1]
(ii) 0
[1]
(iii) Error
[1]
[Total: 8]
SumRange
ThisInteger1 and ThisInteger2
[2]
(ii) 42
[1]
(iii) Error
[1]
(iv) Error
[1]
(v) Error
[1]
(b) A function always returns a value - (procedures may/may not return a value)
[1]
[Total: 7]
(a) 3 (days)
[1]
(b) Error
[1]
(c) 2 (months)
[1]
(d) Error
[1]
(e) Error
[1]
(f) Built-in functions are those provided (as a part of the programming language) //
accept by example
1
User defined functions are designed and coded by the programmer
1
[2]
(a)
Mary Kelly
[1]
(b)
1X0X
[1]
(c)
Ajaz ew
[1]
(d)
Error
[1]
(e)
[1]
(f)
[2]