Question 10

AQA Computer Science June 2018 Paper 1A level9 marks

On the specification

10.1
3.1 Fundamentals of programming3.2 Fundamentals of data structures
10.2
3.3 Systematic approach to problem solving
Question text

10 This question extends the functionality of the game. After spelling a valid word the player decides which one of four options to select to determine how many tiles will be added to their hand. Before choosing they can look at the values of the tiles. It would help the player make their decision if they were aware of how useful each letter was by knowing the frequency with which each letter appears in the list of allowed words. The program is to be extended so that when the player chooses to view the tile values they are also shown the number of times that each letter appears in the list of allowed words. What you need to do Task 1 Create a new subroutine called CalculateFrequencies that looks through the list of allowed words and displays each of the 26 letters in the alphabet along with the number of times that the letter appears in the list of allowed words, which the subroutine has calculated. Task 2 Modify the DisplayTileValues subroutine so that after displaying the tile values it also calls the CalculateFrequencies subroutine. Task 3 Test that the changes you have made work: • run the Skeleton Program • if you have answered Question 8, enter 15 when asked to enter the start hand size; if you have not answered Question 8 yet then skip this step • enter 2 at the main menu • enter 1 to display the letter values. Evidence that you need to provide Include the following in your Electronic Answer Document. 10.1 Your PROGRAM SOURCE CODE for the new subroutine CalculateFrequencies, the amended subroutine DisplayTileValues and any other subroutines you have modified when answering this question. [8 marks] 10.2 SCREEN CAPTURE(S) showing the requested test. [1 mark]