Any four from:
– initialisation, set highest apartment temperature to a low value, set lowest apartment
temperature to a high value outside loop
– input temperature
– store in array
– test for temperature > highest apartment temperature reset highest apartment
temperature if this is the case
– test for temperature < lowest apartment temperature reset lowest apartment temperature
if this is the case
– calculate range
– output highest temperature, lowest temperature and the range outside loop
(Max four marks)
– loop 60 times must have both tests within the loop, initialisation before the loop and
output after the loop (One mark) [5]
sample algorithm:
HighestTemp 0; LowestTemp 100
FOR Count 1 to 60
INPUT Temperature
ApartmentTemp[Count] Temperature
IF ApartmentTemp[Count] > HighestTemp
THEN HighestTemp ApartmentTemp[Count]
ENDIF
IF ApartmentTemp[Count] < LowestTemp
THEN LowestTemp ApartmentTemp[Count]
ENDIF
NEXT Count
Range HighestTemp – LowestTemp
PRINT 'Highest Temperature recorded ', HighestTemp
PRINT 'Lowest Temperature recorded ', LowestTemp
PRINT 'Range ', Range