CIS 3142
Programming Paradigms in C++
Exam #2 Topic List
The Structure of the Exam
- Questions will for the most part consist of reading and writing code
- There may also be some multiple-choice and short answer questions.
- While the book is a good supplement, you are only responsible for topics and material in the lecture notes and
the labs / projects. These are a great way for you to prepare yourself for the exam.
The exam is cumulative, but focuses on Lectures 7-9. Here is a detailed breakdown of the topics
Classes
- constructors
- member initialization lists
- data members
- member functions
- member functions with constant receivers
- inline functions (both within the class declaration, and outside of it, using the
inline
keyword)
- non-member friend functions
- placing function bodies (definitions) in the .cpp file
- the scope resolution operator (
::
)
Operator Overloading
- member and non-member
- arithmetic (including increment/decrement), compound assignment, relational, and insertion/extraction operators
- which operators are best defined as members, and which as non-members
- maintaining semantic consistency of simple and compound operators (e.g.,
+
and +=
)
Canonical form
- when and why its needed
- the required functions: copy constructor, destructor, assignment operator
- extended canonical form: default constructor, equality operator, insertion/extraction operators
- the difference between copy constructor and assignment operator
You will NOT have to write any copy constructors or assignment operators for this exam (that'll come on the final); but you
may have to read and answer questions on such code
Miscellaneous
- default parameters
- basic exception handling — along the lines of what we did in class (in the
Pair
class), and
what you used for Lab 06
- at this point, you should have a stronger understanding of separate compilation, in particular the roles of header (.h)
and implementation/source (.cpp); and the use of
#include
and include guards