HOME

Introduction to Java Programming
Course Outline

 Conditionals

The Vic Class

  1. The Vic class simulates a CD changer.
  2. The changer has up to 4 rows of up to 8 slots each.
  3. The changer has a stack of CDs.
  4. Each new Vic object is assigned to a row of slots.
  5. Each row has a designated current slot.
  6. Creating a predictable number of rows/slots.
  7. Loading the stack.
  8. Vic documentation: see see class web site.
  9. Vic method: moveOn
  10. Vic method: backUp
  11. Vic method: takeCD
  12. Vic method: putCD
  13. Vic method: say
  14. Vic method: reset

Exercises

The SmartVic Class

  1. SmartVic method: moveTake
  2. SmartVic method: backPut
  3. Review: creating a subclass
  4. Review: class methods vs. instance methods.

Exercises

The If Statement

  1. Boolean values
  2. The boolean type
  3. Boolean methods
  4. if condition statement
  5. if condition { statements }
  6. Nested if statements
  7. Vic method: seesSlot
  8. Vic method: hasCD
  9. The Shifter subclass
  10. Testing the Shifter subclass

Exercises

Review and Practice

  1. Review: class methods vs. instance method
  2. Vic class method: stackHasCD

Exercises

If-Else Logic

  1. The block statement
  2. The else statement
  3. If-else ladders

Exercises

Boolean Variables

  1. The not operator
  2. Review: Boolean methods
  3. Using Boolean variables.

Exercises

Boolean Operators

  1. And (&&)
  2. Or (||)
  3. Expressions
  4. Expression evaluation
  5. Short-circuits

Exercises


Next: Variables and Loops

 

BACK TO TOP

 Last Updated:
 20-June-2008

Contact the instructor at: johnstraub1954@gmail.com