Past-paper question · 2017 October-November · Paper 22 · Q2(b)

Question 2(b) 2017 · October-November · Paper 22 · 9 marks

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

Official answer for Question 2

Part (b)

✓
Mark as follows:
  • One mark for START and STOP / END
  • One mark for each bracketed pair
  • One mark for each of other labelled symbol (decision box shape must be correct)
  • Allow F/T from incorrect decision symbol
✓
Full marks should be awarded for functionally equivalent solutions.
✓
Question
✓
Answer
✓
Marks

Mark scheme 9608_w17_ms_22.pdf →

Show text version of question

Question 2

Part (b)

Question 2

A 1D array, ClassName, of type STRING contains 100 elements.

The following pseudocode represents a simple algorithm to process the array.

DECLARE SearchValue : STRING DECLARE FoundFlag : BOOLEAN DECLARE Index : INTEGER

INPUT SearchValue FoundFlag FALSE Index 1

WHILE Index < 101 AND FoundFlag = False IF ClassName[Index] = SearchValue THEN OUTPUT Index FoundFlag TRUE ENDIF Index Index + 1 ENDWHILE

IF FoundFlag = FALSE THEN OUTPUT "Not found" ENDIF

Part (b)

Draw a program flowchart to represent this algorithm.

Note that variable declarations are not required in program flowcharts.

[9]

Question 8

Topic relevance

Why this question appears here

71% assigned-topic match · Algorithm design and problem-solving › Algorithms

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

Keep practising this topic