SlideShare une entreprise Scribd logo
1  sur  23
Desk Checking
    Kelly
Bauer

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Desk Checking
   Variable
values

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

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
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
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
Desk Chekcing Algorithms

Contenu connexe

En vedette (10)

2008 Exam Questions Social And Ethical
2008 Exam Questions Social And Ethical2008 Exam Questions Social And Ethical
2008 Exam Questions Social And Ethical
 
Psd - Programma Structuur Diagram
Psd - Programma Structuur DiagramPsd - Programma Structuur Diagram
Psd - Programma Structuur Diagram
 
Nassi shneiderman diagrams
Nassi shneiderman diagramsNassi shneiderman diagrams
Nassi shneiderman diagrams
 
Meta Languages Railroad Diagrams
Meta Languages Railroad DiagramsMeta Languages Railroad Diagrams
Meta Languages Railroad Diagrams
 
Meta Languages Bnf Ebnf Student Version
Meta Languages Bnf Ebnf Student VersionMeta Languages Bnf Ebnf Student Version
Meta Languages Bnf Ebnf Student Version
 
Exam feedback term 1 2011
Exam feedback term 1 2011Exam feedback term 1 2011
Exam feedback term 1 2011
 
Algorithms Vs Meta Language
Algorithms Vs Meta LanguageAlgorithms Vs Meta Language
Algorithms Vs Meta Language
 
Searching algorithms
Searching algorithmsSearching algorithms
Searching algorithms
 
Data Structures - Lecture 8 [Sorting Algorithms]
Data Structures - Lecture 8 [Sorting Algorithms]Data Structures - Lecture 8 [Sorting Algorithms]
Data Structures - Lecture 8 [Sorting Algorithms]
 
Sorting Algorithms
Sorting AlgorithmsSorting Algorithms
Sorting Algorithms
 

Plus de Kelly Bauer

Plus de Kelly Bauer (20)

Logo design
Logo designLogo design
Logo design
 
Team teaching
Team teachingTeam teaching
Team teaching
 
Cmyk vs rgb
Cmyk vs rgbCmyk vs rgb
Cmyk vs rgb
 
Structural factors
Structural factorsStructural factors
Structural factors
 
Scaffolding activities
Scaffolding activitiesScaffolding activities
Scaffolding activities
 
Team teaching
Team teachingTeam teaching
Team teaching
 
Entry document
Entry documentEntry document
Entry document
 
Project showcase
Project showcaseProject showcase
Project showcase
 
Project showcase church in the middle ages
Project showcase church in the middle agesProject showcase church in the middle ages
Project showcase church in the middle ages
 
Selection and justification
Selection and justificationSelection and justification
Selection and justification
 
6 multimedia elements - www
6   multimedia elements - www6   multimedia elements - www
6 multimedia elements - www
 
3 multimedia elements - audio
3   multimedia elements - audio3   multimedia elements - audio
3 multimedia elements - audio
 
OHS for Industrial Technology
OHS for Industrial TechnologyOHS for Industrial Technology
OHS for Industrial Technology
 
Images (Samples from past exams
Images (Samples from past examsImages (Samples from past exams
Images (Samples from past exams
 
Personell issues
Personell issuesPersonell issues
Personell issues
 
Differentiation
DifferentiationDifferentiation
Differentiation
 
Exam feedback term 1 2011
Exam feedback term 1 2011Exam feedback term 1 2011
Exam feedback term 1 2011
 
5 multimedia elements - animation
5   multimedia elements - animation5   multimedia elements - animation
5 multimedia elements - animation
 
4 multimedia elements - video
4   multimedia elements - video4   multimedia elements - video
4 multimedia elements - video
 
Stem 71 24 multimedia elements - graphics
Stem 71 24   multimedia elements - graphicsStem 71 24   multimedia elements - graphics
Stem 71 24 multimedia elements - graphics
 

Dernier

Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
negromaestrong
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
 

Dernier (20)

Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptx
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 

Desk Chekcing Algorithms

  • 1. Desk Checking Kelly
Bauer

  • 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

  • 18. Desk Checking Variable
values

  • 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