CIS 3142
Programming Paradigms in C++
Exam #1 Topic List
The Structure of the Exam
- Questions will consist of reading and writing code, as well as possibly some multiple-choice / 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. These are a great way for you to prepare yourself for the exam.
The exam covers the Lectures starting with Introduction & Review through Chapter 3 — including the associated supplementary topics listed on the Class Calendar, e.g. Templates, Parameter Transmission, etc. —
and Labs 1-3 (including Lab 3.1). Below is a detailed breakdown of the topics
Introduction and Sample Programs
- C++ program structure
#include
- function headers
using namespace
- You should be able to write code using all the language features presented in the Sample C++ Programs
- In particular:
- basic console (
cout
/cin
) I/O
- file I/O
- checking for successful file open and read
- fixed sized arrays
- In addition, you should be able to code using any other language features the two languages have in common
Preliminaries
- C++ Software Development
- source, object executable files
- compilation, linking, execution
- vs. Java development
- Scope
- class scope, function scope, global scope
- Lifetime
- fundamental, compound, and user-defined types
- lvalue / rvalue
- call-by-value / call-by-reference
- Value vs Reference Semantics
- copies vs aliases
- copy constructor and copy method
- Generics
- Java: using, type erasure
- C++ : templates, instantiation, code bloat
- Polymorphism
- Mutable vs Immutable
- Leveraging functionality to reduce redundancy and maintain semantic consistency
- Variable initialization: local, instance, class; in the presence of inheritance and composition
Chapter 1
- procedural programming
- data abstraction
- object-oriented programming
- generic programming
- static vs dynamic type checking
- abstraction
Chapter 2
- fundamental types
- pointers: declaring, using, dereferencing, passing to functions, address-of operator,
->
- arrays: fixed size, declaring, using, passing to functions
- references: declaring, passing to functions (call-by-reference)
- user-defined types
- modularity
- exception handling
Chapter 3
- basic understanding of a concrete class, abstract class, and a (concrete) class in the context of a hierarchy
- member initialization lists
Templates
- Simple class and function template definitions and instantiation
- Where to put template definitions
The Labs
- As mentioned above, you should be able to code using any of the concepts covered in the lab programs. This includes:
- All C++ language features covered in Lab 1 (Sample Programs) and 3 (simple classes and templates)
- The Java material covered in the Preliminaries and Lab 1 (The Java Rational class)
- be prepared to code some of the methods of that class, in particular using the leveraging technique (i.e.,
writing
add
assuming addInPlace
was available
- be able to write a copy constructor and/or copy method in Java (not necessarily for the
Rational
class)