Past-paper question · 2019 October-November · Paper 21 · Q3

Question 3 2019 · October-November · Paper 21 · 7 marks

Original past-paper question for 3
Original past-paper question for 3
Original past-paper question for 3
Reveal official mark-scheme answer Official mark-scheme answer for 3

Official answer for Question 3

Question 7

✓
One mark per row:
✓
Answer
✓
The number of the line containing a variable being
✓
24 / 26 / 28
✓
i
✓
t d
✓
The range of line numbers containing a pre-condition
✓
20 – 30
✓
loop
✓
The number of initialisation statements

Question 3

✓
The number of the line containing a logical operator

Question 20

✓
The range of line numbers containing a selection
✓
22 - 27 /
✓
statement
✓
32 - 37
✓
The name of a built-in function
✓
MID / LENGTH
✓
The name of a parameter
✓
InString / Index
✓
9608/21
✓
Cambridge International AS/A Level – Mark Scheme
✓
October/November
✓
PUBLISHED
✓
2019
✓
Question
✓
Answer
✓
Marks

Mark scheme 9608_w19_ms_21.pdf →

Show text version of question

Question 3

The following is a function design in pseudocode.

Line numbers are given for reference only.

10 FUNCTION Check(InString : STRING) RETURNS BOOLEAN

Question 11

12 DECLARE NumDots : INTEGER 13 DECLARE Index : INTEGER 14 DECLARE NumOthers : INTEGER

Question 15

16 NumDots 0 17 NumOthers 0 18 Index 1

Question 19

20 WHILE NumDots < 3 AND Index <= LENGTH(InString)

Question 21

22 IF MID(InString, Index, 1) = '.' 23 THEN 24 NumDots NumDots + 1 25 ELSE 26 NumOthers NumOthers + 1 27 ENDIF 28 Index Index + 1

Question 29

30 ENDWHILE

Question 31

32 IF NumDots = NumOthers 33 THEN 34 RETURN TRUE 35 ELSE 36 RETURN FALSE 37 ENDIF

Question 38

39 ENDFUNCTION

Question 7

Study the pseudocode. Identify the relevant features in the following table.

Refer to the Appendix on pages 16–17 for the list of built-in functions and operators.

Feature Answer

The number of the line containing a variable being incremented

The range of line numbers containing a pre-condition loop

The number of initialisation statements

The number of the line containing a logical operator

The range of line numbers containing a selection statement

The name of a built-in function

The name of a parameter

[7]

Question 8

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 9608_w19_qp_21.pdf

Keep practising this topic