Upon successful completion of this course, students will be able to:
In order to take this course you must:
√ Have access to a computer. Have continuous broadband Internet access.
√ Have the ability/permission to install plug-ins or software (e.g., Adobe Reader, Flash, compilers).
√ Have the ability to download and save files and documents to a computer.
√ Have the ability to open Microsoft files and documents (.doc, .ppt, .xls, etc.).
√ Be competent in the English language.
√ Have read the Saylor Student Handbook.
√ Have completed CS101: Introduction to Computer Science I and CS102: Introduction to Computer Science II.
Welcome to CS107. General information on the course and its requirements can be found below.
Course Designer: Dr. Yongge Wang
Primary Resources: This course is composed of a range of different free, online materials. However, the course makes primary use of the following resources:
This unit presents a brief history of C++ before addressing the mechanics of editing and compiling a simple program written in C++ using a Linux-flavored operating system and a NetBeans 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.
Unit 1 Time AdvisoryLink: www.cplusplus.com: “History of C++” (HTML)
Instructions: Read the webpage to learn about the history of C++. Please take notes as you read. In particular, pay attention to:
Link: wikiHow’s “How to Compile a C/C++ Program” (HTML)
Instructions: Read this article on how to compile and run a C++ program. Even though you do not yet understand the C++ language, you can follow the operational steps to compile a program from C++ to machine code.
Reading this webpage and taking notes should take approximately 30 minutes.
Terms of Use: Please respect the copyright and terms of use displayed on the webpage above.
Link: NetBeans’ “NetBeans IDE Download” (HTML)
Instructions: Download a version of NetBeans that will work on the computer you use. NetBeans is an integrated development environment for developing with Java, JavaScript, PHP, Python, Ruby, Groovy, C, C++, Scala, Clojure, and others. It is written in Java and can run anywhere a JVM is installed, including Windows, Mac OS, Linux, and Solaris. Read the instruction manual in the next resource box to learn how to install it.
Completing this process and taking notes should take approximately 45 minutes.
Terms of Use: Please respect the copyright and terms of use displayed on the webpage above.
Link: NetBeans’ “NetBeans Installation Instructions” (HTML)
Instructions: Please read this document, which explains how to install NetBeans IDE on your system.
Completing this process and taking notes should take approximately 15 minutes.
Terms of Use: Please respect the copyright and terms of use displayed on the webpage above.
Link: NetBeans’ “C/C++ Projects Quick Start Tutorial” (HTML)
Instructions: Read this short tutorial, which takes you through the basic steps of creating and configuring a C or C++ project in NetBeans. Even though you do not know the C++ language yet, follow the operational steps to set up a project written in C++ language.
Completing this process and taking notes should take approximately 30 minutes.
Terms of Use: Please respect the copyright and terms of use displayed on the web page above.
Link: www.cplusplus.com: Juan Soulie’s “Variables and Data Types” (HTML) and “Constants” (HTML)
Instructions: First, read the article about the variables and data types. Make sure you memorize how many bits each fundamental data type requires. You should also be able to declare a variable and identify its scope, as well as differentiate between strings and fundamental data types. Compile the example code from the site for practice. Then read the article about constants. Be sure you understand how to declare and differentiate between constants and non-constants.
Reading this webpage and taking notes should take approximately 1 hour.
Terms of Use: Please respect the copyright and terms of use displayed on the webpage above.
Link: www.cplusplus.com: Juan Soulie’s “Basic Input and Output” (HTML)
Instructions: Read this entry to learn about basic input and output methods in C++ programming. Compile the simple examples given and make sure you understand what the code in each line does.
Reading this webpage and taking notes should take approximately 1 hour.
Terms of Use: Please respect the copyright and terms of use displayed on the webpage above.
Link: MIT: John Marrero’s “Flow of Control” (PDF)
Instructions: Please read the Lecture 2 Notes, “Flow of Control,” to learn about control structures in C++ programming. Compile the simple examples given and make sure you understand the code in each line. After reading these notes, you should be able to define conditional structures, iteration structures, and jump statements.
Reading this webpage and taking notes should take approximately 1 hour.
Terms of Use: Please respect the copyright and terms of use displayed on the webpage above.
Link: www.cplusplus.com: Juan Soulie’s “Functions (I)” (HTML)
Instructions: Read the webpage to learn how to write functions in C++. Compile the simple examples given and make sure you understand the code in each line, as well as the scope of the variables declared in the code.
Reading this webpage and taking notes should take approximately 1 hour.
Terms of Use: Please respect the copyright and terms of use displayed on the web page above.
Link: www.cplusplus.com: Juan Soulie’s “Functions (II)” (HTML)
Instructions: Read this entry to learn the differences between functions that have arguments passed by value and those that have arguments passed by reference. Be sure that you understand what “recursion” means. Also compile the simple examples provided and make sure you understand the code in each line.
Reading this webpage and taking notes should take approximately 1 hour.
Terms of Use: Please respect the copyright and terms of use displayed on the webpage above.
Link: Google Code’s: “C++ Class: Problem Set 1” (HTML)
Instructions: By clicking on the link above, you will access six quizzes in Problem Set 1. After finishing the quizzes, you can click on the “answers” link to check solutions.
Completing these quizzes should take approximately 30 minutes.
Termof Use: Please respect the copyright and terms of use displayed on the webpage above.
Link: cppreference.com’s “C++ Reference” (HTML)
Instructions: Read through the webpage to learn about standard C++ libraries, which are collections of functions, constants, classes, objects, and templates that extend the C++ language. These are the codes that a good programmer will use when designing a new program.
Reading this webpage and taking notes should take approximately 1 hour.
Terms of Use: Please respect the copyright and terms of use displayed on the webpage above.
Link: LearnCPP.com: “Header Files” (HTML)
Instructions: Read through this webpage to learn how to declare functions in the header file. Optionally, as an exercise you may wish to type some of the examples into files and then compile and run them.
Reading this webpage should take approximately 30 minutes.
Terms of Use: Please respect the copyright and terms of use displayed on the webpage above.
Link: KeithSchwarz.com’s “Problem Set 0” (HTML)
Instructions: The link above will take you toKeithSchwarz’s Standard C++ Programming Laboratory. In the Handouts section, you will find the following handouts:
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.
Unit 2 Time Advisory
This unit should take approximately 14 hours to complete.
☐ Subunit 2.1: 2 hours
☐ Subunit 2.2: 5.5 hours
☐ Subunit 2.3: 6.5 hours*
*This large advisory is due to the lengthy and involved assignment in Subunit 2.3. You may be able to complete this assignment in less time than is allotted here.
Link: www.cplusplus.com: Juan Soulie’s “Operators” (HTML)
Instructions: Read this webpage to learn how to use mathematical operators in C++. You should know arithmetic, relational, equality, logical, conditional, bitwise, and explicit type casting operators. Compile the code in the examples given. Please pay attention to the rules about the precedence of operators.
Reading this webpage and taking notes should take approximately 2 hours.
Terms of Use: Please respect the copyright and terms of use displayed on the web page above.
Link: www.cplusplus.com: Juan Soulie’s “Arrays” (HTML) and “Character Sequences” (HTML)
Instructions: Read the first webpage to learn about arrays and how they are used in C++. Then read the second page to learn about characters and null-terminated character sequences. Compile the code in the examples given. As you read, pay special attention to the differences and similarities of array and character sequences. Afterwards, you should know how to use both array and character sequences to denote text strings.
Reading this webpage and taking notes should take approximately 1 hour.
Terms of Use: Please respect the copyright and terms of use displayed on the webpage above.
Link: www.cplusplus.com: Juan Soulie’s “Pointers” (HTML)
Instructions: Read this webpage about pointers. You should know what reference and dereference operators are and how to use them. You should also be able to declare variables of pointer types, explain how pointers work with arrays, and understand basic pointer arithmetic. Compile the code in the examples given.
Reading this webpage and taking notes should take approximately 2 hours.
Terms of Use: Please respect the copyright and terms of use displayed on the webpage above.
Link: www.cplusplus.com: Juan Soulie’s “Data Structures” (HTML) and “Other Data Types” (HTML)
Instructions: Read the linked material to learn about three data structures: struct, union, and enumeration. Compile the code in the examples given.
Reading these webpages should take approximately 2 hours.
Terms of Use: Please respect the copyright and terms of use displayed on the webpage above.
Link: Google Code’s “Google’s C++ Class: Problem Sets 2 and 3” (HTML)
Instructions: Click the link above to access the quizzes in Problem Sets 2 and 3. After finishing the quizzes, you can click the “answers” link to check your answers against the solutions.
Completing these problem sets should take approximately 30 minutes.
Terms of Use: Please respect the copyright and terms of use displayed on the webpage above.
Link: Imperial College London: Professor Rob Miller’s Introduction to C++ Programming: “Exercise Sheet 6” (HTML)
Instructions: Please click on the link above and answer questions 1–4. When you finish, click on “EXAMPLE ANSWER” below each question for the solutions. Download the C++ code provided by “EXAMPLE ANSWER” and compare it with your code. What could you have done differently? The exercise requires a good understanding of string, array, and function.
This exercise should not take you more than 6.5 hours to complete. If you work longer than 6.5 hours, check your answer against the example answer.
Terms of Use: Please respect the copyright and terms of use displayed on the webpage above.
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.
Link: www.cplusplus.com: Juan Soulie’s “Classes (I)” (HTML) and “Classes (II)” (HTML)
Instructions: Read these webpages to learn about class design. Make sure you know what constructors and deconstructors are, how to overload the constructors, and how the pointers to classes work. Work through the examples given to learn how to overload operators, how to use the keyword “this,” and when to declare static members.
Reading these webpages and taking notes should take approximately 5 hours.
Terms of Use: Please respect the copyright and terms of use displayed on the webpage above.
Link: www.cplusplus.com: Juan Soulie’s “Friendship and Inheritance” (HTML)
Instructions: Read this entry to learn when it is appropriate to use friend functions and classes. This entry will also teach you what is inherited from a base class and how multiple inheritance works.
Reading this entry and taking notes should take approximately 5 hours.
Terms of Use: Please respect the copyright and terms of use displayed on the webpage above.
Link: www.cplusplus.com: Juan Soulie’s “Polymorphism” (HTML)
Instructions: Read this webpage to learn how to create and use pointers, virtual members, and abstract base classes. As you read, pay special attention to how to create pointers to base classes, what a virtual member of a class is, and what an abstract base class is.
Reading this webpage and taking notes should take approximately 3.5 hours.
Terms of Use: Please respect the copyright and terms of use displayed on the web page above.
Link: Cprogramming.com’s “Tutorials: C++ Programming Quiz on C++ Classes” (HTML)
Instructions: By clicking the on link above, you will access five quizzes, entitled “C++ Programming Quiz on C++ Classes.” After finishing the quizzes, you can click the “answers” link to check solutions.
Completing these quizzes should take approximately 10 minutes.
Terms of Use: Please respect the copyright and terms of use displayed on the webpage above.
Link: Saint Vincent College: David Carlson and Isidore Minerd's “Linked Lists” (HTML)
Instructions: First, read the linked article above. Then, write a code for alinked list. A linked list is a sequence of items that can only be accessed in order. Each data item is stored in a node that also contains a pointer to the next node. One possible solution is provided via the link above. Before you check the solution, try to solve the problem by yourself. Once you have solved it, or after you have spent a substantial amount of time working on it, check your work against the solution.
Completing this assessment should take approximately 12.5 hours.
Terms of Use: Please respect the copyright and terms of use displayed on the webpage above.
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.
Link: www.cplusplus.com: Juan Soulie’s “Templates” (HTML)
Instructions: Read the linked material to learn how to write function and class templates. Make sure you understand how templates can have regular typed parameters. Please also work carefully through the examples given. This reading also covers the following topics: template specialization, non-type parameters for templates, and templates and multiple file projects.
Reading this material and taking notes should take approximately 4 hours.
Terms of Use: Please respect the copyright and terms of use displayed on the webpage above.
Link: www.cplusplus.com: Juan Soulie’s “Input/Output with Files” (HTML)
Instructions: Read the linked material to learn how to open and close files with C++. Work carefully through the examples given. This material also covers text files and binary files. After reading this material, you should be able to open/create files, read from the files, search text in the files, write information to the files, and close the files.
Reading this material and taking notes should take approximately 3 hours.
Terms of Use: Please respect the copyright and terms of use displayed on the webpage above.
Link: www.cplusplus.com: Juan Soulie’s “Namespaces” (HTML)
Instructions: Read this article on the keyword “using” and namespace alias. Then work carefully through the examples given. Pay special attention to how to group classes, objects, and functions under a name and how to put your program in an organized format.
Reading this webpage and taking notes should take approximately 1 hour.
Terms of Use: Please respect the copyright and terms of use displayed on the webpage above.
Link: www.cplusplus.com: Juan Soulie’s “Exceptions” (HTML)
Instructions: Read this webpage, which explains how to throw exceptions with C++ to catch errors. Work through the examples given. While reading, focus on the concepts of try, catch, and throw blocks. After reading this material, you should know how to write a simple exception blocks to catch the errors in the program.
Reading this webpage and taking notes should take approximately 1 hour.
Terms of Use: Please respect the copyright and terms of use displayed on the webpage above.
Link: www.cplusplus.com: Juan Soulie’s “Preprocessor Directives” (HTML)
Instructions: Read this webpage on how to use macro definitions, conditional inclusions, line control, error directive, and source file inclusion.
Reading this webpage and taking notes should take approximately 2 hours.
Terms of Use: Please respect the copyright and terms of use displayed on the webpage above.
Links: KeithSchwarz.com’s “Problem Set 4” (PDF)
Instructions: Access Problem Set 4 under the “Assignments” heading. There is no solution for this problem set.
Completing this assessment could take up to 3 hours.
Terms of Use: Please respect the copyright and terms of use displayed on the webpage above.
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.
Unit 5 Time AdvisoryLink: Massachusetts Institute of Technology: Geza Kovacs’ “Memory Management” (PDF)
Instructions: Please read the Lecture 8 Notes, “Memory Management,” to learn how to use constructors and descructors appropriately and fix memory leakage.
Reading this article and taking notes should take approximately 5 hours.
Terms of Use: Please respect the copyright and terms of use displayed on the webpage above.
Link: NetBeans: Anne Rice and Susan Morgan’s “Debugging C/C++ Projects Tutorial” (HTML)
Instructions: Please read the webpage to learn how to create breakpoints and debug a C++ project.
Reading this webpage and taking notes should take approximately 5 hours.
Terms of Use: Please respect the copyright and terms of use displayed on the webpage above.
Link: Rational Software’s “Debugging C and C++ Programs” (HTML)
Instructions: Please read this webpage, which explains how to use the debug tool to debug your C and C++ programs. By clicking the link, you will access the page, “Debugging C and C++ programs,” which appears on the right-hand side of the screen. Please read all content here; you do not need to explore the related links within the page. Since you do not have access to the debugging tool mentioned on the webpage, you do not need to practice the tools. By reading this webpage, you should experience some high-level ideas on how a debugging tool would help you to debug your program.
Reading this webpage and taking notes should take approximately 6 hours to complete.
Terms of Use: Please respect the copyright and terms of use displayed on the webpage above.
Link: Bruce Eckel’s Thinking in C++: “Debugging Hints” (HTML)
Instructions: By clicking the above link, you will see a link titled, “Thinking in C++, 2nd edition, Volume 1.” Please click this link to download Volume 1 of Bruce Eckel’s Thinking in C++. After downloading, unzip it and open the file Chapter03.html and read the section, “Debugging Hints,” to learn some useful techniques in debugging C and C++ programs. By reading this webpage, you will find some useful guidelines on debugging a program. You should keep it as a future reference for when you begin a debugging a program.
Reading this webpage and taking notes should take approximately 1 hour.
Terms of Use: Please respect the copyright and terms of use displayed on the webpage above.
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.
Unit 6 Time AdvisoryLink: Saint Vincent College: David Carlson and Isidore Minerd’s “Binary Trees” (HTML)
Instructions: First, read the article linked above. Then, write a code for abinary tree. Note that each node can have zero, one, or two children. In addition, each child node is clearly identified as either the left child or the right child. One possible solution is provided via the link above. Before you check the solution, try to solve the problem by yourself. Once you have solved it, or after you have spent a substantial amount of time working on it, check your work against the solution.
Completing this assessment may take up to 12 hours.
Terms of Use: Please respect the copyright and terms of use displayed on the webpage above.
The Saylor Foundation does not yet have materials for this portion of the course. If you are interested in contributing your content to fill this gap or aware of a resource that could be used here, please submit it here.
Link: Alex Forbes’ “C++ GLOSSARY” (HTML)
Instructions: Please read this webpage. It is good to keep this page as a reference of C++ glossary.
Reading this webpage and taking notes should take approximately 1 hour.
Terms of Use: Please respect the copyright and terms of use displayed on the webpage above.
Link: The Saylor Foundation's CS107 Final Exam
Instructions: You must be logged into your Saylor Foundation School account in order to access this exam. If you do not yet have an account, you will be able to create one, free of charge, after clicking the link.