Question 8

AQA Computer Science June 2017 Paper 1AS6 marks

On the specification

8.1
3.1 Fundamentals of programming
8.2
3.3 Systematic approach to problem solving
Question text

8 This question refers to the subroutine GetHowLongToRun. What you need to do: Task 1 Modify the subroutine GetHowLongToRun so that it checks that the value entered by the user is an integer between -1 to 5 inclusive. If an invalid value, including a non-integer value, is entered for the duration of the simulation the program should output: Invalid input The subroutine should not return any values until a valid integer has been entered. Task 2 Test that the changes you have made work by conducting the following test: • start the simulation • enter the value -2 • enter the value 6 • enter the value w • enter the value 1.4 • enter the value 0 (zero). Evidence that you need to provide Include the following in your Electronic Answer Document. 8.1 Your amended PROGRAM SOURCE CODE for the subroutine GetHowLongToRun. [5 marks] 8.2 SCREEN CAPTURE(S) showing the requested test. [1 mark]