Past-paper question · 2023 May-June · Paper 23 · Q6(a)

Question 6(a) 2023 · May-June · Paper 23 · 7 marks

Original past-paper question for 6(A)
Original past-paper question for 6(A)
Reveal official mark-scheme answer Official mark-scheme answer for 6(A)

Official answer for Question 6

Part (a)

Question 7

✓
PROCEDURE
✓
Select(Start, End : INTEGER)
✓
DECLARE
✓
ThisNum, Total: INTEGER
✓
DECLARE
✓
ThisString : STRING
✓
DECLARE
✓
Char1, Char2 : CHAR
✓
FOR ThisNum Start+1 TO End-1
✓
ThisString NUM_TO_STR(ThisNum)
✓
Char1 RIGHT(ThisString, 1)
✓
Char2 LEFT(RIGHT(ThisString, 2), 1)
✓
Total STR_TO_NUM(Char1) + STR_TO_NUM(Char2)
✓
IF Total = 6 THEN
✓
OUTPUT ThisString
✓
ENDIF
✓
NEXT ThisNum
✓
ENDPROCEDURE
✓
MP1
✓
Procedure heading and ending
✓
MP2
✓
(Count-controlled) Loop
✓
MP3
✓
…. with correct range from Start+1 to End-1
✓
MP4
✓
Convert ThisNum (loop counter) to a string
✓
MP5
✓
Extract the last two/first/second ’character digit(s)’ required in a
✓
loop
✓
MP6
✓
Extract the second individual ‘character digit’ required in a loop
✓
MP7
✓
Calculate the sum of the last two digits
✓
MP8
✓
If sum = 6 then OUTPUT the number (either string or integer) in a
✓
loop

Mark scheme 9618_s23_ms_23.pdf →

Show text version of question

Question 6

Part (a)

Question 6

A procedure Select() will:

1. take two integer values as parameters representing start and end values where both values are greater than 9 and the end value is greater than the start value 2. output each integer value between the start and the end value (not including the start and end values), where the sum of the last two digits is 6, for example, 142.

Part (a)

Write pseudocode for procedure Select().

Parameter validation is not required.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

.............................................................................................................................................

[7]

Question 11

Topic relevance

Why this question appears here

71% assigned-topic match · Programming › Structured programming

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 9618_s23_qp_23.pdf

Keep practising this topic