Question 4

Edexcel Computer Science June 2018 Paper 2GCSE5 marks

On the specification

(a)
1.2 Algorithms6.1 Develop code
(b)
6.1 Develop code6.5 Operators
Question text

4 P-Cubed classifies items as letters and packages according to their weight. Here is the pseudo-code for an algorithm that determines the classification of an item. (a) The pseudo-code produces an incorrect output. When the user enters 300, the algorithm outputs “Small letter”. The correct output should be “Large letter”. State the name for this type of error. (1) (b) Line 11 and line 18 cause errors. Identify the error in each line and construct new lines of pseudo-code that will correct the errors. (4) Error Correction Line 11 Line 18 (Total for Question 4 = 5 marks)