C++ Programming

Purpose of Course  showclose

In the first unit, we will learn the mechanics of editing and compiling a simple program written in C++.  We will begin with a discussion of the essential elements of C++ programming: variables, loops, expressions, functions, and string class.  Next, 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 the topics of 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.

This course contains a number of sample programs and review exercises.  Through these exercises, students should better learn how to write functions, use the string class, and write elementary data structures such as linked lists and binary trees.

Course Information  showclose

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:
Requirements for Completion: In order to complete this course, you will need to work through each unit and all of its assigned materials, including the quizzes and the final exam.

Note that you will only receive an official grade on your final exam.  In order to "pass" this course, you will need to earn a 70% or higher on the final exam.  Your score on the exam will be tabulated as soon as you complete it.  If you do not pass the exam, you may take it again.

Time Commitment: This course should take you a total of 114.5 hours to complete.  Each unit includes a "time advisory" that lists the amount of time you are expected to spend on each subunit.  These should help you plan your time accordingly.  It may be useful to take a look at these time advisories and determine how much time you have over the next few weeks to complete each unit and then set goals for yourself.  For example, Unit 1 should take you 15.5 hours.  Perhaps you can sit down with your calendar and decide to complete subunits 1.1 and 1.2 (a total of 3 hours) on Monday night, subunit 1.3 (a total of 6.5 hours) on Tuesday and Wednesday nights, and so forth.

Tips/Suggestions: As noted in the "Course Requirements," CS101 and CS102 are prerequisites for this course.  If you are struggling with object-oriented programing concepts as you progress through this course, consider taking a break to revisit CS101 and CS102, focusing especially on Units 2, 3, and 4 of CS102.

As you read and work through the course exercises, take careful notes on a separate notepad.  These notes will help you study for the final exam.

Learning Outcomes  showclose

Upon successful completion of this course, students will be able to:
  • Compile and execute code written in C++ language.
  • Work with the elementary data types and conditional and iteration structures.
  • Define and use functions, pointers, arrays, struct, unions, and enumerations.
  • Write C++ using principles of object-oriented programming.
  • Write templates and manipulate the files.
  • Code and use namespaces, exceptions, and preprocessor instructions.
  • Write a code that represents linked lists and binary trees.
  • Translate simple word problems into C++ language.
  • Perform debugging and fixing of common C++ errors.
  • Manage memory appropriately, including proper allocation/deallocation procedures.

Course Requirements  showclose

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.

Unit Outline show close


Expand All Resources Collapse All Resources
  • 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 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 Advisory   show close
    Unit 1 Learning Outcomes   show close
  • 1.1 History of C++: Origins and Examples  
    • Reading: www.cplusplus.com: “History of C++”

      Link: 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:

      • Who designed the C language.
      • When the C language was designed.
      • When C++ was designed
      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.

  • 1.2 How to Compile and Run a C++ Program  
  • 1.2.1 The Linux Way  
    • Reading: wikiHow’s “How to Compile a C/C++ Program”

      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.

  • 1.2.2 Other Ways with NetBeans  
  • 1.2.2.1 NetBeans IDE Download  
    • Reading: NetBeans’ “NetBeans IDE Download”

      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.

    • Web Media: NetBeans’ “NetBeans Installation Instructions”

      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.

  • 1.2.2.2 C/C++ Projects Quick Start Tutorial for NetBeans  
    • Web Media: NetBeans’ “C/C++ Projects Quick Start Tutorial”

      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.

  • 1.3 Basics of C++  
  • 1.3.1 Introduction to C++  
    • Reading: Wikiversity’s “Introduction to C++”

      Link: Wikiversity’s “Introduction to C++” (HTML)

      Instructions: Please read this entry on the structure of C++ programming.  Then compile the simple example given 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.

  • 1.3.2 Variables, Data Types, and Constants  
    • Reading: www.cplusplus.com: Juan Soulie’s “Variables and Data Types” and “Constants”

      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.

  • 1.3.3 Basic Input and Output  
    • Reading: www.cplusplus.com: Juan Soulie’s “Basic Input and Output”

      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.

  • 1.3.4 Control Structures  
    • Reading: Massachusetts Institute of Technology: John Marrero’s “Flow of Control”

      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.

  • 1.3.5 Simple Functions  
  • 1.3.5.1 Scope of Variables in a Function  
    • Reading: www.cplusplus.com: Juan Soulie’s “Functions (I)”

      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.

  • 1.3.5.2 Arguments Passed by Value and by Reference  
    • Reading: www.cplusplus.com: Juan Soulie’s “Functions (II)”

      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.

    • Assessment: Google Code’s: “C++ Class: Problem Set 1”

      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.

  • 1.4 C++ Reference  
    • Reading: cppreference.com’s “C++ Reference”

      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.

  • 1.5 C++ Header Files  
    • Reading: Learning-computer-programming.blogspot.com: “Interchanging the Values of Two Variables”; www.danzig.us: “Recursive Factorial Function”; and www.cplusplus.com: “Counter with Recursive Function”

      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.

    • Assessment: KeithSchwarz.com’s “Problem Set 0”

      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:

      • “01: C++ Standard Library”
      • “02: C++ without genlib.h”
      • “03: C++ IOStream Library”
      • “04: Pointers and References”
      In the Assignments section, find “Problem Set 0.”  Some questions in the “Problem Set 0” refer to examples in the above handouts.  In order to see these examples, you need to click the corresponding handouts.  Solutions links are provided beside the problem set.  Do your best tosolve the assigmentsbefore looking atthe solutions.

      This assessment could take up to 4.5 hours.  If you work longer than 4.5 hours, check the solutions at the links provided.

      Terms of Use: Please respect the copyright and terms of use displayed on the webpage above.

  • 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.

    Unit 2 Time Advisory   show close
    Unit 2 Learning Outcomes   show close
  • 2.1 Arithmetic Operators  
    • Reading: www.cplusplus.com: Juan Soulie’s “Operators”

      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.

  • 2.2 Basic Data Structures  
  • 2.2.1 Arrays and Strings  
    • Reading: www.cplusplus.com: Juan Soulie’s “Arrays” and “Character Sequences”

      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.

  • 2.2.2 Pointers  
    • Reading: www.cplusplus.com: Juan Soulie’s “Pointers”

      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.

  • 2.2.3 Struct, Unions, and Enumerations  
  • 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 formThis brings object-oriented methodologies to their full potential.

    Unit 3 Time Advisory   show close
    Unit 3 Learning Outcomes   show close
  • 3.1 Class Design  
    • Reading: www.cplusplus.com: Juan Soulie’s “Classes (I)” and “Classes (II)”

      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.

  • 3.2 Inheritance Between Classes  
  • 3.3 Polymorphism  
    • Reading: www.cplusplus.com: Juan Soulie’s “Polymorphism”

      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.

    • Assessment: Cprogramming.com’s “Tutorials: C++ Programming Quiz on C++ Classes”

      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.

  • 3.4 Coding Drills  
    • Assessment: Saint Vincent College: David Carlson and Isidore Minerd's “Linked Lists”

      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.

  • 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.

    Unit 4 Time Advisory   show close
    Unit 4 Learning Outcomes   show close
  • 4.1 Templates  
    • Reading: www.cplusplus.com: Juan Soulie’s “Templates”

      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.

  • 4.2 Input/Output With Files  
    • Reading: www.cplusplus.com: Juan Soulie’s “Input/Output with Files”

      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.

  • 4.3 Namespaces  
    • Reading: www.cplusplus.com: Juan Soulie’s “Namespaces”

      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.

  • 4.4 Exceptions  
    • Reading: www.cplusplus.com: Juan Soulie’s “Exceptions”

      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.

  • 4.5 Preprocessor Directives  
  • 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.

    Unit 5 Time Advisory   show close
    Unit 5 Learning Outcomes   show close
  • 5.1 Memory Management  
  • 5.2 Testing and Debugging  
  • 5.3 Debugging with C in C++  
    • Reading: Rational Software’s “Debugging C and C++ Programs”

      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, and (optionally) 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 using the tools.  You should take away 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.

  • 5.4 Debugging Hints  
    • Reading: Bruce Eckel’s Thinking in C++: “Debugging Hints”

      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.

  • 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.

    Unit 6 Time Advisory   show close
    Unit 6 Learning Outcomes   show close
  • 6.1 Coding Drills: Binary Trees  
    • Assessment: Saint Vincent College: David Carlson and Isidore Minerd’s “Binary Trees”

      Link: 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.

  • 6.2 Coding Drills: List of Binary Trees  
    • Activity: Wikispaces: CSE222 “Binary Tree Exercise”

      Link: Wikispaces: CSE222 “Binary Tree Exercise” (HTML)

      Instructions: This exercise uses both binary trees and linked lists. It first builds a binary tree to represent text. The nodes of the tree represent the words of the text. In this representation, the alphabetical order of the words is used to determine whether a word is placed using the right branch or the left branch of a node. For example, if the first word begins with an f and the second word begins with an s, then the second word would be stored as the right descendant of the node for the first word.

      Once the structure of the binary tree is defined, functions can be created that operate on the binary tree structure. To test your code, this example uses Lincoln's Gettysburg Address. Two links in left hand column (“Gettysburg Address” and “Gettysburg, just the words”) help you visualize the input data and the resulting binary tree. Note that binary trees are useful for storing data in a manner that facilitates searching that data. For this reason, data is put into the binary tree in a specific order. Note also, that some of the illustrations on this page may use C instead of C++. However, this link is intended to help you come up with a plan for solving the problem; use your knowledge of C++ learned in this course to code the problem.
       
      In summary, to solve the problem:

      • 1) understand the requirements of the problem (i.e. what you have to do);
      • 2) design a solution to solve the problem, including a data structure and procedures or functions that operate on the data structure;
      • 3) code your design in C++; and
      • 4) test your code using the “Gettysburg Address” found on the linked page above.
       
      Once the binary tree representation of the text is built, the next part of the assessment is to create a linked list that will visit the nodes of the binary tree, i.e. walk the tree in such a way that you visit the nodes in the order in which the test is read, e.g. “Four score and seven years ago, our forefathers…” The binary tree representation stores the words of the text using an alphabetical order. The link list represents the reading order of the words as they appear in the text.

      Completing this activity should take approximately 12 hours.

      Terms of Use: This resource is licensed under a Creative Commons Attribution Share-Alike 3.0 License. It is attributed to Tangient LLC

  • 6.3 C++ Glossary  
    • Reading: Alex Forbes’ “C++ GLOSSARY”

      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.

  • Final Exam