Question 3(a) 2012 · May-June · Paper 31 · 7 marks
Reveal official mark-scheme answer
Official answer for Question 3
Part (a)
Part (a)
Boolean
Show text version of question
Question 3
Part (a)
Customer names are stored in the array Customer. For An algorithm is to be designed to perform a serial search of the array for a requested Examiner's Use customer name. The algorithm will use the variables shown in the table.
Study the table and the algorithm and fill in the gaps.
Identifier Data Type Description Customer ARRAY[2000] OF STRING The customer names
Index INTEGER Index position in the customer array IsFound
SearchName STRING The requested customer name
//Serial search algorithm INPUT IsFound ← FALSE Index ← 1
REPEAT IF Customer [ ] = SearchName THEN IsFound ← TRUE OUTPUT “FOUND – at position ” Index “ in the array” ELSE Index ← ENDIF UNTIL (IsFound = TRUE) OR
IF THEN OUTPUT “Customer name was NOT FOUND” ENDIF
Why this question appears here
72% assigned-topic match · Hardware › Logic gates and logic circuits
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_s12_qp_31.pdf
