Question 12

AQA Computer Science June 2025 Paper 1 (7517/1)A level14 marks

On the specification

12.1
4.13 Systematic approach to problem solving4.3 Fundamentals of algorithms
12.2
4.13 Systematic approach to problem solving
12.3
4.3 Fundamentals of algorithms
Question text

12 This question extends the Skeleton Program so that the program will tell the player if they can make one of the targets using an expression that contains exactly three of the values from the numbers available. Your program does not need to work with the exponentiation operator from Question 10. What you need to do Task 1 Create a new subroutine called CanGetATargetUsingThreeNumbers that will return True if it is possible to create an expression using exactly three of the values in NumbersAllowed that matches any of the targets shown to the player. Otherwise, it should return False. Task 2 Modify the DisplayState subroutine so that it calls the subroutine CanGetATargetUsingThreeNumbers and then displays an appropriate message saying if it is possible or not to make one of the targets using exactly three of the values from the available numbers. Task 3 Test that the changes you have made work: • run the Skeleton Program • select the training game • enter 3+8–2 Evidence that you need to provide Include the following evidence in your Electronic Answer Document. 12.1 Your PROGRAM SOURCE CODE for the new subroutine CanGetATargetUsingThreeNumbers and the amended DisplayState subroutine. [11 marks] 12.2 SCREEN CAPTURE(S) showing the requested test. [1 mark] 12.3 State how many valid expressions there are that use exactly three numbers. You should assume that all the numbers available are different and that the exponentiation operator from Question 10 has not been used. You should show your working. [2 marks]