Question 13
AQA Computer Science June 2022 Paper 1 (7517/1)A level10 marks
On the specification
- 13.1
- 3.1 Fundamentals of programming
- 13.2
- 3.3 Systematic approach to problem solving
Question text
13 This question extends the Skeleton Program by allowing a player to use a blasting cap to complete any challenge on the current lock. The player will only be able to do this once per game. When the player chooses to use the blasting cap, the program should check if the player has already used the blasting cap. If they have not used the blasting cap, the program should: • change the status of the blasting cap to show that it has been used • ask the player to enter the position of the challenge on the current lock they would like to use the blasting cap on (1 for the first challenge, 2 for the second challenge, etc) • check: o that the position entered is less than or equal to the number of challenges on the current lock o that the challenge in that position has not already been met. • if both these checks are passed: o mark the challenge as being met o display a message saying the blasting cap was used successfully o display the details for the current lock. • if either of these checks fail, then the blasting cap has been wasted and the game continues. If the player tries to use the blasting cap when they have already used it then nothing changes and the game continues. What you need to do Task 1 Modify the GetChoice subroutine in the Breakthrough class so the message displayed shows the blasting cap option. Task 2 Modify the PlayGame subroutine in the Breakthrough class so that there is a blasting cap that works in the way described. Task 3 Test that the changes you have made work: • run the Skeleton Program • enter L • choose to use a blasting cap • choose to complete the third challenge on the current lock • choose to use a blasting cap. Evidence that you need to provide Include the following evidence in your Electronic Answer Document. 13.1 Your PROGRAM SOURCE CODE for the amended subroutines GetChoice and PlayGame. [9 marks] 13.2 SCREEN CAPTURE(S) showing the requested test. [1 mark]