A pseudocode algorithm that monitors weather drone altitude readings is shown below.
The first four inputs read from the file AltitudeLog.txt are 180, 320, 95, and 240 in that order.
Complete the trace table showing the execution of the pseudocode with these four inputs. You may not need to use all the rows in the table.
1 SET altitude TO 0
2 SET min_alt TO 500
3 SET max_alt TO 200
4
5 FOR EACH altitude FROM "AltitudeLog.txt" DO
6 IF (altitude < min_alt) THEN
7 SET min_alt TO altitude
8 ENDIF
9 IF (altitude > max_alt) THEN
10 SET max_alt TO altitude
11 ENDIF
12 END FOREACH
13
14 SEND min_alt & " to " & max_alt TO DISPLAY
| altitude | min_alt | max_alt | Display |
|---|---|---|---|