Figure 1 shows an algorithm Chloe has written using pseudocode to calculate the mean of a series of temperature readings.
Chloe uses the input sequence 10, 20, 30, -99 to test her algorithm, where -99 is the sentinel value used to stop input.
1 SET total TO 0
2 SET temp TO 0
3 SET count TO 0
4 WHILE temp <> -99 DO
5 SEND 'Enter temperature (or -99 to stop):' TO DISPLAY
6 RECEIVE temp FROM (INTEGER) KEYBOARD
7 SET total TO total + temp
8 SET count TO count + 1
9 END WHILE
10 SET mean TO total / count
11 SEND 'The mean temperature is ' & mean TO DISPLAY
| Expected result | Actual result |
|---|---|
| The mean temperature is 20 | The mean temperature is -9.75 |
Explain why the Actual result is not the same as the Expected result.