Question 12
AQA Computer Science June 2019 Paper 1A level13 marks
On the specification
- 12.1
- 3.1 Fundamentals of programming
- 12.2
- 3.3 Systematic approach to problem solving
Question text
12 This question extends the functionality of the game by modifying the subroutine PlayGame and adding a new subroutine called DropItem. An additional command, drop, is to be added to the game. When a player uses the drop command the item specified after drop should be moved from the player’s inventory to the location the player is currently in unless the item has a status of fragile, in which case it should be removed from the game as it breaks when dropped. A message should be displayed stating either that the item has now been dropped, that the item broke when it was dropped or that the item is not in their inventory. What you need to do Task 1 Create a new subroutine called DropItem that implements all the functionality required for the drop command. Task 2 Modify the PlayGame subroutine so that a call is made to the DropItem subroutine when the drop command has been entered by the user. Task 3 Test that the changes you have made work: • run the Skeleton Program • load the file flag1.gme • enter the command drop apple • then enter the command drop jar • then enter the command examine inventory • then enter the command open green door • then enter the command go north • then enter the command go south. Evidence that you need to provide Include the following evidence in your Electronic Answer Document. 12.1 Your PROGRAM SOURCE CODE for the amended subroutine PlayGame and the new subroutine DropItem. [12 marks] 12.2 SCREEN CAPTURE(S) showing the requested test. [1 mark]