Question 15
AQA Computer Science June 2023 Paper 1 (7517/1)A level9 marks
On the specification
- 15.1
- 4.1 Fundamentals of programming
- 15.2
- 3.3 Systematic approach to problem solving
Question text
15 This question extends the Skeleton Program so that there is a new type of square – a gacaka (trap). When a player makes a move that means a piece moves into a gacaka, the value of PointsIfCaptured of the piece is increased by 2 and a message saying "Trap!" is displayed. A player who has a piece in a gacaka has their score decreased by 3 each turn until the piece is moved out of the gacaka. The location of the gacaka is not shown on the board. What you need to do Task 1 Create a new class called Gacaka that is a subclass of the Square class. Create two methods SetPiece and GetPointsForOccupancy in the Gacaka class that allow a gacaka to work in the way described. The method SetPiece in the Gacaka class should override the method from the Square class. The method GetPointsForOccupancy in the Gacaka class should override the method from the Square class. Task 2 Modify the CreateBoard method in the Dastan class so that row four, column four is a gacaka instead of a square. Task 3 Test that the changes you have made work: • run the Skeleton Program • enter 3 • enter 24 • enter 44 • enter 1 • enter 54 • enter 44 Evidence that you need to provide Include the following evidence in your Electronic Answer Document. 15.1 Your PROGRAM SOURCE CODE for the new class Gacaka, the amended CreateBoard method and any other methods you have modified or created when answering this question. [8 marks] 15.2 SCREEN CAPTURE(S) showing the requested test. [1 mark]