Question 11

AQA Computer Science June 2022 Paper 1 (7517/1)A level5 marks

On the specification

11.1
3.1 Fundamentals of programming
11.2
3.3 Systematic approach to problem solving
Question text

11 This question refers to the subroutine GetDiscardOrPlayChoice in the Breakthrough class. The program is to be changed so that it checks that the choice entered after the player has chosen to use a card is valid. D and P are the only valid choices. The program should keep getting the player to enter a value until a valid choice has been made. What you need to do Task 1 Modify the subroutine GetDiscardOrPlayChoice so it checks that the value entered by the player is valid. An appropriate error message should be displayed if an invalid value is entered and the user should be made to enter another value. Task 2 Test that the changes you have made work: • run the Skeleton Program • play a new game • enter U • enter 2 • enter L • enter D Evidence that you need to provide Include the following evidence in your Electronic Answer Document. 11.1 Your PROGRAM SOURCE CODE for the amended subroutine GetDiscardOrPlayChoice. [4 marks] 11.2 SCREEN CAPTURE(S) showing the results of the requested test. [1 mark]