Question 10
AQA Computer Science June 2019 Paper 1A level5 marks
On the specification
- 10.1
- 3.1 Fundamentals of programming
- 10.2
- 3.3 Systematic approach to problem solving
Question text
10 This question refers to the subroutine PlayGame. The program is to be changed so that it does not always display the same message when the user enters a command that is not recognised. Adapt the subroutine PlayGame so that sometimes the existing message "Sorry, you don’t know how to ***." is displayed and sometimes the new message "Sorry, I don’t know what *** means." is displayed. *** denotes the command entered by the user. The message to display should be selected randomly by the program and the probability of each of the messages being displayed should be equal. The new message should be laid out exactly as shown – all on one line with all the text, punctuation and spaces in the indicated places. Test that the changes you have made work: • run the Skeleton Program • load the file flag1.gme • enter the command eat a few times to show that your changes have worked and that the message displayed is randomly selected. Evidence that you need to provide Include the following evidence in your Electronic Answer Document. 10.1 Your PROGRAM SOURCE CODE for the amended subroutine PlayGame. [4 marks] 10.2 SCREEN CAPTURE(S) showing the results of the requested test. [1 mark]