CPS 6, Ramm - Spring 2000 - 2/7/00 #10
Chapt 5. Iteration with Programs and Classes
- Nested Loops
multable.cpp
nesting can be hidden by using function
- Scope of Variables
- definition
- braces { }
- Private Variables
- Global Variables (XXX)
- Class Example: Random Numbers & N-sided Dice
- Class:
dice
- Using dice
roll.cpp
- Class Diagram
- Public
- constructor
- member functions
- Private
- Constructors
- The Dice Interface
dice.h
"Declaration" not code (not Definition)
- Dice/While Example
roll300.cpp
"Validate by Inspection (???)"
- The Date Class
- Many constructors
- Look at header for interface
date.h
- Monday Blues
mondays.cpp