Upcoming SlideShare
×

# Desk Chekcing Algorithms

1,602 views

Published on

Published in: Education, Technology
2 Likes
Statistics
Notes
• Full Name
Comment goes here.

Are you sure you want to Yes No
• Be the first to comment

Views
Total views
1,602
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
0
0
Likes
2
Embeds 0
No embeds

No notes for slide

### Desk Chekcing Algorithms

1. 1. Desk Checking Kelly Bauer
2. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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
18. 18. Desk Checking Variable values
19. 19. BEGIN    So, what do you need  Read Number 1, Read  to test?   Number 2  IF Diﬀerence <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. 20. Set 1: Large Number,  Small Number  BEGIN  Read Number 1, Read  Number 2  IF Diﬀerence <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. 21. Set 2: Small Number,  Large Number   BEGIN  Read Number 1, Read  Number 2  IF Diﬀerence <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. 22. Set 3: Same Numbers  BEGIN  Read Number 1, Read  Number 2  IF Diﬀerence <0 THEN  Print “First number is  lower”  ELSE  Print “Second Number is  lower”  END IF  Num1 Num2 Differenc Output e END  3 3 0