CPS 6.3,4 Ramm - Fall 2000 - 10/9/00 #17
- Announce
- Exams ...
- Getting Help
- Quiz Friday
- Midterm Grades due Friday
Chap 6. Classes, Iterators, & Patterns
- Iteration: Counting Words Using While Loop (review)
wordcount.cpp
- Iteration: Counting Words Using WordStreamIterator Class
wordstit.cpp
worditer.h
- Many Classes that Provide Information ar Iterator Classes
- Type Casting (coercion)
- Change one type to another
- Only defined where it makes sense
- Several different forms exist
- E.g., changing int to double
- double(n)
- (double) n
- Using Reference Parameters
-
stats3.cpp
-
stats4.cpp
- Text Processing Example
- Design Issues
- Moving Functionality to Functions
- Use of Reference Parameters
-
format.cpp
-
formatwatch.cpp
- More Reference Parameters (tricky)
-
ref.cpp
Chap 7. Class Interfaces, Design, and Implementation
- Switch Statement
- switch ( expression )
- {
- case constant1:
- statement list;
- break;
- case constant2:
- statement list;
- break;
- ...
- default:
- statement list;
- }
- Example Using the Switch Statement