Photo AI

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 icon

Question 2

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.png

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... #peak h... 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

Answer

Selection

Step 2

Complete the table to show the output of the algorithm for the given inputs.

99%

104 rated

Answer

InputsOutput
(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

Answer

For the test data:

  • Month should be 3, 4, or 9 (any of these)
  • Day should be less than or equal to 5
  • Time should not be between 17:00 and 20:00.

Example: Month = 10 AND Day = 4 AND Time = 12:00

Join the GCSE students using SimpleStudy...

97% of Students

Report Improved Results

98% of Students

Recommend to friends

100,000+

Students Supported

1 Million+

Questions answered

;