This page last updated on: Mar. 18, 2002
This Web page contains lecture note outlines for my Introduction to C++ course. The primary source of reading is the textbook by Bruce Eckel. Note that some chapters are from the free online version of the 2nd volume (not yet published in book form). Other sources of information include the C++ Report magazine, various C++ newsgroups (in particular comp.std.c++), and my personal experience. These notes are dynamic and will be updated periodically (typically once per week) throughout the quarter.
| Lecture |
Date |
Topic(s) |
Reading (either reinforces topics from current lecture or applies to the next week) |
Assignment Due |
| 01 |
Jan. 7 |
Intro, Review of OO Concepts, Class and Object Basics |
Preface, chap 1 (Intro to Objects), chap 2 (Making and Using Objects), chap 3 (The C in C++, which should mostly be review) |
|
| 02 |
Jan. 14 |
Moving from C to C++, Class Syntax, Object Initialization |
Chap 7 (Function Overloading and Default Args), chap 8 (Constants), chap 11
(References and the Copy Ctor) |
|
| 03 |
Jan. 28 |
Class Members |
Chap 12 (Operator Overloading), chap 6 (Initialization and Cleanup) |
01 |
| 04 |
Feb. 4 |
Operator Overloading, Strings, L and R-values, Common "Gotchas" (Copy Ctor, Assign Op, Dtor) |
Iostreams and Strings chapters from Vol 2 (online book), chap 4 (Data Abstraction, skim), chap 5 (Hiding the Implementation, skim) |
02 |
| 05 |
Feb. 11 |
C++ Streams, Reading Complex Declarations |
Chap 14 (Inheritance and Composition), chap 13 (Dynamic Object Creation - skip sections on overloading new / delete operators) |
|
| 06 |
Feb. 25 |
Intro to the STL (subset of Standard Library) |
Chap 16 (Intro to Templates), STL Containers and Iterators chapter from Vol 2 (online book) |
03 |
| 07 |
Mar. 4 |
Inheritance |
Chap 15 (Polymorphism and Virtual Functions, sections on V-tables and virtual fct implementations can be skimmed) |
|
| 08 |
Mar. 11 |
Polymorphism, Templates |
Chap 10 (Name Control), Exception Handling and Run-time Type Id chapters from Vol 2 (online book) |
04 |
| 09 |
Mar. 18 |
Special Topics (new style casts, RTTI, namespaces, mutable, volatile), Review, Catch-up (as needed) |
Chap 9 (Inline Functions), review other chapters as needed |
|
| 10 |
Mar. 25 |
Final Examination, Misc Topics |
05 |
The middle three assignments comprise a small course project, as described here.
This utility will be composed of many pieces, and will be developed as a "ground-up" design. In other words, the building block C++ classes will be designed, coded, and tested before the final main function is written. There will be related utility programs written as necessary, and test programs will be written to exercise and debug the various classes.
Besides developing C++ classes as part of the project, pre-written C++ classes and functions will be used. This will serve to gain familiarity with using classes, and to show the productivity gains that can be realized by using C++.
While attention will be paid to simple spell checker functionality, the primary emphasis will be on C++ programming, internal programming techniques, software development issues, and performance. Standard C and C++ library functions and classes will be used whenever possible (containers, sorting and searching, for example).
spellchk DocFile MainDictFile LocalDictFile
The document file is required, while the main and local dictionary files are optional (use a default file name of defdict.txt for the main dictionary file if not specified). The class project version will simply display unrecognized words, along with words that sound similar (using Soundex codes), while enhanced versions (if a student wished to enhance the application) could replace words in the document file and optionally add words to a local dictionary file. An appropriate help option is a useful enhancement for the user.
All comparisons, sorting and searching will be case-insensitive - this spell checker utility will not distinguish between upper case, lower case, beginning words of sentences, or proper nouns.
If the dictionary words were stored sequentially inside the spell check program, word lookups would take on average N/2 compares, where N is the number of words. Therefore the dictionary words will be internally stored in a container (such as a sorted array) of Word objects (alternate implementations, such as hash tables, will be discussed). This provides much more efficient searching - hash tables lookups can be performed directly with the tradeoff of taking more space, while sorted array lookups can be performed in log N time, with efficient space usage.
The local dictionary (if specified) will be searched before the main dictionary.
Additional requirements, internal details, and implementation techniques will be discussed in each particular assignment.