Teachers' Guide to

Practical C++ Programming

Introduction

This book is designed to provide teaching materials to any instructor who wants to use Practical C++ Programming in his classroom. The materials contained in this book contains of a set of slides (for classroom presentation) and teachers' notes (which give hints on how the material might be presented.)

Practical C++ Programming is being used in a wide variety of classrooms, from the university campus to the industrial seminar. The slides are designed to support this wide usage. Instructors are encouraged to take the material and customize it for their own environment.

In addition to the slides there is a set of end of chapter questions so that you can you test your knowledge of the material presented.

The teachers' notes contains suggestions and tips on how to best present the information in the classroom. They also contain the answers for chapter questions. To get access to the Teachers' Notes, you'll have to register with O'Reilly education sales, here.

It is hoped that this Teachers' Guide will serve to help you build a effective and practical C++ Programming course.

Technical Information

The material for this book was produced using OpenOffice 1.1. The slides, chapter questions, and teachers' notes are available in both OpenOffice and PDF format.

Note: The material presented in this guide has not gone through the fine O'Reilly proofreading department. As a result you may find a few typeo's in the text. Also although OpenOffice is a fairly stable product, the slides do stress the program. As a result sometimes the OpenOffice presenter likes to center code which should be left justified. I think I caught all of them, but sometimes the software surprises me. So please check the material before presenting it.

Teaching Material

Slides

A set of lecture slides. They are written in OpenOffice Presenter format but we have also provided copies in Adobe PDF format as well.

There is one file for each chapter of the book. You can use the links below to get a large archive contining the entire slide set. Individual chapters are avalaible through the links in the "Table of Contents" section below.

OpenOffice format, Zipped
PDF format, Zipped
OpenOffice format, tar/gz file
PDF format, tar/gz file

Chapter Quizes

This section quizes for each chapter.

OpenOffice format
PDF format
HTML format

Teacher's Guide

The teacher's guide contains notes on how to present the material as well as the answers to the chapter quizes.

OpenOffice format
PDF format

The slides, broken into individual chapters

Chapter 1, What Is C++?, gives you an overview of C++, describes its history and uses, and explains how the language is organized.
Slides: OpenOffice Format   PDF

Chapter 2, The Basics of Program Writing, explains the basic programming process and gives you enough information to write a very simple program.
Slides: OpenOffice Format   PDF

Chapter 3, Style, discusses programming style. How to comment a program is covered, as well as how to write clear and simple code.
Slides: OpenOffice Format   PDF

Chapter 4, Basic Declarations and Expressions, introduces simple C++ statements. Basic variables and the assignment statement are covered in detail along with the arithmetic operators: +, -, *, /, and %.
Slides: OpenOffice Format   PDF

Chapter 5, Arrays, Qualifiers, and Reading Numbers, covers arrays and more complex variables. The shorthand operators ++, --, *=, =, +=, -=, /= and %= are described.
Slides: OpenOffice Format   PDF

Chapter 6, Decision and Control Statements, explains simple decision statements including if, else and for. The problem of == versus = is discussed.
Slides: OpenOffice Format   PDF

Chapter 7, The Programming Process, takes you through the steps required for creating a simple program, from specification through release. Fast prototyping, and debugging are discussed.
Slides: OpenOffice Format   PDF

Chapter 8, More Control Statements, describes additional control statements. Included are while, break, and continue. The switch statement is discussed in detail.
Slides: OpenOffice Format   PDF

Chapter 9, Variable Scope and Functions, introduces local variables, namespaces, functions, and parameters.
Slides: OpenOffice Format   PDF

Chapter 10, The C++ Preprocessor, describes the C++ preprocessor, which gives you great flexibility in creating code. It also provides a tremendous number of ways for you to screw up. Simple rules that help keep the preprocessor from becoming a problem are described.
Slides: OpenOffice Format   PDF

Chapter 11, Bit Operations, discusses the logical C++ operators that work on bits.
Slides: OpenOffice Format   PDF

Chapter 12, Advanced Types, explains structures and other advanced types. The sizeof operator and the enum type are included.
Slides: OpenOffice Format   PDF

Chapter 13, Simple Classes, introduces the concept of a class. This is one of the more powerful features of C++. Classes allow you to group data and the operations that can be performed on that data into one object.
Slides: OpenOffice Format   PDF

Chapter 14, More on Classes, describes additional operations that can be performed with classes.
Slides: OpenOffice Format   PDF

Chapter 15, Simple Pointers, introduces C++ pointer variables and shows some of their uses.
Slides: OpenOffice Format   PDF

Chapter 16, File Input/Output, describes both buffered and unbuffered input/output (I/O). ASCII and binary files are discussed and you are shown how to construct a simple file. Old C-style I/O operations are also included.
Slides: OpenOffice Format   PDF

Chapter 17, Debugging and Optimization, describes how to debug a program, as well as how to use an interactive debugger. You are shown not only how to debug a program, but also how to write a program so that it is easy to debug. This chapter also describes many optimization techniques to make your programs run faster and more efficiently.
Slides: OpenOffice Format   PDF

Chapter 18, Operator Overloading, explains that C++ allows you to extend the language by defining additional meanings for the language’s operators. In this chapter, you create a complex type and the operators that work on it.
Slides: OpenOffice Format   PDF

Chapter 19, Floating Point, uses a simple decimal floating-point format to introduce the problems inherent in using floating points, such as roundoff errors, precision loss, overflow, and underflow.
Slides: OpenOffice Format   PDF

Chapter 20, Advanced Pointers, describes advanced use of pointers to construct dynamic structures such as linked lists and trees.
Slides: OpenOffice Format   PDF

Chapter 21, Advanced Classes, shows how to build complex, derived classes out of simple, base ones.

Finally a number of miscellaneous features are described in V: Other Language Features.
Slides: OpenOffice Format   PDF

Chapter 22, Exceptions, explains how to handle unexpected conditions within a program.
Slides: OpenOffice Format   PDF

Chapter 23, Modular Programming, shows how to split a program into several files and use modular programming techniques. The make utility is explained in more detail.
Slides: OpenOffice Format   PDF

Chapter 24, Templates, allows you to define a generic function or class that generates a family of functions.
Slides: OpenOffice Format   PDF

Chapter 25, Standard Template Library describes the template library that comes with C++. This library consists of a number of “container templates” and related data structures which let you create very complex and robust data structures with very little work.
Slides: OpenOffice Format   PDF

Chapter 25-extra, Portability Problems, describes the problems that can occur when porting a program (moving a program from one machine to another).
Slides: OpenOffice Format   PDF

Chapter 26, Program Design, discusses some of the methodologies used to design programs, such as structured programming and object oriented design. Not only are the design methods discussed, but also the reasoning that went into the design of the design.
Slides: OpenOffice Format   PDF

Chapter 27, Putting It All Together, details the steps necessary to take a complex program from conception to completion. Information hiding and modular programming techniques, as well as object-oriented programming, are stressed.
Slides: OpenOffice Format   PDF

Chapter 28, From C to C++, describes how to turn C code into C++ code, and addresses many of the traps lurking in C code that bite the C++ programmer.
Slides: OpenOffice Format   PDF

Chapter 29, C++’s Dustier Corners, describes the do/while statement, the comma operator, and the ?: operators.
Slides: OpenOffice Format   PDF

Chapter 30, Programming Adages, lists programming adages that will help you construct good C++ programs.
Slides: OpenOffice Format   PDF

Supplement: From C to C++. This section contains material for teaching C++ to C programmers. It highlights the differences between C and C++. It quickly covers the new C++ stuff presented in Chapter 1 through 12.
Slides: OpenOffice Format   PDF