Question 2

Edexcel Computer Science June 2021 Paper 2GCSE7 marks

On the specification

(a)
6.2 Program constructs
(b)
1.2 Algorithms
(c)
6.1 Develop code
Question text

2 The leisure centre uses an algorithm, based on demand in previous years, to determine peak and off peak times. Here is the pseudocode for this algorithm. The values for month are 1 = January, 2 = February, … 12 = December The values for day are 1 = Monday, 2 = Tuesday … 7 = Sunday (a) State the name of the programming construct used in line 7 of the algorithm. (1) (b) Complete the table to show the output of the algorithm for the given inputs. (3) Inputs Output (month = 7) (month = 12) AND (time = 19:00) (month = 4) AND (day =6) (c) The algorithm needs to be tested. Construct suitable test data to produce an output stating ‘Off peak rates apply’. (3) (Total for Question 2 = 7 marks)