The leisure centre uses an algorithm, based on demand in previous years, to determine peak and off peak times - Edexcel - GCSE Computer Science - Question 2 - 2021 - Paper 1
Question 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 valu... show full transcript
Worked Solution & Example Answer:The leisure centre uses an algorithm, based on demand in previous years, to determine peak and off peak times - Edexcel - GCSE Computer Science - Question 2 - 2021 - Paper 1
Step 1
State the name of the programming construct used in line 7 of the algorithm.
96%
114 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
Selection
Step 2
Complete the table to show the output of the algorithm for the given inputs.
99%
104 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
Inputs
Output
(month = 7)
Peak rates apply
(month = 12) AND (time = 19:00)
Standard rates apply
(month = 4) AND (day = 6)
Peak weekend rates apply
Step 3
Construct suitable test data to produce an output stating 'Off peak rates apply':
96%
101 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
Input test data for month = 3 or 4 or 9 or 10 (1)
Input test data for day <= 5 (1)
Input test data for time not between 17:00 and 20:00 (1)