The Vic Class
-
The Vic class
simulates a CD changer.
-
The changer
has up to 4 rows
of up to 8 slots each.
-
The changer
has a stack of CDs.
-
Each new Vic object
is assigned to
a row of slots.
-
Each row
has a designated
current slot.
-
Creating
a predictable number
of rows/slots.
-
Loading the stack.
-
Vic documentation: see
see class web site.
-
Vic method: moveOn
-
Vic method: backUp
-
Vic method: takeCD
-
Vic method: putCD
-
Vic method: say
-
Vic method: reset
Exercises
The SmartVic Class
-
SmartVic method: moveTake
-
SmartVic method: backPut
-
Review: creating a subclass
-
Review: class methods vs. instance methods.
Exercises
The If Statement
-
Boolean values
-
The boolean type
-
Boolean methods
-
if condition statement
-
if condition { statements }
-
Nested if statements
-
Vic method: seesSlot
-
Vic method: hasCD
-
The Shifter subclass
-
Testing the Shifter subclass
Exercises
Review and Practice
-
Review: class methods vs. instance method
-
Vic class method: stackHasCD
Exercises
If-Else Logic
-
The block statement
-
The else statement
-
If-else ladders
Exercises
Boolean Variables
-
The not operator
-
Review: Boolean methods
-
Using Boolean variables.
Exercises
Boolean Operators
-
And (&&)
-
Or (||)
-
Expressions
-
Expression evaluation
-
Short-circuits
Exercises
Next:
Variables and Loops
|