Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Standard view
Full view
of .

The way of the program
1.1 What is a programming language?
1.2 What is a program?
1.3 What is debugging?
1.3.1 Compile-time errors
1.3.2 Run-time errors
1.3.3 Logic errors and semantics
1.3.4 Experimental debugging
1.4 Formal and natural languages
1.5 The ﬁrst program
1.6 Glossary
Variables and types
2.1 More output
2.2 Values
2.3 Variables
2.4 Assignment
2.5 Outputting variables
2.6 Keywords
2.7 Operators
2.8 Order of operations
2.9 Operators for characters
2.10 Composition
2.11 Glossary
Function
3.1 Floating-point
3.2 Converting from double to int
3.3 Math functions
3.4 Composition
3.6 Deﬁnitions and uses
3.7 Programs with multiple functions
3.8 Parameters and arguments
3.9 Parameters and variables are local
3.10. FUNCTIONS WITH MULTIPLE PARAMETERS 29
3.10 Functions with multiple parameters
3.11 Functions with results
3.12 Glossary
Conditionals and recursion
4.1 The modulus operator
4.2 Conditional execution
4.3 Alternative execution
4.4 Chained conditionals
4.5 Nested conditionals
4.6 The return statement
4.7 Recursion
4.8 Inﬁnite recursion
4.9 Stack diagrams for recursive functions
4.10 Glossary
Fruitful functions
5.1 Return values
5.2 Program development
5.3 Composition
5.5 Boolean values
5.6 Boolean variables
5.7 Logical operators
5.8 Bool functions
5.9 Returning from main
5.10 More recursion
5.11 Leap of faith
5.12 One more example
5.13 Glossary
Iteration
6.1 Multiple assignment
6.2 Iteration
6.3 The while statement
6.4 Tables
6.5 Two-dimensional tables
6.6 Encapsulation and generalization
6.7 Functions
6.8 More encapsulation
6.9 Local variables
6.10 More generalization
6.11 Glossary
Strings and things
7.1 Containers for strings
7.2 apstring variables
7.3 Extracting characters from a string
7.5 Traversal
7.6 A run-time error
7.7 The find function
7.8 Our own version of find
7.9 Looping and counting
7.10 Increment and decrement operators
7.11 String concatenation
7.12 apstrings are mutable
7.13 apstrings are comparable
7.14 Character classiﬁcation
7.15 Other apstring functions
7.16 Glossary
Structures
8.1 Compound values
8.2 Point objects
8.3 Accessing instance variables
8.4 Operations on structures
8.5 Structures as parameters
8.6 Call by value
8.7 Call by reference
8.8 Rectangles
8.9 Structures as return types
8.10 Passing other types by reference
8.11 Getting user input
8.12 Glossary
More structures
9.1 Time
9.2 printTime
9.3 Functions for objects
9.4 Pure functions
9.5 const parameters
9.6 Modiﬁers
9.7 Fill-in functions
9.8 Which is best?
9.9 Incremental development versus planning
9.10 Generalization
9.11 Algorithms
9.12 Glossary
10.1 Accessing elements
10.2 Copying vectors
10.3 for loops
10.4 Vector length
10.5 Random numbers
10.6 Statistics
10.7 Vector of random numbers
10.8 Counting
10.9 Checking the other values
10.10 A histogram
10.11 A single-pass solution
10.12 Random seeds
10.13 Glossary
Member functions
11.1 Objects and functions
11.2 print
11.3 Implicit variable access
11.4 Another example
11.5 Yet another example
11.6 A more complicated example
11.7 Constructors
11.8 Initialize or construct?
11.9 One last example
11.11 Glossary
Vectors of Objects
12.1 Composition
12.2 Card objects
12.3 The printCard function
12.4 The equals function
12.5 The isGreater function
12.6 Vectors of cards
12.7 The printDeck function
12.8 Searching
12.9 Bisection search
12.10 Decks and subdecks
12.11 Glossary
Objects of Vectors
13.1 Enumerated types
13.2 switch statement
13.3 Decks
13.4 Another constructor
13.5 Deck member functions
13.6 Shuﬄing
13.7 Sorting
13.8 Subdecks
13.9 Shuﬄing and dealing
13.10 Mergesort
13.11 Glossary
Classes and invariants
14.1 Private data and classes
14.2 What is a class?
14.3 Complex numbers
14.4 Accessor functions
14.5 Output
14.6 A function on Complex numbers
14.7 Another function on Complex numbers
14.8 Invariants
14.9 Preconditions
14.10 Private functions
14.11 Glossary
15.1 Streams
15.2 File input
15.3 File output
15.4 Parsing input
15.5 Parsing numbers
15.6 The Set data structure
15.7 apmatrix
15.8 A distance matrix
15.9 A proper distance matrix
15.10 Glossary
A.1 apstring
A.2 apvector
A.3 apmatrix
0 of .
Results for:
P. 1
thinkCScpp

# thinkCScpp

Ratings: (0)|Views: 8 |Likes:

See more
See less

03/08/2014

pdf

text

original