Click here to start
Table of contents
6
Slide 2
Slide 3
OBJECTIVES
Slide 5
Slide 6
6.1 Introduction
6.2 Program Components in C++
Software Engineering Observation 6.1
6.2 Program Components in C++ (Cont.)
Software Engineering Observation 6.2
Error-Prevention Tip 6.1
Software Engineering Observation 6.3
6.2 Program Components in C++ (cont.)
Fig. 6.1 | Hierarchical boss function/worker function relationship.
6.3 Math Library Functions
Fig. 6.2 | Math library functions.
6.4 Function Definitions with Multiple Parameters
Slide 19
Slide 20
Slide 21
Slide 22
Slide 23
Software Engineering Observation 6.4
6.4 Function Definitions with Multiple Parameters (Cont.)
Portability Tip 6.1
Error-Prevention Tip 6.2
Common Programming Error 6.1
Common Programming Error 6.2
Software Engineering Observation 6.5
Slide 31
6.5 Function Prototypes and Argument Coercion
Software Engineering Observation 6.6
Common Programming Error 6.3
Software Engineering Observation 6.7
6.5 Function Prototypes and Argument Coercion (Cont.)
Common Programming Error 6.4
Slide 38
Slide 39
Slide 40
Fig. 6.6 | Promotion hierarchy for fundamental data types.
Common Programming Error 6.5
Common Programming Error 6.6
6.6 C++ Standard Library Header Files
Fig. 6.7 | C++ Standard Library header files. (Part 1 of 4)
Fig. 6.7 | C++ Standard Library header files. (Part 2 of 4)
Fig. 6.7 | C++ Standard Library header files. (Part 3 of 4)
Fig. 6.7 | C++ Standard Library header files. (Part 4 of 4)
6.7 Case Study: Random Number Generation
6.7 Case Study: Random Number Generation (Cont.)
Slide 51
Slide 52
Slide 53
Slide 54
Slide 55
Error-Prevention Tip 6.3
Slide 57
Slide 58
Slide 59
Slide 60
Common Programming Error 6.7
Common Programming Error 6.8
Slide 63
6.8 Case Study: Game of Chance and Introducing enum
Slide 65
Slide 66
Slide 67
Slide 68
Good Programming Practice 6.1
Good Programming Practice 6.2
Good Programming Practice 6.3
Common Programming Error 6.9
Common Programming Error 6.10
6.9 Storage Classes
6.9 Storage Classes (Cont.)
Slide 76
Performance Tip 6.1
Software Engineering Observation 6.8
Performance Tip 6.2
Slide 80
Common Programming Error 6.11
Performance Tip 6.3
Slide 83
Slide 84
Software Engineering Observation 6.9
Software Engineering Observation 6.10
Slide 87
6.10 Scope Rules
6.10 Scope Rules (Cont.)
Slide 90
Slide 91
Common Programming Error 6.12
Good Programming Practice 6.4
Slide 94
Slide 95
Slide 96
Slide 97
6.11 Function Call Stack and Activation Records
6.11 Function Call Stack and Activation Records (Cont.)
Slide 100
Slide 101
Fig. 6.14 | Function call stack after the operating system invokes main to execute the application.
Fig. 6.15 | Function call stack after main invokes function square to perform the calculation.
Fig. 6.16 | Function call stack after function square returns to main.
6.12 Functions with Empty Parameter Lists
Portability Tip 6.2
Slide 107
Slide 108
Common Programming Error 6.13
6.13 Inline Functions
Software Engineering Observation 6.11
Good Programming Practice 6.5
Performance Tip 6.4
Software Engineering Observation 6.12
Slide 115
6.14 References and Reference Parameters
Performance Tip 6.5
6.14 References and Reference Parameters (Cont.)
Performance Tip 6.6
Software Engineering Observation 6.13
Slide 121
Slide 122
Common Programming Error 6.14
Performance Tip 6.7
Software Engineering Observation 6.14
Software Engineering Observation 6.15
Slide 127
Slide 128
Slide 129
Slide 130
Common Programming Error 6.15
Common Programming Error 6.16
Common Programming Error 6.17
6.15 Default Arguments
Common Programming Error 6.18
Slide 136
Slide 137
Good Programming Practice 6.6
Software Engineering Observation 6.16
Common Programming Error 6.19
6.16 Unary Scope Resolution Operator
Common Programming Error 6.20
Good Programming Practice 6.7
Slide 144
Software Engineering Observation 6.17
Error-Prevention Tip 6.4
Error-Prevention Tip 6.5
6.17 Function Overloading
Good Programming Practice 6.8
Slide 150
Slide 151
6.17 Function Overloading (Cont.)
Slide 153
Slide 154
Common Programming Error 6.21
Common Programming Error 6.22
6.18 Function Templates
6.18 Function Templates (Cont.)
Slide 159
Common Programming Error 6.23
Slide 161
Slide 162
6.19 Recursion
6.19 Recursion (Cont.)
Slide 165
Fig. 6.28 | Recursive evaluation of 5!.
Slide 167
Slide 168
Common Programming Error 6.24
6.20 Example Using Recursion: Fibonacci Series
Slide 171
Slide 172
Fig. 6.31 | Set of recursive calls to function fibonacci.
Common Programming Error 6.25
Portability Tip 6.3
6.20 Example Using Recursion: Fibonacci Series (Cont.)
Performance Tip 6.8
6.21 Recursion vs. Iteration
6.21 Recursion vs. Iteration (Cont.)
Slide 180
Slide 181
Slide 182
Software Engineering Observation 6.18
Performance Tip 6.9
Common Programming Error 6.26
Fig. 6.33 | Summary of recursion examples and exercises in the text. (Part 1 of 3)
Fig. 6.33 | Summary of recursion examples and exercises in the text. (Part 2 of 3)
Fig. 6.33 | Summary of recursion examples and exercises in the text. (Part 3 of 3)
6.22 (Optional) Software Engineering Case Study: Identifying Class Operations in the ATM System
Fig. 6.34 | Verbs and verb phrases for each class in the ATM system.
6.22 (Optional) Software Engineering Case Study: Identifying Class Operations in the ATM System (Cont.)
Fig. 6.35 | Classes in the ATM system with attributes and operations.
Slide 193
Fig. 6.36 | Class BankDatabase with operation parameters.
Fig. 6.37 | Class Account with operation parameters.
Fig. 6.38 | Class Screen with operation parameters.
Fig. 6.39 | Class CashDispenser with operation parameters.
Author:
Dr. J
E-mail:
Juliano@csuChico.edu
Homepage:
http://www.ecst.csuchico.edu/~juliano