Chapter 2 & 3 Topics

2/3/00


Click here to start


Table of Contents

PPT Slide

Chapter 2 & 3 Topics

An Algorithm is . . .

Three Control Structures

Java control structures

50 Java Keywords

Control Structures

PPT Slide

PPT Slide

What can go wrong here?

Improved Version

if/else Syntax

PPT Slide

Conditional (Ternary) Operator ?:

What is the value of each expression?

Multi-alternative selection

Nested if statements

Multi-way branching

PPT Slide

Bad Example has output: FAIL

To correct the problem, use braces

Screen I/O

while Structure

Count-controlled loop

Count-controlled loop

Examples of kinds of loops

A Sentinel-controlled loop

Java application

PPT Slide

About Java Applications

Another Java application

PPT Slide

Pattern of a nested loop

To design a nested loop

Floating-point values

Expressions in Java

boolean Data Type

PPT Slide

PPT Slide

Applet Using while

Applet Using for

Example of Repetition

The output was:

PPT Slide

Switch Statement

PPT Slide

switch Structure

Control in switch Structure

Applet Using do/while

break Statement

continue Statement

Control Structures

PPT Slide

PPT Slide

PPT Slide

Short-Circuit Evaluation

Short-Circuit Example

More Short-Circuiting

What happens?

What happens?

Author: Sylvia Sorkin

Email: ssorkin@ccbc.cc.md.us

Home Page: http://www.essex.cc.md.us/Essex/people/ssorkin