Continuing Java Basics - Intro to decisions

New Terminology

boolean data type
values of true/false only.  true and false are java keywords
boolean expression
An expression whose result is either true or false
relational operators
> < == != <= >=

Programming specific structures and terms

if statement; if else statement
A statement in java which provides branching or doing one of two alternative actions

Class notes

  1. Math class
    1. "static" methods
    2. require the use of the name of the class, Math
    3. cannot instantiate a "Math" object
    4. methods provide a number of different math functions.
  2. Conditionals - Conditions.ppt
  3. Uses of if:
    1. Validation
    2. Loop control (later)
    3. Error prevention
    4. Defensive coding - if anything can go wrong it will so plan for it.
    5. Selective operation
  4. Basic if statement AverageScore.java
  5. If else statement Chooser.java
  6. Reading char data. See Chooser.
  7. Block statements Division.java
  8. Nested ifs
  9. Documentation conventions