Question 14

AQA Computer Science June 2023 Paper 1 (7517/1)A level10 marks

On the specification

14.1
3.1 Fundamentals of programming3.2 Fundamentals of data structures
14.2
3.3 Systematic approach to problem solving
Question text

14 This question extends the Skeleton Program by allowing a player to choose a bhukampa (earthquake). After choosing a bhukampa the player can then choose a move option, choose to use the move option offer or choose a bhukampa again. When a bhukampa is chosen the following steps are repeated five times: • two different squares are randomly selected • the positions on the board of those two squares are swapped. The player’s score is then reduced by 15 and the new state of the game is displayed. What you need to do Task 1 Create a new method in the Dastan class called ProcessBhukampa that swaps the squares in the way described. Task 2 Modify the PlayGame method in the Dastan class so that if the player enters 8 when asked for their move option, the new method ProcessBhukampa is called, the current player’s score is reduced by 15 and the new game state is displayed. Task 3 Test that the changes you have made work: • run the Skeleton Program • enter 8 The results of your test should show at least one piece or kotla now being in a different location. If your test does not show this (because all the squares randomly selected by your program were empty), then keep doing this test until that is not the case. Evidence that you need to provide Include the following evidence in your Electronic Answer Document. 14.1 Your PROGRAM SOURCE CODE for the new method ProcessBhukampa and the amended method PlayGame. [9 marks] 14.2 SCREEN CAPTURE(S) showing the requested test. [1 mark]