Tous nos rayons

Déjà client ? Identifiez-vous

Mot de passe oublié ?

Nouveau client ?

CRÉER VOTRE COMPTE
C++
Ajouter à une liste

Librairie Eyrolles - Paris 5e
Indisponible

C++

C++

An introduction to computing

Joel Adams

832 pages, parution le 18/09/1997

Résumé

KEY BENEFIT: Introduces key ideas behind object-oriented programming in an intuitive and unintimidating way.

KEY TOPICS: The book gives readers a solid introduction to traditional computing, scalar objects, and the concepts of reusability, control structures, functions and parameter passing, and modular programming and then proceeds to non-scalar (class) objects, to more fully illustrate the power of C++ objects. The book uses multiple examples and pragmatic, realistic programs to illustrate topics. Reusable program components and good documentation, for easily maintainable programs, are emphasized in both the resentation and examples.

MARKET: Appropriate for anyone interested in computer sciences, engineering, and mathematics using C++ to lay the roundwork in programming.

Table of contents :

 Chapter 0.  BEGINNING SNAPSHOTS                  1 
Part of the Picture: What Is Computer 2
Science?
Part of the Picture: The History of 4
Computing
Early Computing Devices 4
The Stored Program Concept 4
Mechanical Computers 5
Early Electronic Computers 6
Modern Computers 6
System Software 7
A Brief History of C++ and OOP 8
Part of the Picture: Computing History 10
Exercises 17
Part of the Picture: Introduction to 18
Computer Organization
Computing Systems 18
Memory Organization 19
Exercises 21
Part of the Picture: Ethics and Computing 21
Anne Marchant
Exercises 26
Chapter 1. PROBLEM SOLVING AND SOFTWARE 29
ENGINEERING
1.1 Welcome to the World of C++ 32
1.2 Problem Solving through Software 34
Engineering
Problem 34
Object-Centered Design 35
Coding in C++ 39
Testing, Execution, and Debugging 40
Maintenance 42
1.3 Example: Revenue Calculation 43
Problem 43
Object-Centered Design 43
Coding in C++ 45
Testing, Execution, and Debugging 46
Program Maintenance 46
Quick Quiz 1.3 48
Exercises 1.3 48
Chapter 2. TYPES AND EXPRESSIONS 51
2.1 Introductory Example: Einstein's 52
Equation
Problem 52
Object-Centered Design 52
Coding, Execution, and Testing 53
2.2 Declarations: Specifying an Object's 55
Type
Fundamental Types 55
Constant Objects 62
Variable Objects 64
Variable Initialization 66
Quick Quiz 2.2 67
Exercises 2.2 68
Part of the Picture: Data Representation 69
Integers 69
Reals 71
Characters and Strings 72
Booleans 73
2.3 Numeric Expressions 73
Operators 74
Numeric Functions 78
Quick Quiz 2.3 81
Exercises 2.3 81
2.4 Boolean Expressions 82
Simple Boolean Expressions 83
Compound Boolean Expressions 84
Operator Precedence 86
Short-Circuit Evaluation 87
Preconditions and the assert () Mechanism 88
Quick Quiz 2.4 89
Exercises 2.4 89
2.5 Character Expressions 90
Character-Processing Operations 91
Quick Quiz 2.5 91
2.6 Assignment Expressions 92
Assignment as an Operation 96
Chaining Assignment Operators 96
The Increment and Decrement Operations 97
Other Assignment Shortcuts 99
Transforming Expressions into 101
Statements--Semicolons
A Final Word 102
Quick Quiz 2.6 102
Exercises 2.6 103
2.7 Input/Output Expressions 104
I/O Streams 104
Input Expressions 105
Output Expressions 108
Example: Calculating Wages 110
Output Formatting 111
2.8 Example: Truck Fleet Accounting 115
Problem 115
Object-Centered Design 115
Quick Quiz 2.8 118
Exercises 2.8 119
Programming Pointers 121
Program Style and Design 121
Potential Problems 122
Programming Problems 125
Chapter 3. FUNCTIONS 129
3.1 Computing with Expressions 130
Problem: Temperature Conversion 130
Object-Centered Design 130
3.2 Computing with Functions 132
Defining a Function 134
Function Prototypes 138
Calling a Function 140
Local Objects 140
Functions that Return Nothing 142
Summary 144
Quick Quiz 3.2 146
Exercises 3.2 147
3.3 Functions that Use Selection 148
Problem: Finding a Minimum of Two Values 148
Object-Centered Design 148
Sequential Execution 151
Selective Execution 152
Blocks 153
Style 154
Nested ifs 156
Quick Quiz 3.3 157
Exercises 3.3 158
3.4 Functions that Use Repetition 159
Problem: Computing Factorials 159
Object-Centered Design 160
Repeated Execution: The for Statement 163
Processing Several Input Values 166
Quick Quiz 3.4 171
Exercises 3.4 173
3.5 Example: An 8-Function Calculator 175
Problem 175
Object-Centered Design 175
3.6 An Introduction to Libraries 182
Constructing a Library 183
Using a Library in a Program 187
Translating a Library 188
Object-Centered Design: Incorporating 190
Functions and Libraries
Summary 191
Quick Quiz 3.6 193
Part of the Picture: Computability Theory 193
Programming Pointers 194
Program Style and Design 194
Potential Problems 196
Programming Problems 200
Chapter 4. CLASS TYPES AND EXPRESSIONS 205
4.1 Introductory Example: "The Farmer in 206
the Dell"
Problem 206
Object-Centered Design 207
4.2 Introduction to Classes 212
Data Encapsulation 213
Function Members 215
Summary 216
Quick Quiz 4.2 216
4.3 The istream and ostream Classes 217
The istream Class 217
The ostream Class 222
Format Control 225
Quick Quiz 4.3 228
Exercises 4.3 229
4.4 Computing with string Objects 230
Declaring string Objects 231
String I/O 232
Other String Operations 233
Quick Quiz 4.4 245
Exercises 4.4 246
4.5 Example: Decoding Phone Numbers 247
Problem 247
Object-Centered Design 248
Part of the Picture: Simulation 252
Random Number Generators--the RandomInt 253
Class
Example: Modeling a Dice Roll 254
Normal Distributions 256
Programming Pointers 257
Program Style and Design 257
Potential Problems 257
Programming Problems 258
Chapter 5: SELECTION 263
5.1 Introductory Example: The School 264
Mascot Problem
Problem 264
Object-Centered Design 264
5.2 Selection: The if Statement Revisited 268
Understanding the Multibranch if 269
Pitfall: The Dangling-else Problem 270
Pitfall: Confusing = and == 271
Exercises 5.2 273
5.3 Selection: The switch Statement 274
Example: Temperature Conversions 274
Form of the switch Statement 278
The break Statement 279
Drop-Through Behavior 279
Example: Converting Numeric Codes to Names 280
Cases With No Action 283
Choosing the Proper Selection Statement 284
5.4 Example: Computing Letter Grades 286
Problem 286
Object-Centered Design 286
Quick Quiz 5.4 291
Exercises 5.4 292
*5.5 Selection: Conditional Expressions 293
Exercises 5.5 295
Part of the Picture: Boolean Logic and 296
Digital Design
Early Work 296
Digital Circuits 297
Circuit Design: A Binary Half-Adder 297
Part of the Picture: Computer Architecture 300
William Stallings
Processor Registers 301
Control and Status Registers 302
Instruction Execution 303
Instruction Fetch and Execution 303
I/O Function 304
The Memory Hierarchy 305
Input/Output Organization 307
I/O Module Function 307
To Probe Further 309
Programming Pointers 309
Program Style and Design 309
Potential Problems 313
Programming Problems 313
Chapter 6: REPETITION 319
6.1 Introductory Example: The Punishment 320
of Gauss
The Summation Problem 320
Object-Centered Design 320
6.2 Repetition: The for Loop Revisited 323
Nested Loops: Displaying a Multiplication 327
Table
Words of Warning 329
The Forever Loop 330
6.3 Repetition: The while Loop 333
Example: Follow the Bouncing Ball 333
Object-Centered Design 333
The while Statement 336
Loop Conditions vs. Termination Conditions 337
Words of Warning 338
6.4 Repetition: The do Loop 339
Example: How Many Digits? 339
Object-Centered Design 339
A Posttest Loop 343
Loop Conditions vs. Termination Conditions 344
Words of Warning 344
Quick Quiz 6.4 345
Exercises 6.4 347
6.5 Input Loops 350
Running Example: The Mean Time to Failure 350
Problem
Object-Centered Design 350
Input Loops: The Sentinel Approach 351
Input Loops: The Counting Approach 358
Input Loops: The Query Approach 360
6.6 Choosing the Right Loop 364
Decision #1: Use a Counting Loop or a 364
General Loop?
Decision #2: Which General Loop? 364
Quick Quiz 6.6 366
6.7 Example: Calculating Depreciation 366
Problem 366
Object-Centered Design 367
Part of the Picture: Introduction to 373
Algorithm Analysis
Programming Pointers 375
Program Style and Design 375
Potential Problems 376
Programming Problems 379
Chapter 7: FUNCTIONS IN DEPTH 383
7.1 Introductory Example: One-Step Integer 384
Division
Problem 384
Object-Centered Design 384
7.2 Parameters in Depth 388
Value Parameters 388
Reference Parameters 389
const Reference Parameters 392
Using Parameters 395
7.3 Examples of Parameter Usage 395
Problem 1: Decomposing a Name 395
Problem 2: Designing a Coin Dispenser 398
Problem 3: Interchanging the Values of 404
Two Variables
Quick Quiz 7.3 405
Exercises 7.3 406
7.4 Inline Functions 408
Inline Functions and Libraries 409
To inline or Not to inline: A Space-Time 410
Tradeoff
Quick Quiz 7.4 410
7.5 Scope, Overloading, and Templates 411
Scope: Identifier Accessibility 412
Function Signatures and Overloading 419
Function Templates 421
Quick Quiz 7.5 425
*7.6 Introduction to Recursion 426
Example 1: The Factorial Problem Revisited 426
Example 2: Recursive Exponentiation 433
Example 3: Dry Bones! 435
Example 4: Towers of Hanoi 439
Recursion or Iteration? 442
Quick Quiz 7.6 443
Exercises 7.6 444
Part of the Picture: Numerical Methods 446
The Trapezoid Method of Approximating 447
Areas
Problem: Road Construction 450
Object-Centered Design 450
Programming Pointers 453
Program Style and Design 453
Potential Problems 454
Programming Problems 456
Chapter 8: FILES AND STREAMS 461
8.1 Introductory Example: Weather Data 462
Analysis
Problem: Processing Meteorological Data 462
Object-Centered Design 463
8.2 ifstream and ofstream Objects 468
Declaring fstream Objects 468
The Basic fstream Operations 469
fstreams as Parameters 485
Summary 485
Quick Quiz 8.2 486
Exercises 8.2 487
8.3 Example: Scanning for a Virus 488
8.4 Additional fstream Operations 491
The seekg(), tellg(), seekp(), and 492
tellp() Members
The peek() and putback() Members 498
The setstate() Member 500
The Formatting Manipulators 502
Quick Quiz 8.4 504
Part of the Picture: Database Systems 505
Keith Vander Linden
Programming Pointers 511
Program Style and Design 511
Potential Problems 512
Programming Problems 514
Chapter 9: ARRAYS AND vector T S 519
9.1 Introductory Example: Quality Control 520
Problem: Mean Time to Failure 520
Object-Centered Design 521
9.2 C-Style Arrays 525
Array Initialization 528
The Subscript Operation 530
Processing Arrays with for Loops 531
Arrays as Parameters 532
The typedef Mechanism 532
Out-of-Range Errors 534
Predefined Array Operations 536
A Non-OOP Approach 537
An Object-Oriented Approach 540
Quick Quiz 9.2 541
Exercises 9.2 542
9.3 Example: Sorting Employee Information 544
Problem 544
Object-Centered Design 544
9.4 The vector T Class Template 547
A Quick Review of Function Templates 547
Class Templates 548
Defining vector T Objects 548
vector T Function Members 550
vector T Operators 553
The Standard Template Library 558
vector T Function Members Involving 564
Iterators
Decision Making: Use a vector T or a 565
C-Style Array?
Array and vector T Limitations 566
9.5 Example: Processing Test Scores 567
Problem 567
Object-Centered Design 567
Quick Quiz 9.5 574
Exercises 9.5 575
Part of the Picture: Component Programming 577
Computer Hardware 578
Computer Software 578
Programming Pointers 579
Program Style and Design 579
Potential Problems 579
Programming Problems 581
Chapter 10: BUILDING CLASSES 585
10.1 Introductory Example: Modeling 586
Temperatures
Problem: Temperature Conversion 586
Preliminary Analysis 586
Extending Object-Centered Design 587
Object-Centered Design 588
10.2 Designing a Class 590
Class Design 591
The External and Internal Perspectives 591
Temperature Behavior 592
Temperature Attributes 592
10.3 Implementing Class Attributes 593
Encapsulation 593
Information Hiding 594
Class Invariants 595
Conditional Compilation and the Class 595
"Wrapper"
10.4 Implementing Class Operations 597
Temperature Output 597
The Default-Value Constructor 600
Explicit-Value Constructors 602
Accessor Functions 605
Temperature Input 607
Conversion Functions 609
Overloading Operators 610
Summary: The Temperature Class 619
10.5 friend Functions 621
Quick Quiz 10.5 624
Exercises 10.5 625
10.6 Example: Retrieving Student 626
Information
Problem: Information Retrieval 626
Object-Centered Design 627
Part of the Picture: Artificial Intelligence 636
Keith Vander Linden
Programming Pointers 643
Program Style and Design 643
Potential Problems 644
Programming Problems 646
Chapter 11: ENUMERATIONS 649
11.1 Introductory Example: Wavelenghts of 651
Colors
Problem 651
Object-Centered Design 651
11.2 C-Style Enumerations 653
Enumeration Declarations 653
Defining Enumeration Objects 655
Using Enumerations 655
C-Style Enumeration Operations 656
Other Enumeration Operations 659
Libraries and Types 662
Quick Quiz 11.2 663
Exercises 11.2 663
11.3 Object-Oriented Enumerations 664
Declaring Enumeration Classes 664
Defining Color Operations 666
The Color Header File 677
Quick Quiz 11.3 679
Exercises 11.3 679
11.4 Example: Geological Classification 679
Part of the Picture: The C++ Type Hierarchy 690
Programming Pointers 690
Program Style and Design 690
Potential Problems 691
Programming Problems 691
Chapter 12: MULTIDIMENSIONAL ARRAYS 695
12.1 Introductory Example: Mileage between 696
Cities
Problem 696
Preliminary Analysis 696
Object-Centered Design 696
12.2 C-Style Multidimensional Arrays 698
Defining A Two-Dimensional Array 699
Predefined Two-Dimensional Array 701
Operations
Defining Two-Dimensional Array Operations 702
Declaring Three-Dimensional Arrays 705
Operations on Three-Dimensional Arrays 706
Higher-Dimensional Arrays 707
Drawbacks of C-Style Arrays 710
Quick Quiz 12.2 711
Exercises 12.2 712
12.3 Multidimensional vector T Objects 714
Two-Dimensional vector T Objects 715
Two-Dimensional vector T Operations 718
Defining Two-Dimensional vector T 720
Functions
Quick Quiz 12.3 723
Exercises 12.3 723
12.4 A vector T -Based Matrix Library 723
Matrix Multiplication 724
Building a Matrix Class: The External 725
Approach
Matrix Operations 725
Building a Matrix Class: The Internal 729
Approach
Object-Centered Design 737
Application: Solving Linear Systems 737
Quick Quiz 12.4 739
Exercises 12.4 739
Part of the Picture: Computer Graphics 740
Examples: Function Graphing and Density 741
Plots
GUI Windows Application Programming 747
Programming Pointers 749
Program Style and Design 749
Potential Problems 750
Programming Problems 751
Chapter 13: POINTERS AND RUN-TIME ALLOCATION 761
13.1 Introduction to Pointer Variables 762
Declaring and Initializing Pointers 763
Basic Pointer Operations 765
13.2 Run-Time Allocation Using new and 775
delete
The new Operation 776
The delete Operation 783
Summary 790
13.3 The STL list T Class Template 792
A Limitation of vector T 792
Some list T Operations 795
Example: Internet Addresses 804
Part of the Picture: The TCP/IP 808
Communications Architecture
William Stallings
13.4 Pointers and Command-Line Arguments 815
Parameters of the Main Function 816
Example: A Square Root Calculator 818
Command-Line Arguments: Files and Switches 821
Part of the Picture: Data Structures 822
Programming Pointers 823
Program Style and Design 823
Potential Problems 824
Programming Problems 825
Appendixes 829
A. ASCII Character Set 829
B. C++ Keywords 831
C. C++ Operators 833
D. Libraries and Classes 835
C Libraries 835
The string Class 838
The list T Class Template 844
Answers to Quick Quizzes 847
Index 857

Caractéristiques techniques

  PAPIER
Éditeur(s) Prentice Hall
Auteur(s) Joel Adams
Parution 18/09/1997
Nb. de pages 832
Format 235 x 178
EAN13 9780137758005

Avantages Eyrolles.com

Livraison à partir de 0,01 en France métropolitaine
Paiement en ligne SÉCURISÉ
Livraison dans le monde
Retour sous 15 jours
+ d'un million et demi de livres disponibles
satisfait ou remboursé
Satisfait ou remboursé
Paiement sécurisé
modes de paiement
Paiement à l'expédition
partout dans le monde
Livraison partout dans le monde
Service clients sav@commande.eyrolles.com
librairie française
Librairie française depuis 1925
Recevez nos newsletters
Vous serez régulièrement informé(e) de toutes nos actualités.
Inscription