A program asks the user to enter five temperature readings (in °C). It sums only the readings above freezing (0°C) and then outputs the total of positive temperatures.
1 LET total_warm_degrees <- 0 2 LET reading_index <- 1 3 WHILE reading_index <= 5 DO 4 READ temperature 5 IF temperature > 0 THEN 6 total_warm_degrees <- total_warm_degrees + temperature 7 END_IF 8 reading_index <- reading_index + 1 9 ENDWHILE 10 OUTPUT total_warm_degrees