Past-paper question · 2015 October-November · Paper 21 · Q6(b)(iv)

Question 6(b)(iv) 2015 · October-November · Paper 21 · 1 mark

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

Official answer for Question 6

Part (b)

(iv)

(iv)

11 / 12

[1]

Mark scheme 9608_w15_ms_21.pdf →

Show text version of question

Question 6

Part (b)

(iv)

Question 6

A firm employs five staff who take part in a training programme. Each member of staff must

complete a set of twelve tasks which can be taken in any order. When a member of staff successfully completes a task, this is recorded.

A
program is to be produced to record the completion of tasks for the five members of staff.

To test the code, the programmer makes the program generate test data.

The program generates pairs of random numbers:

  • the first, in the range, 1 to 5 to represent the member of staff
  • the second, in the range, 1 to 12 to represent the task

Each pair of numbers simulates the completion of one task by one member of staff. Data is currently recorded manually as shown.

Staff Task number number 1 2 3 4 5 6 7 8 9 10 11 12

Question 1

Question 2

Question 3

Question 4

Question 5

The table shows that two members of staff have each successfully completed one task.

The program must use a suitable data structure to store, for all staff:

  • tasks successfully completed
  • tasks not yet successfully completed

The program will output the staff number and task number in the order in which tasks are completed.

Question 10

The program design in pseudocode is produced as follows:

01 DECLARE StaffNum : INTEGER 02 DECLARE TaskNum : INTEGER 03 DECLARE ..................................................................................................................................... 04 DECLARE NewStaffTask : BOOLEAN 05 06 CALL InitialiseTaskGrid 07 Completed ← 0 08 WHILE Completed <> 60 09 NewStaffTask ← FALSE 10 WHILE NewStaffTask = FALSE 11 StaffNum ← RANDOM(1,5) //generates a random number 12 TaskNum ← RANDOM(1,12) //in the given range 13 IF TaskGrid[StaffNum, TaskNum] = FALSE 14 THEN 15 TaskGrid[StaffNum, TaskNum] ← TRUE 16 NewStaffTask ← TRUE 17 OUTPUT StaffNum, TaskNum 18 ENDIF 19 ENDWHILE 20 Completed ← Completed + 1 21 ENDWHILE 22 OUTPUT "Staff Task Count", Completed

Question 23

24 // end of main program

Question 25

26 PROCEDURE InitialiseTaskGrid() 27 DECLARE i : INTEGER 28 DECLARE j : INTEGER 29 FOR i ← 1 TO 5 30 FOR j ← 1 TO 12 31 TaskGrid[i, j] ← FALSE 32 ENDFOR 33 ENDFOR 34 ENDPROCEDURE

Question 11

Study the pseudocode and answer the questions below.

Give the line number for:

(iv)

A statement which uses a built-in function of the programming language.

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

[1]
Topic relevance

Why this question appears here

72% 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_w15_qp_21.pdf

Keep practising this topic