Question 5(b)(ii) 2016 · October-November · Paper 22 · 4 marks
Reveal official mark-scheme answer

Official answer for Question 5
Part (b)
(ii)
(ii)
‘Pseudocode’ solution included here for development and clarification of mark scheme.
- File open in read mode
- Loop until EOF() or count-controlled (8 iterations)
- Read a line from the file in a loop
- Assignment to PlayerName[1 to 8]from the file in a loop]
Question 22
Show text version of question
Question 5
Part (b)
(ii)
Question 5
A team keeps a record of the scores made by each of their eight players in a number of games.
The data in the two tables below shows:
- the scores of the eight players after twenty games
- the eight player names.
1 2 3 8 1 12 17 67 31
2 35 82 44 29
3 61 39 80 17
4 81 103 21 11
5 56 0 98 4
…
19 45 6 81 77
20 12 11 3 6
1 Vorma
2 Ravi
3 Chada
4 Nigam
5 Bahri
6 Smith
7 Goyal
8 Lata
The team wants a computer program to input and record the player data. The player names are permanently stored in a text file NAMES.TXT, with one name on each line. The player names will be read by the program and stored in a 1D array.
The design given in part
Part (a)
will be expanded so that the user is prompted for the player
name instead of the player number. Step 02 now becomes:
02.1 Read the player names from file NAMES.TXT into the array PlayerName 02.2 INPUT ThisPlayerName 02.3 Search the PlayerName array for ThisPlayerName to find the PlayerNumber
(ii)
Write the program code for step 02.1
Visual Basic and Pascal: You should include the declaration statements for variables. Python: You should show a comment statement for each variable used with its data type.
Programming language .....................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
......................................................................................................................................
Question 14
Why this question appears here
71% assigned-topic match · Programming › Programming basics
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_w16_qp_22.pdf
