Unit_3_Selection_Statements_Gaddis

## CS102 - Java Programming Language

### Conditional (Selection Statement)
- Unit 3 Overview
- Instructor: Charles Edeki

## Objectives of Unit 3
- Main topics covered:
- The if Statement
- The if-else Statement
- Nested if Statements
- The if-else-if Statement
- Logical Operators
- Comparing String Objects
- The Conditional Operator
- The switch Statement

## The if Statement
- Definition:
- Determines whether a section of code executes based on a boolean condition.
- Structure:
- `if (boolean expression is true) execute next statement.`

## Flowcharts
### Visual Representation of if Statements
- Flowchart for a basic if statement:
- Example: "Is it cold outside?"
- Decision: Yes → wearCoat();

### Block if Statement Flowchart
- Example:
- Decision: Is it cold outside?
- Actions: wearCoat(); wearHat(); wearGloves();
- Note: Curly braces `{}` block multiple statements.

## Relational Operators
- Definition:
- Used in boolean expressions for comparisons.
- Operators and Meanings:
- `>` : greater than
- `
robot