In-Class Examples for CISC-2000-E01

  1. Linux commands for use on our Fedora Linux server storm.cis.fordham.edu.
    1. Basic commands
    2. Shellscript to compile a C++ program
  2. Review of CISC-1600. This is what we assume you already know.
  3. Memory addresses and pointers
    1. Binary (base 2) and hexadecimal (base 16) notation for an integer or a memory address. A memory address is usually written in hexadecimal.
    2. A pointer is a variable that contains the address of another variable. The value of a pointer is therefore usually written in hexadecimal.
  4. Dynamic memory allocation with the operators new and delete[].
    1. Allocate a block of memory to hold an array with an unpredictable number of elements.
    2. Throw and catch an exception when something goes wrong.
    3. We can often use a vector instead of making a pair of direct calls to new and delete[].
  5. Preprocessor implements directives such as
    1. #include
    2. #define
    3. #ifdef/#endif and #ifndef/#endif for conditional compilation.
    We will need these directives when writing a header (.h) file for a class or a template.
  6. Classes of objects.
    1. The components of a class
      1. data members vs. member functions
      2. public members vs. private members
      3. constructors vs. destructor. (A class might have more than one constructor, but it can have only at most one destructor.)
      4. header (.h) file vs. implementation (.C) file
      5. miscellaneous features: static data members, static member functions, friend functions
    2. Now that the data members are private, we can re-implement a class (class date) in different ways without disturbing the rest of the program.
      1. Class date with two non-static data members
      2. Class date with one non-static data member
    3. Member functions vs. friend functions: two ways to give a function acces sto the private members of a class.
    4. Use an object to trigger a pair of events: class announcer.
    5. More examples of classes: class point, class stack, class myrandom.
  7. Midterm.
    1. The big ideas of CISC-2000: a midterm review.
    2. The midterm itself.
  8. Prerequisites for operator overloading. Small, miscellaneous topics that we will need.
  9. Operator Overloading.
    1. For convenience, we’ll implement the output operator << first.
    2. Operators that change the value of an existing object: +=, prefix ++.
    3. Operators that construct and return a new object: binary +, postfix ++.
    4. Operators that use the value of a two existing objects are implemented as friends: binary -, ==. <.
    5. The input operator >>.
    6. The difference between a copy constructor (simple) vs. an operator= (complicated).
    7. An operator for an object that contains a series of values: []
    8. An operator for an object that does only one job: ()
  10. Inheritance and polymorphism. Inherit the Wind.
    1. Single inheritance and polymorphism with virtual member functions
    2. Abstract base classes and pure virtual functions
    3. Multiple inheritance and virtual base classes
    4. Public inheritance vs. private inheritance
  11. Gateways and CGI programming
  12. Templates.
    1. Template functions
    2. Template classes
    3. Container classes: vector, list, map.
    4. Hide the name of a template class with the using keyword.
  13. Final examination