Past-paper question · 2015 May-June · Paper 21 · Q1(b)

Question 1(b) 2015 · May-June · Paper 21 · 3 marks

Original past-paper question for 1(B)
Original past-paper question for 1(B)
Reveal official mark-scheme answer Official mark-scheme answer for 1(B)

Official answer for Question 1

Part (b)

Part (b)

Letter15 CHAR(ASCII('A') + 14)

[2]
✓
Completely correct – 2 marks
✓
Single error of (not 14) scores 1 mark

Mark scheme 9691_s15_ms_21.pdf →

Show text version of question

Question 1

Part (b)

Question 1

A high-level programming language has the built-in string handling function MID defined as follows:

MID(ThisString : STRING, x : INTEGER, n : INTEGER) RETURNS STRING

returns a substring of n characters from the string ThisString starting at position x.

For example: MID("STOP", 3, 2) returns "OP"

If the function call is not properly formed, an error is generated.

Part (b)

A date is stored in the format DDMMYYYY in the string variable TodaysDate.

Use the function MID to separate the day, month and year.

ThisDay ← ..............................................................................................................................

ThisMonth ← ..........................................................................................................................

ThisYear ← .......................................................................................................................

[3]
Topic relevance

Why this question appears here

82% assigned-topic match · Data types and structures › Data types and records

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_s15_qp_21.pdf

Keep practising this topic