SlideShare a Scribd company logo
1 of 19
RECOGNIZING
STRUCTURES
Recognizing Structures
 When you are beginning to learn about
structured program design, it is difficult to
detect whether a flowchart of a program’s logic
is structured.
 In recognizing structure, the three basic
structures must be taken into consideration.
 By recognizing its structure we can identify if
there are tangled or unstructured flowchart
segments.
Example 1:
 Does the flowchart
segment
structured?
 How many
structures does
the flowchart
segment have?
 What structures do
you recognize
from the flowchart
segment?
Sequence
Selection
Figure 1
Example 2:
 Does the flowchart
segment
structured?
 How many
structures does
the flowchart
segment have?
 What structures do
you recognize
from the flowchart
segment?
Loop
Selection
Figure 2
Example 3:
 Does the
flowchart
segment
structured?
 No, it is not built
from the three
basic structures.
Figure 3
This part of
the segment
is not
structured
Spaghetti Bowl Method
 One way to straighten out an unstructured
flowchart segment is to use the “spaghetti
bowl” method.
 That is, picture the flowchart as a bowl of
spaghetti that you must untangle. Imagine you
can grab one piece of pasta at the top of the
bowl and start pulling. As you “pull” each
symbol out of the tangled mess, you can
untangle the separate paths until the entire
segment is structured.
Spaghetti Bowl Method (cont’d.)
 Use the Spaghetti Bowl Method to structure
the flowchart segment
 Start pulling at Figure 3 top
 Encounter procedure box Labeled A (Figure 3-1)
Figure 3-1 Untangling Example 3, first step
Spaghetti Bowl Method (cont’d.)
 Next item is a question
 Testing condition labeled B (Figure 3-2)
 Now know sequence starting with A ended
Figure 3-2 Untangling Example 3, second step
Spaghetti Bowl Method (cont’d.)
 Pull flowline from “No” side of Question B
 Encounter C (Figure 3-3)
Figure 3-3 Untangling Example 3, third step
Spaghetti Bowl Method (cont’d.)
 Pull flowline from “Yes” side of Question B
 Encounter D (Figure 3-4)
Figure 3-4 Untangling Example 3, fourth step
Spaghetti Bowl Method (cont’d.)
 Follow line on left side of Question D
 If line attached somewhere, untangle by repeating
tangled step
 Continue pulling flowline emerging from Step
C
 Reach end of program segment (Figure 3-5)
Figure 3-5 Untangling Example 3, fifth step
Spaghetti Bowl Method (cont’d.)
 Pull right side of Question D
 Process E pops up (Figure 2-6)
 Reached the end
Figure 2-6 Untangling Example 3, sixth step
Spaghetti Bowl Method (cont’d.)
 Question D brought together: selection
structure
 Question B loose ends brought together:
selection structure
Figure 3 Finished flowchart and
pseudo code for untangling
Example 3
Describing Three Special
Structures –
Case, While and Do-Until
 Three more forms of basic structures
 Case
 Alternative decision-making structure
 Do-while
 Alternative to while loop
 Do-until loops
 Alternative to while loop
 Sometimes convenient
 All acceptable, legal structures
The Case Structure
 Several possible values exists for single
variable being tested
 Each value requires different course of action
 Flow passes through only one alternative
 Flowchart, pseudo code, program code
convenience
 Easier to understand at first glance
 Examples
 Figure 4-1: series of decisions
 Figure 4-2: case structure implementing decisions
The Case Structure (cont’d.)
Figure 4-1 Flowchart and pseudo code of tuition
decisions
The Case Structure (cont’d.)
Figure 4-2 Flowchart
and pseudo code of
case structure
The While Loop
 while loop
 Condition tested at structure beginning
 Condition not met at first test
 Code in while structure body never executed
 Also called a pretest loop
Figure 4-3 The while loop
The Do-While or Do-Until Loops
 do-while loop
 Condition tested at structure end
 Body has executed at least once
 Expressed as a sequence followed by a loop
 Also called a posttest loop
Figure 4-4 The do-while or do-until loop

More Related Content

More from MattFlordeliza1

bootstrap 4 used for discussion in chcci.pptx
bootstrap 4 used for discussion in chcci.pptxbootstrap 4 used for discussion in chcci.pptx
bootstrap 4 used for discussion in chcci.pptxMattFlordeliza1
 
JDBC OVERVIEW uses from the subject of EDP.pptx
JDBC OVERVIEW uses from the subject of EDP.pptxJDBC OVERVIEW uses from the subject of EDP.pptx
JDBC OVERVIEW uses from the subject of EDP.pptxMattFlordeliza1
 
ACtionlistener in java use in discussion.pptx
ACtionlistener in java use in discussion.pptxACtionlistener in java use in discussion.pptx
ACtionlistener in java use in discussion.pptxMattFlordeliza1
 
PLF-Lesson tsu lecture time 2 units-2.pptx
PLF-Lesson tsu lecture time 2 units-2.pptxPLF-Lesson tsu lecture time 2 units-2.pptx
PLF-Lesson tsu lecture time 2 units-2.pptxMattFlordeliza1
 
Psuedocode1, algorithm1, Flowchart1.pptx
Psuedocode1, algorithm1, Flowchart1.pptxPsuedocode1, algorithm1, Flowchart1.pptx
Psuedocode1, algorithm1, Flowchart1.pptxMattFlordeliza1
 

More from MattFlordeliza1 (7)

bootstrap 4 used for discussion in chcci.pptx
bootstrap 4 used for discussion in chcci.pptxbootstrap 4 used for discussion in chcci.pptx
bootstrap 4 used for discussion in chcci.pptx
 
JDBC OVERVIEW uses from the subject of EDP.pptx
JDBC OVERVIEW uses from the subject of EDP.pptxJDBC OVERVIEW uses from the subject of EDP.pptx
JDBC OVERVIEW uses from the subject of EDP.pptx
 
ACtionlistener in java use in discussion.pptx
ACtionlistener in java use in discussion.pptxACtionlistener in java use in discussion.pptx
ACtionlistener in java use in discussion.pptx
 
PLF-Lesson tsu lecture time 2 units-2.pptx
PLF-Lesson tsu lecture time 2 units-2.pptxPLF-Lesson tsu lecture time 2 units-2.pptx
PLF-Lesson tsu lecture time 2 units-2.pptx
 
Psuedocode1, algorithm1, Flowchart1.pptx
Psuedocode1, algorithm1, Flowchart1.pptxPsuedocode1, algorithm1, Flowchart1.pptx
Psuedocode1, algorithm1, Flowchart1.pptx
 
www module 1.pptx
www module 1.pptxwww module 1.pptx
www module 1.pptx
 
QUEUE.pptx
QUEUE.pptxQUEUE.pptx
QUEUE.pptx
 

Recently uploaded

Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night StandHot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Standkumarajju5765
 
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...APNIC
 
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort ServiceEnjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort ServiceDelhi Call girls
 
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...Sheetaleventcompany
 
How is AI changing journalism? (v. April 2024)
How is AI changing journalism? (v. April 2024)How is AI changing journalism? (v. April 2024)
How is AI changing journalism? (v. April 2024)Damian Radcliffe
 
INDIVIDUAL ASSIGNMENT #3 CBG, PRESENTATION.
INDIVIDUAL ASSIGNMENT #3 CBG, PRESENTATION.INDIVIDUAL ASSIGNMENT #3 CBG, PRESENTATION.
INDIVIDUAL ASSIGNMENT #3 CBG, PRESENTATION.CarlotaBedoya1
 
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...Delhi Call girls
 
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...Neha Pandey
 
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptxAWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptxellan12
 
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.soniya singh
 
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...tanu pandey
 
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRLLucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRLimonikaupta
 
(+971568250507 ))# Young Call Girls in Ajman By Pakistani Call Girls in ...
(+971568250507  ))#  Young Call Girls  in Ajman  By Pakistani Call Girls  in ...(+971568250507  ))#  Young Call Girls  in Ajman  By Pakistani Call Girls  in ...
(+971568250507 ))# Young Call Girls in Ajman By Pakistani Call Girls in ...Escorts Call Girls
 
Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.soniya singh
 

Recently uploaded (20)

Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night StandHot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
 
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No AdvanceRohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
 
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
 
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort ServiceEnjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
 
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
 
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝
 
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
 
How is AI changing journalism? (v. April 2024)
How is AI changing journalism? (v. April 2024)How is AI changing journalism? (v. April 2024)
How is AI changing journalism? (v. April 2024)
 
INDIVIDUAL ASSIGNMENT #3 CBG, PRESENTATION.
INDIVIDUAL ASSIGNMENT #3 CBG, PRESENTATION.INDIVIDUAL ASSIGNMENT #3 CBG, PRESENTATION.
INDIVIDUAL ASSIGNMENT #3 CBG, PRESENTATION.
 
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
 
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
 
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptxAWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
 
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
 
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...
 
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
 
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
 
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRLLucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
 
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No AdvanceRohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
 
(+971568250507 ))# Young Call Girls in Ajman By Pakistani Call Girls in ...
(+971568250507  ))#  Young Call Girls  in Ajman  By Pakistani Call Girls  in ...(+971568250507  ))#  Young Call Girls  in Ajman  By Pakistani Call Girls  in ...
(+971568250507 ))# Young Call Girls in Ajman By Pakistani Call Girls in ...
 
Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.
 

PLF-Lesson-5 programming in TSU lec.pptx

  • 2. Recognizing Structures  When you are beginning to learn about structured program design, it is difficult to detect whether a flowchart of a program’s logic is structured.  In recognizing structure, the three basic structures must be taken into consideration.  By recognizing its structure we can identify if there are tangled or unstructured flowchart segments.
  • 3. Example 1:  Does the flowchart segment structured?  How many structures does the flowchart segment have?  What structures do you recognize from the flowchart segment? Sequence Selection Figure 1
  • 4. Example 2:  Does the flowchart segment structured?  How many structures does the flowchart segment have?  What structures do you recognize from the flowchart segment? Loop Selection Figure 2
  • 5. Example 3:  Does the flowchart segment structured?  No, it is not built from the three basic structures. Figure 3 This part of the segment is not structured
  • 6. Spaghetti Bowl Method  One way to straighten out an unstructured flowchart segment is to use the “spaghetti bowl” method.  That is, picture the flowchart as a bowl of spaghetti that you must untangle. Imagine you can grab one piece of pasta at the top of the bowl and start pulling. As you “pull” each symbol out of the tangled mess, you can untangle the separate paths until the entire segment is structured.
  • 7. Spaghetti Bowl Method (cont’d.)  Use the Spaghetti Bowl Method to structure the flowchart segment  Start pulling at Figure 3 top  Encounter procedure box Labeled A (Figure 3-1) Figure 3-1 Untangling Example 3, first step
  • 8. Spaghetti Bowl Method (cont’d.)  Next item is a question  Testing condition labeled B (Figure 3-2)  Now know sequence starting with A ended Figure 3-2 Untangling Example 3, second step
  • 9. Spaghetti Bowl Method (cont’d.)  Pull flowline from “No” side of Question B  Encounter C (Figure 3-3) Figure 3-3 Untangling Example 3, third step
  • 10. Spaghetti Bowl Method (cont’d.)  Pull flowline from “Yes” side of Question B  Encounter D (Figure 3-4) Figure 3-4 Untangling Example 3, fourth step
  • 11. Spaghetti Bowl Method (cont’d.)  Follow line on left side of Question D  If line attached somewhere, untangle by repeating tangled step  Continue pulling flowline emerging from Step C  Reach end of program segment (Figure 3-5) Figure 3-5 Untangling Example 3, fifth step
  • 12. Spaghetti Bowl Method (cont’d.)  Pull right side of Question D  Process E pops up (Figure 2-6)  Reached the end Figure 2-6 Untangling Example 3, sixth step
  • 13. Spaghetti Bowl Method (cont’d.)  Question D brought together: selection structure  Question B loose ends brought together: selection structure Figure 3 Finished flowchart and pseudo code for untangling Example 3
  • 14. Describing Three Special Structures – Case, While and Do-Until  Three more forms of basic structures  Case  Alternative decision-making structure  Do-while  Alternative to while loop  Do-until loops  Alternative to while loop  Sometimes convenient  All acceptable, legal structures
  • 15. The Case Structure  Several possible values exists for single variable being tested  Each value requires different course of action  Flow passes through only one alternative  Flowchart, pseudo code, program code convenience  Easier to understand at first glance  Examples  Figure 4-1: series of decisions  Figure 4-2: case structure implementing decisions
  • 16. The Case Structure (cont’d.) Figure 4-1 Flowchart and pseudo code of tuition decisions
  • 17. The Case Structure (cont’d.) Figure 4-2 Flowchart and pseudo code of case structure
  • 18. The While Loop  while loop  Condition tested at structure beginning  Condition not met at first test  Code in while structure body never executed  Also called a pretest loop Figure 4-3 The while loop
  • 19. The Do-While or Do-Until Loops  do-while loop  Condition tested at structure end  Body has executed at least once  Expressed as a sequence followed by a loop  Also called a posttest loop Figure 4-4 The do-while or do-until loop

Editor's Notes

  1. Yes it is structured.. 2 structures Sequence and Selection NOTE: notice that the segment has only one entry point and exit point.
  2. Yes it is structured.. 2 structures Loop and a Selection within the Loop NOTE: notice that the segment has only one entry point and exit point.