Past-paper question · 2014 May-June · Paper 21 · Q2(b)(i)

Question 2(b)(i) 2014 · May-June · Paper 21 · 2 marks

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

The answer for this question is in the official mark scheme: open the mark scheme.

Mark scheme 9691_s14_ms_21.pdf →

Show text version of question

Question 2

Part (b)

(i)

Question 2

The teacher wants a new program to test children. A sequence of multiplication questions is

displayed. If a child inputs 3 incorrect answers for a question, the program outputs the number of questions the child answers correctly. Then the program stops. The program design uses the following functions and procedures.

Function or procedure name Description Random(X) A function that returns a whole number in the range 1 to X inclusive Display(Number1, Number2) A procedure that produces the output

5×8= ?

when Number1 is 5 and Number2 is 8 CheckAnswerCorrect(Number1, Number2) The procedure from Question 1(d)

TestScoreTotal A function that returns the number of questions answered correctly During the school day, several children in the class will use this program. The teacher wants to store each child’s name and their best test score so far.

Assume there will be no more than 30 children in the class.

(i)

Two one-dimensional arrays, Name and BestScore, are to store the name and score

for each child in the class. Use a high-level programming language to declare these two arrays.

Language

Code

[2]
Topic relevance

Why this question appears here

79% assigned-topic match · Data types and structures › Arrays

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

Keep practising this topic