Chapter Four - Control Statements: Part 1
This chapter teaches us many of the ways to control the
flow of execution in a Java program. We cover the
following.
- Algorithms and pseudocode
- Sequential execution (what we’ve already seen).
- Selection statements.
- if (single selection)
- if...else (double selection)
- (? :) (special terniary conditional
operator)
- switch (multiple selection –
covered in Chapter 4)
- Repetition statements.
- while (sentinal repetion)
- for (counter controlled repetion –
covered in Chapter 4)
- do...while (sentinal repetion) –
covered in Chapter 4)
- Unary cast and promoting
- Nesting of control statements
- Compound assignments (not used so much)
- Unary increment and decrement (used all the time)
- Drawing lines in Dialog boxes (a little more GUI).
Chapter Five - Control Statements: Part 2
This chapter covers the remaining control statements not
covered in Chapter 4.
- The remaining repetition statements.
- for (counter controlled repetion)
- do...while (sentinal repetion)
- The remaining selection statement.
- switch (multiple selection)
- Formatting floating point values
- break and continue
- logical operators and short circuiting
- Drawing shapes (a little more GUI).
Exercises
In order to reinforce the principles you’ve learned
in these chapters, I’m asking you to do the following
programming exercises. Neither of them require any knowledge
of Java beyond what was covered in the first five chapters.