
5
CHAPTER
Flow of Control,Part 1: Selection
Introduction
5.1 Forming Conditions
5.1.1 Equality Operators
5.1.2 Relational Operators
5.1.3 Logical Operators
5.2 Simple Selection with if
5.3 Selection Using if/else
5.4 Selection Using if/else if
5.5 Sequential and Nested if/else Statements
5.5.1 Sequential if/else Statements
5.5.2 Nested if/else Statements
5.6 Testing Techniques for if/else Statements
5.7 Programming Activity 1: Working
with if/else
5.8 Comparing Floating-Point Numbers
5.9 Comparing Objects
5.9.1 The equals Method
5.9.2 String Comparison Methods
5.10 The Conditional Operator (?:)
5.11 The switch Statement
5.12 Programming Activity 2: Using the sw