Scenario Practice 2
Scenario Practice 2
1. Hourly temperatures are recorded for a patient admitted to a hospital.A one-dimensional (1D)
array Days[] contains the names of the days of the week. A two-dimensional (2D) array
Readings[] is used to store 24 temperature readings, taken once an hour, for each of the seven
days of the week. A 1D array AverageTemp[] is used to store the average temperature for each
day of the week.
The position of any day’s data is the same in all three arrays. For example, if Wednesday is in
index 4 of Days[], Wednesday’s temperature readings are in index 4 of Readings[] and
Wednesday’s average temperature is in index 4 of AverageTemp[].
The temperature readings are in Celsius to one decimal place. Temperatures can only be from
35.0°C to 42.0°C inclusive.
You must use pseudocode or program code and add comments to explain how your code
works.
You do not need to declare any arrays, variables or constants; you may assume that this has
already been done.
You will need to initialise and populate the array Days[] at the start of the program.
3
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
4
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
[15]
...........................................................................................................................................................