Download presentation
Presentation is loading. Please wait.
1
Program Flow CSCE 121 J. Michael Moore
2
Structured Programming
Programmers used to use ‘goto’ a lot. This is universally considered BAD PRACTICE. This resulted in “Spaghetti code” that was hard to follow / understand / debug. Structured programming saw all programs as composed of three control structures. While not the only programming paradigm, aspects of structured programming still apply today.
3
Control Structures Sequence Selection Iteration
4
Sequence Selection Iteration Control Structures
The ordering of statements Can include function calls Essentially no “Decisions” are made.
5
Sequence Selection Iteration Control Structures Also called branching
Allows a block of code to be executed or not based on a “Decision/Question” Allows for different paths through the code
6
Sequence Selection Iteration Control Structures Also called looping
Allows a block of code to be run repeatedly until a condition is satisfied
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.