COP-4338, Programming III Lectures
Note: Links will not be alive until a day or two before class.
- Jan 9 and 11: Class is cancelled due to instructor emergency.
- Jan 16, 23, and 25: Guest lecture by Kip Irvine
-
Basic setup of a C++ program; data types, assignment and implicit promotion,
three forms of the cast operator, compiling and linking. Introduction to
C++; review of basic data types,
stream I/O with << and >> operators,
getline method, const and reference parameters, string class, concatenating
strings, function overloading, cin.ignore and getline functions. Creating
external modules with header files and #include statements. Concatenating
strings. File I/O with the ifstream and ofstream classes.
- Jan 30: Pointer Variables
- Feb 1, 6, 8, 13, 15: Classes
- Classes: interfaces, member functions, visibility
- Accessor/Mutator
- Const and non-const methods
- Constructors
- Initializer lists
- Implicit type conversions
- Explicit constructors
- Default parameters
- The big three: destructor, operator= and copy constructor
- *this
- Aliasing and this
- Separation of interface and implementation
- Scope :: operator
- ifndef/endif and separate compilation
- Static members
- Operator overloading
- Friends
- Constant and reference data member
- Linked data structures
- Reference return types and operator[]
- Example: The String class (Sample code from class)
- Feb 20, 22: Inheritance
- Implementing a derived class
- Constructors
- Defaults for the Big Three in the derived class
- Protected members
- Slicing
- Static vs. dynamic binding
- virtual keyword
- The virtual destructor
- Various C++ differences from Java
- Feb 27 and Mar 6: Templates
- Why templates
- Function templates
- Class templates: interface
- Illustration of the MemoryCell class
- Specifying the requirements of the template type
- Class templates: implementation
- Separate compilation issues
- Function Objects
- Exceptions
- Reference return types
- matrix
- Mar 1: Exam #1 Covers Basic C++ and C++ classes only
- Mar 8 and 13: STL
- Solution to Assignment #4
- STL Basic ideas
- Iterators
- Lists vs Vectors
- The Pair pattern
- Sets and maps
- STL algorithms
- String streams
- Mar 15 and 27: C Programming Issues
- Mar 20, 22: Spring Break
- Mar 29: Exam #2 Covers C++ Classes, inheritance, templates, and STL
- April 3, 5, and 10: Threads and Synchronization
- PDF slides
- Examples:
- Illustrates basics of getting threads to run:
ThreadDemo.java
- Illustrates threads corrupting data:
NoSync.java
- Series of examples using an Account.
Some threads do deposits, some do withdraws on shared account.
- Two examples with multiple monitors
- Static methods have different monitors than instance methods:
StaticsAndThreads.java
- April 12 and 17: Networking
- April 19: Threading and Networking Review and Review for Exam
- April 26 10:15 AM: Exam #3 Covers C++ and Threading and Networking