- Course Introduction
In this course, we will learn the mechanics of editing and compiling programs in C++. We will begin with a discussion of the essential elements of C++ programming: variables, loops, expressions, functions, and string class. Then, we will cover the basics of object-oriented programming: classes, inheritance, templates, exceptions, and file manipulation. We will then review function and class templates and the classes that perform output and input of characters to/from files. This course will also cover namespaces, exception handling, and preprocessor directives. In the last part of the course, we will learn some slightly more sophisticated programming techniques that deal with data structures such as linked lists and binary trees.
- Unit 1: Introduction and Setup
This unit presents a brief history of C++ before addressing the mechanics of editing and compiling a simple program written in C++ using the Eclipse IDE (integrated development environment). We will focus on learning how to write a general format for a C++ program, the meaning of main() function, how to use the cout and cin objects, how to declare and use variables, and how to define simple functions.
Completing this unit should take you approximately 15 hours.
- 1.1: History of C++: Origins and Examples
- 1.2: How to Compile and Run a C++ Program
- 1.2.1: The Linux Way
- 1.2.2: Other Ways with Eclipse
- 126.96.36.199: Eclipse CDT Download
- 188.8.131.52: C/C++ Projects Quick Start Tutorial for Eclipse CDT
- 1.3: Basics of C++
- 1.3.1: Introduction to C++
- 1.3.2: Variables, Data Types, and Constants
- 1.3.3: Basic Input and Output
- 1.3.4: Control Structures
- 1.3.5: Simple Functions
- 184.108.40.206: Scope of Variables in a Function
- 220.127.116.11: Arguments Passed by Value and by Reference
- 1.4: C++ Reference
- 1.5: C++ Header Files
- Unit 1 Excercises
- Topic 20
- Unit 2: Dealing with Data and Compound Types
In this unit, we will begin to use variables and constants. We will practice with an array, which is a series of elements of the same type placed in contiguous memory locations. Next, we will learn how to use sequences of characters, which can form strings. We will also discuss how the memory of a computer can be understood as a succession of memory cells that can be accessed through the pointer in order to better control program instructions. This unit also covers data structures, which are groups of data elements grouped together under one name. At the end of the unit, we will study the C++ string class, which is useful when handling and manipulating strings of characters.
Completing this unit should take you approximately 14 hours.
- 2.1: Arithmetic Operators
- 2.2: Basic Data Structures
- 2.2.1: Arrays and Strings
- 2.2.2: Pointers
- 2.2.3: Struct, Unions, and Enumerations
- Unit 2 Exercises
- Topic 28
- Unit 3: Object-Oriented Programming
In this unit, you will learn how to design a class, which is an expanded concept of a data structure that can hold both data and functions. An object is an instantiation of a class, so a class would be the type, and an object would be the variable. Next, we will learn how to handle private and protected members of a class, which is important for sound class design.
Note that this unit covers a key feature of C++ classes: inheritance. Inheritance allows classes to inherit objects and functions from other classes. In this unit, we will learn how classes can inherit members from more than one class. We will end this unit with the study of polymorphism or the ability to create a variable, a function, or an object that has more than one form. This brings object-oriented methodologies to their full potential.
Completing this unit should take you approximately 26 hours.
- 3.1: Class Design
- 3.2: Inheritance between Classes
- 3.3: Polymorphism
- Unit 3 Exercises
- Topic 34
- Unit 4: Advanced Concepts
This unit begins with a review of function and class templates, which make programs adaptable. We will then learn how to manipulate files. C++ provides the classes that can perform output and input of characters to/from files.
This unit will also cover namespaces, which group entities like classes, objects, and functions under a name. We will finish the unit with exception handling and preprocessor directives. Exceptions handle exceptional circumstances in our programs by transferring control to special functions called handlers. At the end of the unit, we will discuss the preprocessor directives, lines included in the code of a program that are not program statements but directives for the preprocessor.
Completing this unit should take you approximately 14 hours.
- 4.1: Templates
- 4.2: Input/Output with Files
- 4.3: Namespaces
- 4.4: Recursion
- 4.5: Exceptions
- 4.6: Preprocessor Directives
- Unit 4 Exercises
- Topic 43
- Unit 5: Memory Management and Testing
In this unit, we will work on memory management and debugging methods. The unit begins with an introduction on general techniques in C++ program memory management. We will then learn how to design testing cases to cover the program under testing and learn commonly used techniques for debugging C++ programs.
Completing this unit should take you approximately 17 hours.
- 5.1: Memory Management
- 5.2: Testing and Debugging
- Topic 47
- Unit 6: Useful Examples and C++ Glossary
In this unit, we will work on coding skills using two useful data structures: linked list and binary tree. The first assessment you will encounter below will teach you to program the binary tree. The second assessment will ask you to be creative with coding linked lists and binary trees.
Completing this unit should take you approximately 25 hours.
- 6.1: Binary Trees
- 6.2: Coding Drill: List of Binary Trees
- 6.3: Containers
- 6.4: Vectors
- 6.5: C++ Glossary
- Topic 54
- Study Guides and Review Exercises
These study guides are intended to help reinforce key concepts in each unit in preparation for the final exam. Each unit study guide aligns with course outcomes and provides a summary of the core competencies and a list of vocabulary terms. The study guides are not meant to replace the readings and videos that make up the course.
The vocabulary lists include some terms that might help you answer some of the review items, and some terms you should be familiar with to be successful in completing the final exam for the course.