The ice cream kiosk has a set of freezers for storing ice cream - Edexcel - GCSE Computer Science - Question 9 - 2019 - Paper 1
Question 9
The ice cream kiosk has a set of freezers for storing ice cream. If a freezer malfunctions, then Margaret needs to be informed.
- The perfect temperature for storin... show full transcript
Worked Solution & Example Answer:The ice cream kiosk has a set of freezers for storing ice cream - Edexcel - GCSE Computer Science - Question 9 - 2019 - Paper 1
Step 1
The perfect temperature for storing ice cream is -18°C.
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
Identify the ideal temperature and permissible tolerance. The ideal temperature for storing ice cream is -18°C, with a permissible range of -19°C to -17°C (i.e., ±1°C).
Step 2
An output message must be displayed to show the number and temperature of any freezer falling outside tolerance.
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
Iterate through the list of freezer temperatures. For each temperature, check if it falls outside the acceptable range (-19°C to -17°C). If it does, format the output message accordingly.
Step 3
The output message for each freezer must be on a single line.
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
Ensure that each output message is printed on a new line while specifying the freezer number and its temperature. For example, if Freezer 0 has a temperature of -20°C, then print: 'Freezer 0 is out of tolerance: -20'.
Step 4
No other messages should be displayed.
98%
120 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
Include a control structure to prevent any messages from being output unless they relate to a freezer falling outside of the allowed temperature range.
Step 5
A global data structure holding the temperatures is provided and must be used as part of the solution.
97%
117 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
Use the provided array structure and refer to its elements dynamically to check temperatures and generate outputs accordingly.