Question 9
AQA Computer Science June 2025 Paper 1 (7517/1)A level5 marks
On the specification
- 9.1
- 4.2 Fundamentals of data structures4.13 Systematic approach to problem solving
- 9.2
- 4.13 Systematic approach to problem solving
Question text
9 This question refers to the PlayGame subroutine. The Skeleton Program is to be changed so that there are penalty positions in the list of targets. If there is a number shown in the second position of the list of targets, then the player’s score is to be reduced by five. If there is a number shown in the first position of the list of targets, then the player’s score is to be reduced by the value of the number that is ten larger than the number shown in that position. If there are numbers in the first and second positions of the list of targets, then the player’s score will be reduced by five and by the value of the number that is ten larger than the number shown in the first position of the list of targets. The program should check if there are numbers shown in the penalty positions after reducing the player’s score by one. Example 3 80 17 62 7 31 11 0 18 19 22 41 13 22 75 Numbers available: 2 7 8 3 4 Current score: 4 Player enters the expression 2*7 This expression evaluates to 14. This is not one of the targets, so the player’s score will reduce by one. 3 80 17 62 7 31 11 0 18 19 22 41 13 22 75 1 Numbers available: 2 7 8 3 4 Current score: 3 Player enters the expression 2*7 This expression evaluates to 14. This is not one of the targets, so the player’s score will reduce by six (1 + 5). 3 80 17 62 7 31 11 0 18 19 22 41 13 22 75 1 33 Numbers available: 2 7 8 3 4 Current score: –3 Player enters the expression 2*7 This expression evaluates to 14. This is not one of the targets so the player’s score will reduce by 19 (1 + 5 + 10 + 3). The game now ends and the final score (–22) will be displayed. What you need to do Task 1 Modify the subroutine PlayGame so it reduces the player’s score if there are numbers shown in a penalty position. Task 2 Test that the changes you have made work: • run the Skeleton Program • select the training game • enter the expression 4*5 six times. Evidence that you need to provide Include the following evidence in your Electronic Answer Document. 9.1 Your PROGRAM SOURCE CODE for the amended subroutine PlayGame. [4 marks] 9.2 SCREEN CAPTURE(S) showing the results of the requested test. [1 mark]