CPS 6, Ramm - Spring 2000 - 2/11/00 #11
- Announce
- Quiz Today
- Hour Test on Wednesday
Chapt 5. Iteration with Programs and Classes
- The Date Class
- Many constructors
- Look at header for interface
date.h
- Monday Blues
mondays.cpp
- Infinite Loops
- Make up Practical Program with Infinite Loop
Chap 6. Classes, Iterators, & Patterns
- Class Overview
- The Interface: .h File
- Just including a prototype for functions
- Documentation
- Information Hiding
- Private ( my______ ) Variables
- Private member functions
- Implementation: .cpp File
- Dice Implementation
dice.cpp
- Constructor (initialization)
- Member Functions
- State
- Scope of Private Variables
- Global within class
- Avoid arguments/parameters within class
- Not accessible (out of scope) on outside
- Reference Parameters vs Value Parameters
- Reference: Arguments NOT copied
- Value: Arguments are copied)