Question 8

AQA Computer Science Specimen Paper 1 (7517/1)A level6 marks

On the specification

8.1
3.1 Fundamentals of programming
8.2
3.1 Fundamentals of programming
8.3
3.3 Systematic approach to problem solving
Question text

8 This question refers to the subroutines CheckValidMove and Play in the Game class. The Skeleton Program currently does not make all the checks needed to ensure that the move entered by a player is an allowed move. It should not be possible to make a move that takes a player outside the 7 × 5 cavern grid. The Skeleton Program needs to be adapted so that it prevents a player from moving west if they are at the western end of the cavern. The subroutine CheckValidMove needs to be adapted so that it returns a value of FALSE if a player attempts to move west when they are at the western end of the cavern. The subroutine Play needs to be adapted so that it displays an error message to the user if an illegal move is entered. The message should state "That is not a valid move, please try again". Evidence that you need to provide Include the following in your Electronic Answer Document. 8.1 Your amended PROGRAM SOURCE CODE for the subroutine CheckValidMove. [3 marks] 8.2 Your amended PROGRAM SOURCE CODE for the subroutine Play. [2 marks] 8.3 SCREEN CAPTURE(S) for a test run showing a player trying to move west when they are at the western end of the cave. [1 mark]