An algorithm is designed to validate the flight parameters of a high-altitude research balloon and calculate its ascent distance.
1 validMission ← False
2 REPEAT
3 ascentDistance ← -99
4 OUTPUT 'Enter launch altitude (km)'
5 launchAlt ← USERINPUT
6 OUTPUT 'Enter burst altitude (km)'
7 burstAlt ← USERINPUT
8 IF launchAlt ≥ burstAlt THEN
9 OUTPUT 'Launch altitude must be below burst altitude'
10 ELSE
11 IF burstAlt > 35 THEN
12 OUTPUT 'Burst altitude cannot exceed 35 km safety limit'
13 ELSE
14 validMission ← True
15 ENDIF
16 ENDIF
17 UNTIL validMission = True
18 ascentDistance ← burstAlt - launchAlt
19 OUTPUT ascentDistance
The table below shows three independent tests used to check the algorithm.
Complete the table to show the values of the validMission and ascentDistance variables at the end of each independent test execution.
| Test type | Test data | validMission | ascentDistance | |
|---|---|---|---|---|
| Normal | launchAlt | 12 | ||
burstAlt | 30 | |||
| Erroneous | launchAlt | 40 | ||
burstAlt | 25 | |||
| Boundary | launchAlt | 10 | ||
burstAlt | 35 |