Difference between revisions of "2016 Old Spec"
(Created page with "=Question 5= The algorithm, represented using pseudo-code in Figure 4, and the variable table, Table 2, describe a program that outputs an estimate for a particular calcula...") |
(→Figure 4) |
||
Line 6: | Line 6: | ||
=Figure 4= | =Figure 4= | ||
− | OUTPUT "Enter a number:" | + | OUTPUT "Enter a number:" |
INPUT N | INPUT N | ||
F 16.0 | F 16.0 |
Revision as of 13:10, 29 November 2016
Question 5
The algorithm, represented using pseudo-code in Figure 4, and the variable table, Table 2, describe a program that outputs an estimate for a particular calculation.
Figure 4
OUTPUT "Enter a number:" INPUT N F 16.0 IF N >= 1.0 THEN X N WHILE X * X – N > 1.0 AND F – 1.0 > 1.0 DO L X X X ÷ F WHILE X * X <= N DO F F – 0.1 X L ÷ F ENDWHILE ENDWHILE OUTPUT X ELSE OUTPUT