Chapter 3:  Program Statements

Program Statements

Program Development

Requirements

Design

Implementation

Testing

Flow of Control

Conditional Statements

The if Statement

The if Statement

Logic of an if statement

Boolean Expressions

The if-else Statement

Logic of an if-else statement

Block Statements

Nested if Statements

The switch Statement

The switch Statement

The switch Statement

The switch Statement

The switch Statement

Logical Operators

Logical NOT

Logical AND and Logical OR

Truth Tables

Logical Operators

Short Circuited Operators

Truth Tables

Comparing Characters

Comparing Strings

Lexicographic Ordering

Comparing Float Values

More Operators

Increment and Decrement

Increment and Decrement

Increment and Decrement

Increment and Decrement

Assignment Operators

Assignment Operators

Assignment Operators

Assignment Operators

The Conditional Operator

The Conditional Operator

The Conditional Operator

Repetition Statements

The while Statement

Logic of a while Loop

The while Statement

Infinite Loops

Nested Loops

The StringTokenizer Class

The StringTokenizer Class

The do Statement

Logic of a do Loop

The do Statement

Comparing while and do

The for Statement

The for Statement

Logic of a for loop

The for Statement

The for Statement

Choosing a Loop Structure

Program Development

Program Development

Program Development

Program Development

Program Development

More Drawing Techniques

Summary