Question 11
AQA Computer Science June 2022 Paper 1C (8525/1C)GCSE10 marks
On the specification
- 11.1
- 3.2 Programming3.3 Fundamentals of data representation
- 11.2
- 3.2 Programming
- 11.3
- 3.2 Programming
Question text
11.1 The size of a sound file is calculated using the following formula: box size (in bits) = sampling rate * sample resolution * seconds To calculate the size in bytes, the number is divided by 8 The algorithm in Figure 12, represented using pseudo-code, should output the size of a sound file in bytes that has been sampled 100 times per second, with a sample resolution of 16 bits and a recording length of 60 seconds. A subroutine called getSize has been developed as part of the algorithm. Complete Figure 12 by filling in the gaps using the items in Figure 11. You will not need to use all the items in Figure 11. [6 marks] Figure 11 bit byte getSize OUTPUT rate res RETURN sampRate seconds size size + 8 size * 8 size / 8 size MOD 8 SUBROUTINE USERINPUT Figure 12 SUBROUTINE getSize( , , seconds) sampRate * res * seconds size size ENDSUBROUTINE OUTPUT (100, 16, 60) 11.2 A local variable called size has been used in getSize. box Explain what is meant by a local variable in a subroutine. [1 mark] 11.3 State three advantages of using subroutines. [3 marks] 1 2 3