Question 13
AQA Computer Science June 2023 Paper 1 (7517/1)A level5 marks
On the specification
- 13.1
- 3.1 Fundamentals of programming
- 13.2
- 3.3 Systematic approach to problem solving
Question text
13 This question refers to the method UseMoveOptionOffer in the Dastan class. The program is to be changed so that it checks the choice made by the player about which move option to replace is valid. A choice is valid if it is between 1 and 5 inclusive. The program should keep getting the player to enter a value until a valid choice has been made. Each time an invalid value is entered an appropriate error message should be displayed. What you need to do Task 1 Modify the method UseMoveOptionOffer 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. You may assume that the user will only enter a single numeric digit. Task 2 Test that the changes you have made work: • run the Skeleton Program • enter 9 • enter 6 • enter 4 Evidence that you need to provide Include the following evidence in your Electronic Answer Document. 13.1 Your PROGRAM SOURCE CODE for the amended method UseMoveOptionOffer. [4 marks] 13.2 SCREEN CAPTURE(S) showing the results of the requested test. [1 mark]