Question 2

Edexcel Computer Science June 2018 Paper 2GCSE7 marks

On the specification

(a)
1.2 Algorithms6.3 Data types and structures
(b)
6.4 Input and output
Question text

2 P-Cubed sorts items by their address codes. This is pseudo-code for an algorithm that forwards items to regional depots. (a) Complete the table to show the output of the algorithm for the given inputs. (3) Code Output displayed QB7698RI VA2288ZA 4W56AB92 (b) All address codes have the same format. The first two positions are letters, followed by four digits, followed by two letters. “BH1634GQ” and “bh1634gq” are valid codes. Complete the table to show different validation checks and test data caught by the validation check. The first one has been done for you. The letter ‘N’ represents a number (0-9) and the letter ‘L’ represents a letter (A-Z or a-z). (4) Validation check Test data Pattern check (“LLNNNNLL”) “4W56AB92” (Total for Question 2 = 7 marks)