There are four errors in the pseudocode in Figure 2 which processes a list of parcel weights.
Write the correct pseudocode for line 25.
Figure 2
| 01 | |
| 02 | SET weights TO [2.5, 0.8, 4.2, 1.0, 3.8, 0.4] |
| 03 | |
| 04 | SET light TO 0 |
| 05 | SET standard TO 0 |
| 06 | SET heavy TO 0 |
| 07 | SET index TO 0 |
| 08 | |
| 09 | WHILE NOT (index > LENGTH(weights)) DO |
| 10 | |
| 11 | IF weights[index] < 1.0 THEN |
| 12 | SET light TO light + 1 |
| 13 | ELSE |
| 14 | IF weights[index] > 4.0 THEN |
| 15 | SET heavy TO weights[index] |
| 16 | ELSE |
| 17 | SET standard TO standard + 1 |
| 18 | END IF |
| 19 | END IF |
| 20 | |
| 21 | SET index TO index + 1 |
| 22 | END WHILE |
| 23 | |
| 24 | SEND "Light: " & light TO DISPLAY |
| 25 | SEND "Total items processed: " & (light - heavy) TO DISPLAY |
| 26 | SEND "Heavy: " & heavy TO DISPLAY |
| 27 |