Question 4

Edexcel Computer Science June 2019 Paper 2GCSE13 marks

On the specification

(a)
6.1 Develop code
(b)(i)
1.2 Algorithms
(b)(ii)
1.2 Algorithms
Question text

4 Margaret needs to keep track of how much money she makes. She collects the sales figures on a weekly basis. (a) The pseudocode of an algorithm is shown. In some programming languages, if a program is written like this, it could be translated and executed. Discuss the suitability of this code for humans and how it could be improved. (6) (b) A pseudocode algorithm that manipulates sales figures is shown. (i) The first four inputs from the file to the algorithm are 355, 554, 199, and 409. Complete the trace table showing the execution of the pseudocode with these four inputs. You may not need to fill in all the rows in the table. (6) num x y Display (ii) State the purpose of this algorithm. (1) (Total for Question 4 = 13 marks)