2. Desk checking, given all
values
BEGIN RandProg Go through the algorithm, and list
A=3 as headings, all the components
B=4 that change values in the
C=5 algorithm.
Counter=0
Number=20
WHILE Number> Counter
A=A+1
B=B+1
C=C+B
Print C
Counter= Counter+B
ENDWHILE
END RandProg
3. Desk checking, given all
values
BEGIN RandProg Go through the algorithm, and list
A=3 as headings, all the components
B=4 that change values in the
C=5 algorithm.
Counter=0
Number=20 A B C Counte Numbe Print
WHILE Number> Counter r r
A=A+1
B=B+1
C=C+B
Print C
Counter= Counter+B
ENDWHILE
END RandProg
4. Desk checking, given all
values
BEGIN RandProg Go through the algorithm line by
A=3 line and add the results of each
B=4 line to the table.
C=5
Counter=0
Number=20 A B C Counte Numbe Print
WHILE Number> Counter r r
A=A+1
B=B+1
C=C+B
Print C
Counter= Counter+B
ENDWHILE
END RandProg
5. Desk checking, given all
values
BEGIN RandProg Go through the algorithm line by
A=3 line and add the results of each
B=4 line to the table.
C=5
Counter=0
Number=20 A B C Counte Numbe Print
WHILE Number> Counter r r
A=A+1 3
B=B+1
C=C+B
Print C
Counter= Counter+B
ENDWHILE
END RandProg
6. Desk checking, given all
values
BEGIN RandProg Go through the algorithm line by
A=3 line and add the results of each
B=4 line to the table.
C=5
Counter=0
Number=20 A B C Counte Numbe Print
WHILE Number> Counter r r
A=A+1 3 4
B=B+1
C=C+B
Print C
Counter= Counter+B
ENDWHILE
END RandProg
7. Desk checking, given all
values
BEGIN RandProg Go through the algorithm line by
A=3 line and add the results of each
B=4 line to the table.
C=5
Counter=0
Number=20 A B C Counte Numbe Print
WHILE Number> Counter r r
A=A+1 3 4 5
B=B+1
C=C+B
Print C
Counter= Counter+B
ENDWHILE
END RandProg
8. Desk checking, given all
values
BEGIN RandProg Go through the algorithm line by
A=3 line and add the results of each
B=4 line to the table.
C=5
Counter=0
Number=20 A B C Counte Numbe Print
WHILE Number> Counter r r
A=A+1 3 4 5 0
B=B+1
C=C+B
Print C
Counter= Counter+B
ENDWHILE
END RandProg
9. Desk checking, given all
values
BEGIN RandProg Go through the algorithm line by
A=3 line and add the results of each
B=4 line to the table.
C=5
Counter=0
Number=20 A B C Counte Numbe Print
WHILE Number> Counter r r
A=A+1 3 4 5 0 20
B=B+1
C=C+B
Print C
Counter= Counter+B
ENDWHILE
END RandProg
10. Desk checking, given all
values
BEGIN RandProg Go through the algorithm line by
A=3 line and add the results of each
B=4 line to the table.
C=5
Counter=0
Number=20 A B C Counte Numbe Print
WHILE Number> Counter r r
A=A+1 3 4 5 0 20
B=B+1
C=C+B 4
Print C
Counter= Counter+B
ENDWHILE
END RandProg
11. Desk checking, given all
values
BEGIN RandProg Go through the algorithm line by
A=3 line and add the results of each
B=4 line to the table.
C=5
Counter=0
Number=20 A B C Counte Numbe Print
WHILE Number> Counter r r
A=A+1 3 4 5 0 20
B=B+1
C=C+B 4 5
Print C
Counter= Counter+B
ENDWHILE
END RandProg
12. Desk checking, given all
values
BEGIN RandProg Go through the algorithm line by
A=3 line and add the results of each
B=4 line to the table.
C=5
Counter=0
Number=20 A B C Counte Numbe Print
WHILE Number> Counter r r
A=A+1 3 4 5 0 20
B=B+1
C=C+B 4 5 10
Print C
Counter= Counter+B
ENDWHILE
END RandProg
13. Desk checking, given all
values
BEGIN RandProg Go through the algorithm line by
A=3 line and add the results of each
B=4 line to the table.
C=5
Counter=0
Number=20 A B C Counte Numbe Print
WHILE Number> Counter r r
A=A+1 3 4 5 0 20
B=B+1
C=C+B 4 5 10 10
Print C
Counter= Counter+B
ENDWHILE
END RandProg
14. Desk checking, given all
values
BEGIN RandProg Go through the algorithm line by
A=3 line and add the results of each
B=4 line to the table.
C=5
Counter=0
Number=20 A B C Counte Numbe Print
WHILE Number> Counter r r
A=A+1 3 4 5 0 20
B=B+1
C=C+B 4 5 10 5 10
Print C
Counter= Counter+B
ENDWHILE
END RandProg
15. Desk checking, given all
values
BEGIN RandProg Go through the algorithm line by
A=3 line and add the results of each
B=4 line to the table.
C=5
Counter=0
Number=20 A B C Counte Numbe Print
WHILE Number> Counter r r
A=A+1 3 4 5 0 20
B=B+1
C=C+B 4 5 10 5 10
Print C 5
Counter= Counter+B
ENDWHILE
END RandProg
16. Desk checking, given all
values
BEGIN RandProg Go through the algorithm line by
A=3 line and add the results of each
B=4 line to the table.
C=5
Counter=0
Number=20 A B C Counte Numbe Print
WHILE Number> Counter r r
A=A+1 3 4 5 0 20
B=B+1
C=C+B 4 5 10 5 10
Print C 5 6 16 9 16
Counter= Counter+B
ENDWHILE
END RandProg
17. Desk checking, given all
values
BEGIN RandProg And so on until you have run
A=3 through the entire program
B=4
C=5
Counter=0
Number=20 A B C Counte Numbe Print
WHILE Number> Counter r r
A=A+1 3 4 5 0 20
B=B+1
C=C+B 4 5 10 5 10
Print C 5 6 16 9 16
Counter= Counter+B
6 7 23 32 23
ENDWHILE
END RandProg
19. BEGIN So, what do you need
Read Number 1, Read to test?
Number 2
IF Difference <0 THEN CRITICAL VALUES
Print “First number is
lower” Set 1: Large number,
ELSE small number
Print “Second Number is
lower”
Set 2: Small number,
END IF
large Number
END
Set 3: Same Numbers
20. Set 1: Large Number,
Small Number
BEGIN
Read Number 1, Read
Number 2
IF Difference <0 THEN
Print “First number is
lower”
ELSE
Print “Second Number is
lower”
END IF Num1 Num2 Differenc Output
e
END
3 1 2 Second
Number is
lower
21. Set 2: Small Number,
Large Number
BEGIN
Read Number 1, Read
Number 2
IF Difference <0 THEN
Print “First number is
lower”
ELSE
Print “Second Number is
lower”
END IF Num1 Num2 Differenc Output
e
END
1 2 -1 First
Number is
lower
22. Set 3: Same Numbers
BEGIN
Read Number 1, Read
Number 2
IF Difference <0 THEN
Print “First number is
lower”
ELSE
Print “Second Number is
lower”
END IF Num1 Num2 Differenc Output
e
END
3 3 0