图书介绍

C++程序设计 第2版 英文PDF|Epub|txt|kindle电子书版本网盘下载

C++程序设计 第2版 英文
  • (美)Nell Dale,Chip Weems,Mark Headington著 著
  • 出版社: 北京:高等教育出版社
  • ISBN:704010038X
  • 出版时间:2001
  • 标注页数:752页
  • 文件大小:39MB
  • 文件页数:778页
  • 主题词:

PDF下载


点此进入-本书在线PDF格式电子书下载【推荐-云解压-方便快捷】直接下载PDF格式图书。移动端-PC端通用
种子下载[BT下载速度快]温馨提示:(请使用BT下载软件FDM进行下载)软件下载地址页直链下载[便捷但速度慢]  [在线试读本书]   [在线获取解压码]

下载说明

C++程序设计 第2版 英文PDF格式电子书版下载

下载的文件为RAR压缩包。需要使用解压软件进行解压得到PDF格式图书。

建议使用BT下载工具Free Download Manager进行下载,简称FDM(免费,没有广告,支持多平台)。本站资源全部打包为BT种子。所以需要使用专业的BT下载软件进行下载。如BitComet qBittorrent uTorrent等BT下载工具。迅雷目前由于本站不是热门资源。不推荐使用!后期资源热门了。安装了迅雷也可以迅雷进行下载!

(文件页数 要大于 标注页数,上中下等多册电子书除外)

注意:本站所有压缩包均有解压码: 点击下载压缩包解压工具

图书目录

1 Overview of Programming and Problem Solving1

1.1 Overview of Programming2

What Is Programming?2

How Do We Write a Program?2

1.2 What Is a Programming Language?7

1.3 What Is a Computer?11

1.4 Ethics and Responsibilities in the Computing Profession15

Software Piracy15

Privacy of Data16

Use of Computer Resources16

1.5 Problem-Solving Techniques17

Software Engineering17

Ask Questions18

Look for Things That Are Familiar19

Solve by Analogy19

Means-Ends Analysis19

Divide and Conquer20

The Building-Block Approach20

Merging Solutions21

Mental Blocks:The Fear of Starting22

Algorithmic Problem Solving22

Summary22

2 C++ Syntax and Semantics,and the Program Development Process25

C++ Program Structure26

2.1 The Elements of C++ Programs26

Syntax and Semantics28

Syntax Templates30

Naming Program Elements:Identifiers31

Data and Data Types33

Naming Elements:Declarations34

Taking Action:Executable Statements38

Beyond Minimalism:Adding Comments to a Program43

2.2 Program Construction44

Blocks(Compound Statements)46

The C++ Preprocessor47

An Introduction to Namespaces49

Creating Blank Lines50

2.3 More About Output50

Inserting Blanks Within a Line51

Programming Example:Contest Letter53

Testing and Debugging57

Summary59

Quick Check59

Exam Preparation Exercises62

Programming Warm-up Exercises65

Programming Problems67

3 Numeric Types,Expressions,and Output69

3.1 Overview of C++ Data Types70

3.2 Numeric Data Types70

Integral Types71

Floating-Point Types72

3.3 Declarations for Numeric Types73

Named Constant Declarations73

Variable Declarations74

3.4 Simple Arithmetic Expressions74

Arithmetic Operators75

Increment and Decrement Operators78

3.5 Compound Arithmetic Expressions78

Precedence Rules79

Type Coercion and Type Casting80

Value-Returning Functions83

3.6 Function Calls and Library Functions83

Library Functions85

Void Functions86

3.7 Formatting the Output87

Integers and Strings87

Floating-Point Numbers90

3.8 Additional string Operations94

The length and size Functions94

The find Function95

The substr Function97

Programming Example:Map Measurements99

Testing and Debugging102

Quick Check103

Summary103

Exam Preparation Exercises106

Programming Warm-up Exercises109

Programming Problems113

4 Program Input and the Software Design Process115

4.1 Getting Data into Programs116

Input Streams and the Extraction Operator(>>)116

The Reading Marker and the Newline Character119

Reading Character Data with the get Function120

Skipping Characters with the ignore Function122

Reading String Data123

4.2 Interactive Input/Output125

4.3 Noninteractive Input/Output126

4.4 File Input and Output127

Files127

Using Files127

An Example Program Using Files130

Run-Time Input of File Names133

4.5 Input Failure134

4.6 Software Design Methodologies135

4.7 What Are Objects?136

4.8 Object-Oriented Design138

4.9 Functional Decomposition138

Modules140

A Perspective on Design141

Programming Example:Stretching a Canvas142

Testing and Debugging147

Testing and Debugging Hints148

Summary149

Quick Check150

Exam Preparation Exercises151

Programming Warm-up Exercises153

Programming Problems155

5 Conditions,Logical Expressions,and Selection Control Structures157

5.1 Flow of Control158

5.2 Conditions and Logical Expressions159

The bool Data Type159

Selection159

Logical Expressions160

Precedence of Operators166

Relational Operators with Floating-Point Types167

5.3 The If Statement168

The If-Then-Else Form169

Blocks(Compound Statements)170

The If-Then Form172

A Common Mistake173

5.4 Nested If Statements174

The Dangling else176

5.5 Testing the State of an I/O Stream178

Programming Example:Warning Notices180

Testing and Debugging183

Testing in the Problem-Solving Phase:The Algorithm Walk-Through184

Testing in the Implementation Phase186

The Test Plan191

Tests Performed Automatically During Compilation and Execution192

Testing and Debugging Hints193

Summary195

Quick Check195

Exam Preparation Exercises196

Programming Warm-up Exercises199

Programming Problems202

6 Looping205

6.1 The While Statement206

6.3 Loops Using the While Statement208

6.2 Phases of Loop Execution208

Count-Controlled Loops209

Event-Controlled Loops209

Looping Subtasks212

6.4 How to Design Loops214

Designing the Flow of Control215

Designing the Process Within the Loop216

The Loop Exit217

6.5 Nested Logic217

Designing Nested Loops219

Programming Example:Average Income by Gender220

Loop-Testing Strategy223

Testing and Debugging223

Test Plans Involving Loops224

Testing and Debugging Hints225

Summary227

Quick Check227

Exam Preparation Exercises228

Programming Warm-up Exercises231

Programming Problems232

7 Functions235

7.1 Functional Decomposition with Void Functions236

Writing Modules as Void Functions236

Flow of Control in Function Calls239

7.2 An Overview of User-Defined Functions239

Function Parameters240

7.3 Syntax and Semantics of Void Functions241

Function Call(Invocation)241

Function Declarations and Definitions242

Local Variables244

The Return Statement245

Header Files246

7.4 Parameters247

Value Parameters248

Reference Parameters249

7.5 Designing Functions250

Writing Assertions as Program Comments252

Documenting the Direction of Data Flow254

Programming Example:Comparison of Furniture-Store Sales257

Testing and Debugging263

The assert Library Funcion265

Testing and Debugging Hints266

Summary267

Quick Check268

Exam Preparation Exercises269

Programming Warm-up Exercises275

Programming Problems277

8 Scope,Lifetime,and More on Functions281

8.1 Scope of Identifiers282

Scope Rules284

Variable Declarations and Definitions287

Namespaces288

8.2 Lifetime of a Variable291

Initializations in Declarations292

8.3 Interface Design293

Side Effects294

Global Constants294

8.4 Value-Returning Functions295

Boolean Functions299

Interface Design for Value-Returning Functions300

When to Use Value-Returning Functions300

Programming Example:Starship Weight and Balance302

Stubs and Drivers310

Testing and Debugging310

Testing and Debugging Hints311

Summary312

Quick Check312

Exam Preparation Exercises313

Programming Warm-up Exercises317

Programming Problems319

9 Additional Control Structures323

9.1 The Switch Statement324

9.2 The Do-While Statement327

9.3 The For Statement330

9.4 The Break and Continue Statements332

9.5 Guidelines for Choosing a Looping Statement335

Programming Example:Monthly Rainfall Averages336

Testing and Debugging340

Testing and Debugging Hints340

Summary341

Quick Check341

Exam Preparation Exercises342

Programming Warm-up Exercises344

Programming Problems346

10 Simple Data Types:Built-In and User-Defined349

10.1 Built-In Simple Types350

Integral Types352

Floating-Point Types353

10.2 Additional C++ Operators354

Assignment Operators and Assignment Expressions356

Increment and Decrement Operators357

Bitwise Operators358

The Cast Operation358

The size of Operator358

The ?:Operator359

Operator Precedence359

10.3 Working with Character Data360

Character Sets361

C++ char Constants362

Programming Techniques363

Representation of Floating-Point Numbers367

10.4 More on Floating-Point Numbers367

Arithmetic with Floating-Point Numbers370

10.5 User-Defined Simple Types372

The Typedef Statement372

Enumeration Types373

Named and Anonymous Data Types379

User-Written Header Files380

10.6 More on Type Coercion380

Type Coercion in Arithmetic and Relational Expressions381

Type Coercion in Assignments,Argument Passing,and Return of a Function Value382

Programming Example:Rock,Paper,Scissors384

Coping with Input Errors391

Floating-Point Data391

Testing and Debugging391

Testing and Debugging Hints392

Summary393

Quick Check393

Exam Preparation Exercises395

Programming Warm-up Exercises397

Programming Problems398

11 Structured Types,Data Abstraction,and Classes401

11.1 Simple Versus Structured Data Types402

11.2 Records(C++ Structs)403

Accessing Individual Components405

Aggregate Operations on Structs407

More About Struct Declarations409

Hierarchical Records409

11.3 Unions412

11.4 Data Abstraction413

11.5 Abstract Data Types415

11.6 C++ Classes417

Classes,Class Objects,and Class Members419

Built-in Operations on Class Objects421

Class Scope423

Information Hiding423

11.7 Specification and Implementation Files425

The Specification File425

The Implementation File427

Compiling and Linking a Multifile Program431

11.8 Guaranteed Initialization with Class Constructors434

Invoking a Constructor435

Revised Specification and Implementation Files for Time Type436

Guidelines for Using Class Constructors438

Programming Example:Manipulating Dates440

Programming Example:Birthday Calls449

Testing and Debugging456

Testing and Debugging Hints459

Summary460

Quick Check461

Exam Preparation Exercises464

Programming Warm-up Exercises468

Programming Problems470

12 Arrays475

12.1 One-Dimensional Arrays476

Declaring Arrays478

Accessing Individual Components479

Out-of-Bounds Array Indexes481

Initializing Arrays in Declarations482

(Lack of) Aggregate Array Operations483

Examples of Declaring and Accessing Arrays484

Passing Arrays as Arguments487

Assertions About Arrays489

12.2 Arrays of Records and Class Objects490

Using Typedef with Arrays490

Arrays of Records491

Arrays of Class Objects492

12.3 Special Kinds of Array Processing493

Subarray Processing493

Indexes with Semantic Content494

12.4 Two-Dimensional Arrays494

12.5 Processing Two-Dimensional Arrays498

Sum the Rows499

Sum the Columns500

Initialize the Array501

Print the Array502

12.6 Passing Two-Dimensional Arrays as Arguments503

12.7 Another Way of Defining Two-Dimensional Arrays505

12.8 Multidimensional Arrays507

Programming Example:Comparison of Two Lists510

Programming Example:City Council Election515

Texting and Debugging523

One-Dimensional Arrays523

Complex Structures524

Multidimensional Arrays525

Testing and Debugging Hints526

Summary527

Quick Check528

Exam Preparation Exercises531

Programming Warm-up Exercises536

Programming Problems539

13 Array-Based Lists545

13.1 The List as an Abstract Data Type546

13.2 Unsorted Lists550

Basic Operations550

Insertion and Deletion552

Sequential Search554

Sorting555

13.3 Sorted Lists558

Basic Operations561

Insertion561

Sequential Search564

Binary Search565

Deletion570

13.4 Understanding Character Strings572

Initializing C Strings574

C String Input and Output575

C String Library Routines579

String Class or C Strings?580

Programming Example:Exam Attendance581

Testing and Debugging587

Testing and Debugging Hints588

Summary588

Quick Check589

Exam Preparation Exercises590

Programming Warm-up Exercises592

Programming Problems594

14 Object-Oriented Software Development597

14.1 Object-Oriented Programming598

14.2 Objects600

14.3 Inheritance601

Deriving One Class from Another602

Specification of the ExtTime Class606

Implementation of the ExtTime Class608

Avoiding Multiple Inclusion of Header Files612

14.4 Composition613

Design of a Time Card Class613

Implementation of the TimeCard Class614

14.5 Dynamic Binding and Virtual Functions617

The Slicing Problem618

Virtual Functions620

14.6 Object-Oriented Design622

Step1:Identify the Objects and Operations622

Step2:Determine the Relationships Among Objects623

Step3:Design the Driver624

14.7 Implementing the Design625

Programming Example:Time Card Lookup626

Testing and Debugging645

Testing and Debugging Hints645

Quick Check647

Summary647

Exam Preparation Exercises650

Programming Warm-up Exercises651

Programming Problems653

15 Recursion655

15.1 What Is Recursion?656

15.2 Towers of Hanoi660

15.3 Recursive Algorithms with Structured Variables665

15.4 Recursion of Iteration?666

Testing and Debugging668

Testing and Debugging Hints668

Exam Preparation Exercises669

Quick Check669

Summary669

Programming Warm-up Exercises671

Programming Problems672

Appendix A Reserved Words673

Appendix B Operator Precedence673

Appendix C A Selection of Standard Library Routines675

Appendix D Using This Book with a Prestandard Version of C++684

AppendixE Character Sets689

AppendixF Program Style,Formatting,and Documentation692

Glossary699

Answers to Selected Exercises707

Index729

热门推荐