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
- 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 in the sense of you writing code in C++, but focuses on the material covered since the last exam, and in particular
will concentrate on Labs 4-7, i.e., asking you to write code either directly or very similar to those programs.
Parameter and Return-Value Transmission
- parameter and return value transmission: by-value, -reference, -const-reference
- why and when to use which method
Separate Compilation
- Class definition .h/.cpp files
- C-style module .h/.cpp files
- include guards /
#pragma once
- who needs what
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
- which operators are best defined as members, and which as non-members
- arithmetic (e.g.
+
), compound assignment (e.g. +=
), relational (e.g. ==
), and insertion/extraction operators (<<, >>
)
- You should know the proper signatures for them as well
- maintaining semantic consistency of simple and compound operators (e.g.,
+
and +=
)
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
- simple function and class templates