Example: confidence

D R A F T - Southern Adventist University

Fundamentals of ProgrammingC++DRAFTR ichard L. HaltermanSchool of ComputingSouthern Adventist UniversityFebruary 28, 2018 Copyright 2008 2017 Richard L. Halterman. All rights The Context of Software .. Tools .. Programming with C++ ..62 Writing a C++ Structure of a Simple C++ Program .. , Compiling, and Running the Program .. of our simple program .. for simple C++ programs ..133 Values and Values .. and Assignment .. Integer Types .. Types .. Numeric Types .. Types .. Type Inference with auto .. Exercises ..334 Expressions and Arithmetic37 2017 Richard L.

i Contents 1 The Context of Software Development 1 1.1 Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Transcription of D R A F T - Southern Adventist University

1 Fundamentals of ProgrammingC++DRAFTR ichard L. HaltermanSchool of ComputingSouthern Adventist UniversityFebruary 28, 2018 Copyright 2008 2017 Richard L. Halterman. All rights The Context of Software .. Tools .. Programming with C++ ..62 Writing a C++ Structure of a Simple C++ Program .. , Compiling, and Running the Program .. of our simple program .. for simple C++ programs ..133 Values and Values .. and Assignment .. Integer Types .. Types .. Numeric Types .. Types .. Type Inference with auto .. Exercises ..334 Expressions and Arithmetic37 2017 Richard L.

2 HaltermanDraft date: February 28, .. Type Expressions .. Precedence and Associativity .. and Warnings .. Errors .. Errors .. Errors .. Warnings .. Examples .. vs. Floating-point Numbers .. Implementation .. Implementation .. Arithmetic Operators .. Bitwise Operators .. Algorithms .. Exercises ..785 Conditional bool .. Expressions .. Simple if Statement .. Statements .. if/else Statement .. Boolean Expressions .. Conditionals .. if/else Statements .. in Conditional Statements .. Exercises .. 1176 while Statement.

3 Loops .. Loop Termination .. 140 2017 Richard L. HaltermanDraft date: February 28, break statement .. goto Statement .. continue Statement .. Loops .. Examples .. a Tree .. Prime Numbers .. 1537 Other Conditional and Iterative switch Statement .. Conditional Operator .. do/while Statement .. for Statement .. 1738 Using to Using Functions .. Math Functions .. and Minimum .. Function .. Functions .. Numbers .. 1979 Writing Basics .. Functions .. by Value.

4 Examples .. Organized Prime Generator .. Interpreter .. Input .. Die Rolling Simulator .. Drawing Function .. 223 2017 Richard L. HaltermanDraft date: February 28, Equality .. Table with Functions .. Functions .. Functions vs. Standard Functions .. 23310 Managing Functions and Global Variables .. Static Variables .. Overloaded Functions .. Default Arguments .. Recursion .. Making Functions Reusable .. Pointers .. Reference Variables .. Pass by Reference .. Pass by Reference via Pointers.

5 Pass by Reference via References .. Functions .. 27811 Vectors .. Declaring and Using Vectors .. Traversing a Vector .. Vector Methods .. Vectors and Functions .. Multidimensional Vectors .. Arrays .. Static Arrays .. Pointers and Arrays .. Dynamic Arrays .. Copying an Array .. Multidimensional Arrays .. C Strings .. 331 2017 Richard L. HaltermanDraft date: February 28, Command-line Arguments .. Vectors vs. Arrays .. Prime Generation with a Vector.

6 Exercises .. 34212 Sorting and Sorting .. Flexible Sorting .. Search .. Linear Search .. Binary Search .. Vector Permutations .. Randomly Permuting a Vector .. Exercises .. 37913 Standard C++ String Objects .. Input/Output Streams .. File Streams .. Complex Numbers .. Better Pseudorandom Number Generation .. Exercises .. 40314 Custom Object Basics .. Instance Variables .. Member Functions .. Constructors .. Defining a New Numeric Type.

7 Encapsulation .. Exercises .. 42815 Fine Tuning Passing Object Parameters .. Pointers to Objects and Object Arrays .. ThethisPointer .. 440 2017 Richard L. HaltermanDraft date: February 28, .. Separating Method Declarations and Definitions .. Preventing Multiple Inclusion .. Overloaded Operators .. Operator Functions .. Operator Methods .. Classes vs. structs .. 46816 Building some Useful A Better Rational Number Class .. Stopwatch .. Sorting with Logging .. Automating Testing.

8 Convenient High-quality Pseudorandom Numbers .. Exercises .. 49117 Inheritance and I/O Stream Inheritance .. Inheritance Mechanics .. Uses of Inheritance .. Polymorphism .. Protected Members .. Fine Tuning Inheritance .. Exercises .. 52818 Memory Memory Available to C++Programs .. Manual Memory Management .. Linked Lists .. Resource Management .. Rvalue References .. Smart Pointers .. 577 2017 Richard L. HaltermanDraft date: February 28, 2018 CONTENTSvii19 Generic Function Templates.

9 Class Templates .. Exercises .. 61920 The Standard Template Containers .. Iterators .. Iterator Ranges .. Lambda Functions .. Algorithms in the Standard Library .. Namespaces .. 66121 Associative Associative Containers .. Thestd::setData Type .. Tuples .. Thestd::mapData Type .. Thestd::unordered_mapData Type .. Counting with Associative Containers .. Grouping with Associative Containers .. Memoization .. 69222 Handling Motivation .. Exception Examples.

10 Custom Exceptions .. Catching Multiple Exceptions .. Exception Mechanics .. Using Exceptions .. 716 Appendices721A Using Visual Studio 2015 to Develop C++ Programs721B Command Line Studio Command Line Tools .. 728 2017 Richard L. HaltermanDraft date: February 28, C++ Programs with the GNU Tools .. 730 Bibliography732 Index733 2017 Richard L. HaltermanDraft date: February 28, 2018ixPrefaceLegal Notices and InformationPermission is hereby granted to make hardcopies and freely distribute the material herein under thefollowing conditions: The copyright and this legal notice must appear in any copies of this document made in whole or inpart.


Related search queries