Past-paper question · 2014 October-November · Paper 31 · Q7(f)

Question 7(f) 2014 · October-November · Paper 31 · 2 marks

Original past-paper question for 7(F)
Original past-paper question for 7(F)
Reveal official mark-scheme answer Official mark-scheme answer for 7(F)

Official answer for Question 7

Part (f)

Part (f)

Built-in functions are those provided (as a part of the programming language) //

Question 1

✓
User defined functions are designed and coded by the programmer

Question 1

[2]

Mark scheme 9691_w14_ms_31.pdf →

Show text version of question

Question 7

Part (f)

Question 7

The function DateDiff is documented as follows:

FUNCTION DateDiff(Date1 : DATE, Date2 : DATE, OutputFlag : CHAR) RETURNS INTEGER

The function assumes Date1 is earlier than Date2. The function calculates the difference, in days or as a whole number of months, between Date1 and Date2.

OutputFlag takes values:

  • 'D' : the result is computed and returned as a number of days
  • 'M' : the result is computed and returned as a whole number of months

An error is generated for each of the following:

  • An unrecognised or missing flag parameter
  • A date parameter in the wrong format
  • Date1 Date2

Dates are recognised by the function using the ‘hash (#) delimiter’.

What is returned from the following function calls?

Part (f)

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] 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.

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.

Topic relevance

Why this question appears here

71% assigned-topic match · Programming › Constructs

Topic-match percentages estimate how closely each question fits the selected syllabus topic. They are a guide for choosing stricter or broader practice.

Permanent source page: Educate A Change · From 9691_w14_qp_31.pdf

Keep practising this topic