Computing problems Solved by executing a series of actions in a specific order Algorithm a procedure determining Actions to be executed Order to be executed. Example: recipe Program control Specifies the order in which statements are executed | Chapter 2 - Control Structures Outline Introduction Algorithms Pseudocode Control Structures if Selection Structure if/else Selection Structure while Repetition Structure Formulating Algorithms: Case Study 1 (Counter-Controlled Repetition) Formulating Algorithms with Top-Down, Stepwise Refinement: Case Study 2 (Sentinel-Controlled Repetition) Formulating Algorithms with Top-Down, Stepwise Refinement: Case Study 3 (Nested Control Structures) Assignment Operators Increment and Decrement Operators Essentials of Counter-Controlled Repetition for Repetition Structure Examples Using the for Structure Chapter 2 - Control Structures Outline switch Multiple-Selection Structure do/while Repetition Structure break and continue Statements Logical Operators Confusing Equality (==) and Assignment (=) Operators Structured-Programming Summary Introduction Before writing a program Have a . | Chapter 2 - Control Structures Outline Introduction Algorithms Pseudocode Control Structures if Selection Structure if/else Selection Structure while Repetition Structure Formulating Algorithms: Case Study 1 (Counter-Controlled Repetition) Formulating Algorithms with Top-Down, Stepwise Refinement: Case Study 2 (Sentinel-Controlled Repetition) Formulating Algorithms with Top-Down, Stepwise Refinement: Case Study 3 (Nested Control Structures) Assignment Operators Increment and Decrement Operators Essentials of Counter-Controlled Repetition for Repetition Structure Examples Using the for Structure Chapter 2 - Control Structures Outline switch Multiple-Selection Structure do/while Repetition Structure break and continue Statements Logical Operators Confusing Equality (==) and Assignment (=) Operators Structured-Programming Summary Introduction Before writing a program Have a thorough understanding of problem Carefully plan your approach for solving it While writing a program Know what “building blocks” are available Use good programming principles Algorithms Computing problems Solved by executing a series of actions in a specific order Algorithm a procedure determining Actions to be executed Order to be executed Example: recipe Program control Specifies the order in which statements are executed Pseudocode Pseudocode Artificial, informal language used to develop algorithms Similar to everyday English Not executed on computers Used to think out program before coding Easy to convert into C++ program Only executable statements No need to declare variables Control Structures Sequential execution Statements executed in order Transfer of control Next statement executed not next one in sequence 3 control structures (Bohm and Jacopini) Sequence structure Programs executed sequentially by default Selection structures if, if/else, switch Repetition