Programming in c++ Conditions, Logical EXpressions and the Selection Control Structures Dale/eems/Headington
1 Conditions, Logical Expressions, and the Selection Control Structures
Programming in C++ Chapter 5 Topics Data Type bool % Using Relational and Logical Operators to Construct and Evaluate Logical Expressions oIfThen-Else Statements %If-Then Statements Nested If Statements for Multi-way Branching Testing the State of an I/O Stream Testing a C++ Program
2 Chapter 5 Topics ❖Data Type bool ❖Using Relational and Logical Operators to Construct and Evaluate Logical Expressions ❖If-Then-Else Statements ❖If-Then Statements ❖Nested If Statements for Multi-way Branching ❖Testing the State of an I/O Stream ❖Testing a C++ Program
Programming in C++ Flow of Control &the order in which program statements are executed WHAT ARE THE POSSIBILITIES
3 Flow of Control ❖the order in which program statements are executed WHAT ARE THE POSSIBILITIES. .
Programming in C++ Flow of Control is Sequential unless a control structure'is used to change that o there are 2 general types of control structures Selection(also called branching) Repetition (also called looping)
4 Flow of Control ❖is Sequential unless a “control structure” is used to change that ❖there are 2 general types of control structures: Selection (also called branching) Repetition (also called looping)
Programming in C++ C++ control structures Selection ff else switch Repetition for loop while loop do. while loop
5 C++ control structures ❖Selection if if . . . else switch ❖Repetition for loop while loop do . . . while loop