《programming in c++ = c++程序设计 (第二版 影印版) P752》求取 ⇩

1Overview of Programming and Problem Solving1

1.1 Overview of Programming2

What Is Programming?2

How Do We Write a Program?2

1.2What Is a Programming Language?7

1.3 What Is a Computer?11

1.4Ethics and Responsibilities in the Computing Profession15

Software Piracy15

Privacy of Data16

Use of Computer Resources16

Software Engineering17

1.5 Problem-Solving Techniques17

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


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

2.1The Elements of C++ Programs26

C++ Program Structure26

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.2Program Construction44

Blocks (Compound Statements)46

The C++Preprocessor47

An Introduction to Namespaces49

2.3More About Output50

Creating Blank Lines50

Inserting Blanks Within a Line51

Programming Example: Contest Letter53

Testing and Debugging57


Quick Check59

Exam Preparation Exercises62

Programming Wann-up Exercises65

Programming Problems67

3Numeric Types, Expressions, and Output69

3.1Overview of C++Data Types70

3.2Numeric Data Types70

Integral Types71

Floating-Point Types72

3.3 Declarations for Numeric Types73

Named Constant Declarations73

Variable Declarations74

3.4Simple Arithmetic Expressions74

Arithmetic Operators75

Increment and Decrement Operators78

3.5Compound Arithmetic Expressions78

Precedence Rules79

Type Coercion and Type Casting80

3.6Function Calls and Library Functions83

Value-Retuming Functions83

Library Functions85

Void Functions86

3.7Formatting the Output87

Integers and Strings87

Floating-Point Numbers90

3.8Additional string Operations94

The length and size Functions94

The find Function95

The substr Function97

Programming Example: Map Measurements99

Testing and Debugging102


Quick Check103

Exam Preparation Exercises106

Programming Warm-up Exercises109

Programming Problems113

4Program Input and the Software Design Process115

4.1Getting 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.4File Input and Output127


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.9Functional Decomposition138


A Perspective on Design141

Programming Example: Stretching a Canvas142

Testing and Debugging147

Testing and Debugging Hints148


Quick Check150

Exam Preparation Exercises151

Programming Warm-up Exercises153

Programming Problems155

5Conditions, Logical Expressions, and Selection Control Structures157

5.1Flow of Control158


5.2Conditions and Logical Expressions159

The bool Data Type159

Logical Expressions160

Precedence of Operators166

Relational Operators with Floating-Point Types167

5.3The If Statement168

The If-Then-Else Form169

Blocks (Compound Statements)170

The If-Then Form172

A Common Mistake173

5.4Nested 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


Quick Check195

Exam Preparation Exercises196

Programming Warm-up Exercises199

Programming Problems202


6.1The While Statement206

6.2 Phases of Loop Execution208

6.3Loops Using the While Statement208

Count-Controlled Loops209

Event-Controlled Loops209

Looping Subtasks212

6.4How to Design Loops214

Designing the Flow of Control215

Designing the Process Within the Loop216

The Loop Exit217

6.5Nested Logic217

Designing Nested Loops219

Programming Example: Average Income by Gender220

Testing and Debugging223

Loop-Testing Strategy223

Test Plans Involving Loops224

Testing and Debugging Hints225


Quick Check227

Exam Preparation Exercises228

Programming Warm-up Exercises231

Programming Problems232


7.1 Functional Decomposition with Void Functions236

Writing Modules as Void Functions236

7.2An Overview of User-Defined Functions239

Flow of Control in Function Calls239

Function Parameters240

7.3Syntax and Semantics of Void Functions241

Function Call (Invocation)241

Function Declarations and Denitions242

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 Function265

Testing and Debugging Hints266


Quick Check268

Exam Preparation Exercises269

Programming Warm-up Exercises275

Programming Problems277

8Scope, Lifetime, and More on Functions281

8.1Scope of Identifiers282

Scope Rules284

Variable Declarations and Definitions287


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-Retuming Functions300

When to Use Value-Retuming Functions300

Programming Example: Starship Weight and Balance302

Testing and Debugging310

Stubs and Drivers310

Testing and Debugging Hints311


Quick Check312

Exam Preparation Exercises313

Programming Warm-up Exercises317

Programming Problems319

9Additional Control Structures323

9.1The 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


Quick Check341

Exam Preparation Exercises342

Programming Warm-up Exercises344

Programming Problems346

10Simple 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 sizeof Operator358

The ? : Operator359

Operator Precedence359

10.3 Working with Character Data360

Character Sets361

C++ char Constants362

Programming Techniques363

10.4More on Floating-Point Numbers367

Representation of 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.6More 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

Testing and Debugging391

Floating-Point Data391

Coping with Input Errors391

Testing and Debugging Hints392


Quick Check393

Exam Preparation Exercises395

Programming Warm-up Exercises397

Programming Problems398

11Structured Types, Data Abstraction, and Classes401

11.1Simple Versus Structured Data Types402

11.2Records (C++ Structs)403

Accessing Individual Components405

Aggregate Operations on Structs407

More About Struct Declarations409

Hierarchical Records409

11.3 Unions412

11.4 Data Abstraction413

11.5Abstract Data Types415

11.6C++ 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 TimeType436

Guidelines for Using Class Constructors438

Programming Example: Manipulating Dates440

Programming Example: Birthday Calls449

Testing and Debugging456

Testing and Debugging Hints459


Quick Check461

Exam Preparation Exercises464

Programming Warm-up Exercises468

Programming Problems470


12.1One-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

Using Typedef with Arrays490

12.2 Arrays of Records and Class Objects490

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

Testing and Debugging523

One-Dimensional Arrays523

Complex Structures524

Multidimensional Arrays525

Testing and Debugging Hints526


Quick Check528

Exam Preparation Exercises531

Programming Warm-up Exercises536

Programming Problems539

13Array-Based Lists545

13.1The List as an Abstract Data Type546

13.2 Unsorted Lists550

Basic Operations550

Insertion and Deletion552

Sequential Search554


13.3 Sorted Lists558

Basic Operations561


Sequential Search564

Binary Search565


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


Quick Check589

Exam Preparation Exercises590

Programming Warm-up Exercises592

Programming Problems594

14Object-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 TimeCard Class613

Implementation of the TimeCard Class614

14.5 Dynamic Binding and Virtual Functions617

The Slicing Problem618

Virtual Functions620

14.6 Object-Oriented Design622

Step 1: ldentify the Objects and Operations622

Step 2: Determine the Relationships Among Objects623

Step 3: Design the Driver624

14.7 Implementing the Design625

Programming Example: Time Card Lookup626

Testing and Debugging645

Testing and Debugging Hints645


Quick Check647

Exam Preparation Exercises650

Programming Warm-up Exercises651

Programming Problems653


15.1What Is Recursion?656

15.2 Towers of Hanoi660

15.3 Recursive Algorithms with Structured Variables665

15.4 Recursion or Iteration?666

Testing and Debugging668

Testing and Debugging Hints668


Quick Check669

Exam Preparation Exercises669

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

Appendix E Character Sets689

Appendix F Program Style, Formatting, and Documentation692


Answers to Selected Exercises707


《programming in c++ = c++程序设计 (第二版 影印版) P752》由于是年代较久的资料都绝版了,几乎不可能购买到实物。如果大家为了学习确实需要,博主可为大家寻取其电子版PDF文件,如果内容合法合规可以向博主求助,我会及时受理并将完整页PDF电子档下载地址发送给你(有违法规的内容不受理)。

求助“programming in c++ = c++程序设计 (第二版 影印版) P752”的人还看了

SQL Error: select id,classid,ttid,onclick,plnum,totaldown,newspath,filename,userid,username,firsttitle,isgood,ispic,istop,isqf,ismember,isurl,truetime,lastdotime,havehtml,groupid,userfen,titlefont,titleurl,stb,fstb,restb,keyboard,eckuid,title,ftitle,ssid,isbn,riqi,XGID,cbs,yeshu,newstime,titlepic,smalltext,diggtop from ***_ecms_news where (classid='1') and (id in ()) order by newstime desc limit 15