Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikibooksThe Free Textbook Project
Search

Saylor.org's C++ Programming

0% developed
From Wikibooks, open books for an open world

Dear Wikipedians,

No doubt some of you are familiar with the free college courses available onSaylor.org. Much like the Wikimedia community, we are committed to providing free and accessible education for everyone with internet access. At Saylor, we combine some of our custom-created educational materials with materials that are already available throughout the internet. However, because we sometimes use links to third party materials, those sections of our courses are not entirely sustainable. The Saylor Wikibooks Project is a way for you to help minimize that threat. We’ve uploaded a number of our course outlines to Wikibooks in the hope that you all will contribute to our effort. Our course outlines have been developed by our consultant professors by studying a collection of syllabi of relevant courses from various traditional brick and mortar institutions. This guarantees that our students will be provided the same learning opportunity as a student enrolled in a traditional institution. We believe that we have created the best structure for our courses, which optimizes the information that students would be expected to know. By creating openly licensed content that fits in with Saylor’s established course outlines, (in the form of Wikibooks’ textbooks), you can add to the ever-expanding body of wiki material, while simultaneously improving the sustainability of our courses.

Thanks for your help,

The Saylor Team


If you'd like to learn more about the project please visitUser:Thomas_Simpson



Summary

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 text will also cover the topics of namespaces, exception handling, and preprocessor directives. In the last part of the text, we will learn some slightly more sophisticated programming techniques that deal with data structures such as linked lists and binary trees.


Global Learning Outcomes

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.


Introduction and Set Up

[edit |edit source]

Upon successful completion of this unit, students will be able to:

  • Describe the basic history of C++.
  • Set up a NetBeans IDE for a simple C++ project.
  • Create and compile a simple C++ program.
  • Use cout and cin objects effectively.
  • Declare and use variables.
  • Use conditional and iteration structures in C++.
  • Define and use simple functions.


1.1History of C++: Origins and Examples
1.2How to Compile and Run a C++ Program
1.2.1Linux Way
1.2.2Other Ways with NetBeans
1.3Basics of C++
1.3.1Structure of a Program
1.3.2Variables, Data Types, and Constants
1.3.3Basic Input and Output
1.3.4Control Structures
1.3.5Simple Functions
1.4C++ Reference
1.5C++ Coding Practice

Dealing with Data and Compound Types

[edit |edit source]

Upon successful completion of this unit, students will be able to:

  • List the operators in C++ language.
  • Define and use arrays, struct, unions, and enumerations.
  • Use pointers.
  • Use the functions of string class.


2.1Arithmetic Operators
2.2Basic Data Structures
2.2.1Arrays and Strings
2.2.2Pointers
2.2.3Struct, Unions, and Enumerations
2.3C++ Coding Practice: String Class

Object-Oriented Programming

[edit |edit source]

Upon successful completion of this unit, students will be able to:

  • Define and compare/contrast constructors and deconstructors.
  • Design pointers to the class and create overloading operators.
  • Define and use the keyword “this” and use the static members appropriately.
  • Design and appropriately use friend functions and classes.
  • Use the class inheritance for better code design.
  • Explain how polymorphism is achieved through C++ code.


3.1Class Design
3.1.1Constructors and Destructors
3.1.2Overloading Constructors and Pointers to Classes
3.1.3Overloading Operators
3.1.4The Keyword “This”
3.1.5Static Members
3.2Inheritance Between Classes
3.2.1Friend Functions
3.2.2Friend Classes
3.2.3Inheritance Between Classes
3.2.4Multiple Inheritance
3.3Polymorphism
3.3.1Pointers to Base Class
3.3.2Virtual Members
3.3.3Abstract Base Classes
3.4Coding Drills

Advanced Concepts

[edit |edit source]

Upon successful completion of this unit, students will be able to:

  • Write class and function templates.
  • Code with a class that manipulates the files.
  • Use namespaces and exceptions in C++ code.
  • Write preprocessor instructions.


4.1Templates
4.1.1Function Templates
4.1.2Class Templates
4.1.3Template Specialization
4.1.4Non-type Parameters for Templates
4.1.5Templates and Multiple-file Projects
4.2Input/Output With Files
4.2.1Open and Close a File
4.2.2Text Files
4.2.3Binary Files
4.3Namespaces
4.4Exceptions
4.5Preprocessor Directives

Useful Examples

[edit |edit source]

Upon successful completion of this unit, students will be able to:

  • Describe and code the binary tree structure.
  • Code special data structures by combining linked lists and binary trees.


5.1Coding Drills: Binary Trees
5.2Coding Drills: List of Binary Trees
Retrieved from "https://en.wikibooks.org/w/index.php?title=Saylor.org%27s_C%2B%2B_Programming&oldid=3464899"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2025 Movatter.jp