Absolute C++ with MyProgrammingLab (International ed of 5th revised)

個数:

Absolute C++ with MyProgrammingLab (International ed of 5th revised)

  • 在庫がございません。海外の書籍取次会社を通じて出版社等からお取り寄せいたします。
    通常6~9週間ほどで発送の見込みですが、商品によってはさらに時間がかかることもございます。
    重要ご説明事項
    1. 納期遅延や、ご入手不能となる場合がございます。
    2. 複数冊ご注文の場合、分割発送となる場合がございます。
    3. 美品のご指定は承りかねます。

    ●3Dセキュア導入とクレジットカードによるお支払いについて
  • 【入荷遅延について】
    世界情勢の影響により、海外からお取り寄せとなる洋書・洋古書の入荷が、表示している標準的な納期よりも遅延する場合がございます。
    おそれいりますが、あらかじめご了承くださいますようお願い申し上げます。
  • ◆画像の表紙や帯等は実物とは異なる場合があります。
  • ◆ウェブストアでの洋書販売価格は、弊社店舗等での販売価格とは異なります。
    また、洋書販売価格は、ご注文確定時点での日本円価格となります。
    ご注文確定後に、同じ洋書の販売価格が変動しても、それは反映されません。
  • 商品コード 9780273769354
  • DDC分類 005.133

Full Description


For undergraduate students in Computer Science and Computer Programming courses.Praised for providing an engaging balance of thoughtful examples and explanatory discussion, best-selling author Walt Savitch and contributor Kenrick Mock explain concepts and techniques in a straightforward style using understandable language and code enhanced by a suite of pedagogical tools. Absolute C++ is appropriate for both introductory and intermediate programming courses introducing C++.MyProgrammingLab, Pearson's online homework and assessment tool, is available with this edition.

Contents

>Contents Chapter 1 C++ Basics 11.1 Introduction to C++ 2Origins of the C++ Language 2C++ and Object-Oriented Programming 3The Character of C++ 3C++ Terminology 4A Sample C++ Program 41.2 Variables, Expressions, and Assignment Statements 6Identifiers 6Variables 8Assignment Statements 10Pitfall: Uninitialized Variables 12Tip: Use Meaningful Names 13More Assignment Statements 13Assignment Compatibility 14Literals 15Escape Sequences 17Naming Constants 17Arithmetic Operators and Expressions 19Integer and Floating-Point Division 21Pitfall: Division with Whole Numbers 22Type Casting 22Increment and Decrement Operators 25Pitfall: Order of Evaluation 271.3 Console Input/Output 28Output Using cout 28New Lines in Output 29Tip: End Each Program with \n or endl 30Formatting for Numbers with a Decimal Point 31Output with cerr 32Input Using cin 32Tip: Line Breaks in I/O 341.4 Program Style 34Comments 351.5 Libraries and Namespaces 35Libraries and include Directives 36Namespaces 36Pitfall: Problems with Library Names 37Chapter Summary: 38Answers to Self-Test Exercises 39Programming Projects 40Chapter 2 Flow of Control 432.1 Boolean Expressions 44Building Boolean Expressions 44Pitfall: Strings of Inequalities 45Evaluating Boolean Expressions 46Precedence Rules 48Pitfall: Integer Values Can Be Used as Boolean Values 522.2 Branching Mechanisms 54if-else Statements 54Compound Statements 56Pitfall: Using = in Place of == 57Omitting the else 59Nested Statements 59Multiway if-else Statement 59The switch Statement 60Pitfall: Forgetting a break in a switch Statement 63Tip: Use switch Statements for Menus 63Enumeration Types 64The Conditional Operator 642.3 Loops 65The while and do-while Statements 66Increment and Decrement Operators Revisited 68The Comma Operator 70The for Statement 72Tip: Repeat-N-Times Loops 74Pitfall: Extra Semicolon in a for Statement 75Pitfall: Infinite Loops 75The break and continue Statements 78Nested Loops 812.4 Introduction to File InputReading From a Text File Using ifstreamChapter Summary 81Answers to Self-Test Exercises 82Programming Projects 87Chapter 3 Function Basics 913.1 Predefined Functions 92Predefined Functions That Return a Value 92Predefined void Functions 97A Random Number Generator 993.2 Programmer-Defined Functions 103Defining Functions That Return a Value 103Alternate Form for Function Declarations 106Pitfall: Arguments in the Wrong Order 107Pitfall: Use of the Terms Parameter and Argument 107Functions Calling Functions 107Example: A Rounding Function 107Functions That Return a Boolean Value 110Defining void Functions 111return Statements in void Functions 113Preconditions and Postconditions 113main Is a Function 115Recursive Functions 1163.3 Scope Rules 117Local Variables 117Procedural Abstraction 120Global Constants and Global Variables 121Blocks 124Nested Scopes 124Tip: Use Function Calls in Branching and Loop Statements 125Variables Declared in a for Loop 125Chapter Summary 126Answers to Self-Test Exercises 126Programming Projects 130Chapter 4 Parameters and Overloading 1374.1 Parameters 138Call-by-Value Parameters 138A First Look at Call-by-Reference Parameters 141Call-by-Reference Mechanism in Detail 143Constant Reference Parameters 145Example: The swapValues Function 146Tip: Think of Actions, Not Code 147Mixed Parameter Lists 148Tip: What Kind of Parameter to Use 149Pitfall: Inadvertent Local Variables 151Tip: Choosing Formal Parameter Names 153Example: Buying Pizza 1534.2 Overloading and Default Arguments 156Introduction to Overloading 156Pitfall: Automatic Type Conversion and Overloading 159Rules for Resolving Overloading 160Example: Revised Pizza-Buying Program 162Default Arguments 1644.3 Testing and Debugging Functions 166The assert Macro 166Stubs and Drivers 167Chapter Summary 170Answers to Self-Test Exercises 171Programming Projects 172Chapter 5 Arrays 1775.1 Introduction to Arrays 178Declaring and Referencing Arrays 178Tip: Use for Loops with Arrays 181Pitfall: Array Indexes Always Start with Zero 181Tip: Use a Defined Constant for the Size of an Array 181Arrays in Memory 182Pitfall: Array Index Out of Range 184Initializing Arrays 1845.2 Arrays in Functions 187Indexed Variables as Function Arguments 187Entire Arrays as Function Arguments 188The const Parameter Modifier 192Pitfall: Inconsistent Use of const Parameters 193Functions That Return an Array 194Example: Production Graph 1945.3 Programming with Arrays 200Partially Filled Arrays 200Tip: Do Not Skimp on Formal Parameters 200Example: Searching an Array 203Example: Sorting an Array 2055.3 Multidimensional Arrays 210Multidimensional Array Basics 210Multidimensional Array Parameters 212Example: Two-Dimensional Grading Program 213Chapter Summary 218Answers to Self-Test Exercises 219Programming projects 223Chapter 6 Structures and Classes 2316.1 Structures 232Structure Types 234Pitfall: Forgetting a Semicolon in a Structure Definition 238Structures as Function Arguments 238Tip: Use Hierarchical Structures 239Initializing Structures 2426.2 Classes 244Defining Classes and Member Functions 244Encapsulation 250Public and Private Members 251Accessor and Mutator Functions 255Tip: Separate Interface and Implementation 257Tip: A Test for Encapsulation 258Structures versus Classes 259Tip: Thinking Objects 261Chapter Summary 261Answers to Self-Tesr Exercises 262Programming Projects 264Chapter 7 Constructors and Other Tools 2677.1 Constructors 268Constructor Definitions 268Pitfall: Constructors with No Arguments 273Explicit Constructor Calls 275Tip: Always Include a Default Constructor 275Example: BankAccount Class 278Class Type Member Variables 2857.2 More Tools 288The const Parameter Modifier 288Pitfall: Inconsistent Use of const 290Inline Functions 295Static Members 297Nested and Local Class Definitions 3007.3 Vectorsツ A Preview of the Standard Template Library 301Vector Basics 301Pitfall: Using Square Brackets beyond the Vector Size 303Tip: Vector Assignment Is Well Behaved 305Efficiency Issues 305Chapter Summary 307Answers to Self-Test Exercises 307Programming Projects 309Chapter 8 Operator Overloading, Friends, and References 3158.1 Basic Operator Overloading 316Overloading Basics 317Tip: A Constructor Can Return an Object 322Returning by const Value 323Tip: Returning Member Variables of a Class Type 326Overloading Unary Operators 327Overloading as Member Functions 328Tip: A Class Has Access to All Its Objects 330Overloading Function Application ( ) 331Pitfall: Overloading &&, ||, and the Comma Operator 3318.2 Friend Functions and Automatic Type Conversion 332Constructors for Automatic Type Conversion 332Pitfall: Member Operators and Automatic Type Conversion 333Friend Functions 334Friend Classes 336Pitfall: Compilers without Friends 3388.3 References and More Overloaded Operators 339References 339Pitfall: Returning a Reference to Certain Member Variables 341Overloading >> and << 341Tip: What Mode of Returned Value to Use 348The Assignment Operator 350Overloading the Increment and Decrement Operators 351Overloading the Array Operator [ ] 354Overloading Based on L-Value versus R-Value 356Chapter Summary 356Answers to Self-Test Exercises 356Programming Projects 359Chapter 9 Strings 3639.1 An Array Type for Strings 364C-String Values and C-String Variables 365Pitfall: Using = and == with C-strings 369Other Functions in 370Example: Command-Line Arguments 373C-String Input and Output 3759.2 Character Manipulation Tools 378Character I/O 378The Member Functions get and put 379Example: Checking Input Using a Newline Function 381Pitfall: Unexpected '\n' in Input 383The putback, peek, and ignore Member Functions 384Character-Manipulating Functions 387Pitfall: toupper and tolower Return int Values 3899.3 The Standard Class string 390Introduction to the Standard Class string 391I/O with the Class string 394Tip: More Versions of getline 397Pitfall: Mixing cin >> variable; and getline 398String Processing with the Class string 399Example: Palindrome Testing 403Converting between string Objects and C-Strings 407Chapter Summary 407Answers to Self-Test Exercises 408Programming Projects 412Chapter 10 Pointers and Dynamic Arrays 41910.1 Pointers 420Pointer Variables 421Basic Memory Management 429Pitfall: Dangling Pointers 432Dynamic Variables and Automatic Variables 432Tip: Define Pointer Types 433Pitfall: Pointers as Call-by-Value Parameters 435Uses for Pointers 43710.2 Dynamic Arrays 438Array Variables and Pointer Variables 438Creating and Using Dynamic Arrays 439Example: A Function That Returns an Array 443Pointer Arithmetic 445Multidimensional Dynamic Arrays 44610.3 Classes, Pointers, and Dynamic Arrays 449The -> Operator 449The this Pointer 450Overloading the Assignment Operator 451Example: A Class for Partially Filled Arrays 453Destructors 462Copy Constructors 463Chapter Summary 467Answers to Self-Test Exercises 468Programming Projects 470Chapter 11 Separate Compilation and Namespaces 47311.1 Separate Compilation 474Encapsulation Reviewed 475Header Files and Implementation Files 476Example: DigitalTime Class 484Tip: Reusable Components 485Using #ifndef 485Tip: Defining Other Libraries 48811.2 Namespaces 489Namespaces and using Directives 489Creating a Namespace 491Using Declarations 494Qualifying Names 496Tip: Choosing a Name for a Namespace 498Example: A Class Definition in a Namespace 498Unnamed Namespaces 499Pitfall: Confusing the Global Namespace and the Unnamed Namespace 506Tip: Unnamed Namespaces Replace the static Qualifier 507Tip: Hiding Helping Functions 507Nested Namespaces 508Tip: What Namespace Specification Should You Use? 508Chapter Summary 511Answers to Self-Test Exercises 512Programming Projects 513Chapter 12 Streams and File I/O 51912.1 I/O Streams 521File I/O 521Pitfall: Restrictions on Stream Variables 526Appending to a File 526Tip: Another Syntax for Opening a File 528Tip: Check That a File Was Opened Successfully 530Character I/O 532Checking for the End of a File 53312.2 Tools for Stream I/O 537File Names as Input 537Formatting Output with Stream Functions 538Manipulators 542Saving Flag Settings 543More Output Stream Functions 544Example: Cleaning Up a File Format 546Example: Editing a Text File 54812.3 Stream Hierarchies: A Preview of Inheritance 551Inheritance among Stream Classes 551Example: Another newLine Function 553Parsing Strings with the stringstream Class12.4 Random Access to Files 557Chapter Summary 559Answers to Self-Test Exercises 559Programming Projects 562Chapter 13 Recursion 57113.1 Recursive void Functions 573Example: Vertical Numbers 573Tracing a Recursive Call 576A Closer Look at Recursion 579Pitfall: Infinite Recursion 580Stacks for Recursion 582Pitfall: Stack Overflow 583Recursion versus Iteration 58413.2 Recursive Functions That Return a Value 585General Form for a Recursive Function That Returns a Value 585Example: Another Powers Function 586Mutual Recursion13.3 Thinking Recursively 591Recursive Design Techniques 591Binary Search 592Coding 594Checking The Recursion 598Efficiency 598Chapter Summary 600Answers to Self-Test Exercises 601Programming Projects 605Chapter 14 Inheritance 60914.1 Inheritance Basics 610Derived Classes 610Constructors in Derived Classes 620Pitfall: Use of Private Member Variables from the Base Class 622Pitfall: Private Member Functions Are Effectively Not Inherited 624The protected Qualifier 624Redefinition of Member Functions 627Redefining versus Overloading 628Access to a Redefined Base Function 630Functions That Are Not Inherited 63114.2 Programming with Inheritance 632Assignment Operators and Copy Constructors in Derived Classes 632Destructors in Derived Classes 633Example: Partially Filled Array with Backup 634Pitfall: Same Object on Both Sides of the Assignment Operator 643Example: Alternate Implementation of PFArrayDBak 643Tip: A Class Has Access to Private Members of All Objects of the Class 646Tip: ツ Is aツ versus ツ Has aツ 646Protected and Private Inheritance 647Multiple Inheritance 648Chapter Summary 649Answers to Self-Test Exercises 649Programming Projects 651Chapter 15 Polymorphism and Virtual Functions 65715.1 Virtual Function Basics 658Late Binding 658Virtual Functions in C++ 659Tip: The Virtual Property Is Inherited 666Tip: When to Use a Virtual Function 666Pitfall: Omitting the Definition of a Virtual Member Function 667Abstract Classes and Pure Virtual Functions 667Example: An Abstract Class 66915.2 Pointers and Virtual Functions 671Virtual Functions and Extended Type Compatibility 671Pitfall: The Slicing Problem 675Tip: Make Destructors Virtual 676Downcasting and Upcasting 677How C++ Implements Virtual Functions 678Chapter Summary 680Answers to Self-Test Exercises 681Programming Projects 682Chapter 16 Templates 68716.1 Function Templates 688Syntax for Function Templates 690Pitfall: Compiler Complications 693Tip: How to Define Templates 694Example: A Generic Sorting Function 695Pitfall: Using a Template with an Inappropriate Type 70016.1 Class Templates 702Syntax for Class Templates 703Example: An Array Template Class 707The vector and basic_string Templates 71316.3 Templates and Inheritance 713Example: Template Class for a Partially Filled Array with Backup 714Chapter Summary 720Answers to Self-Test Exercises 720Programming Projects 723Chapter 17 Linked Data Structures 72517.1 Nodes and Linked Lists 727Nodes 727Linked Lists 732Inserting a Node at the Head of a List 734Pitfall: Losing Nodes 737Inserting and Removing Nodes Inside a List 737Pitfall: Using the Assignment Operator with Dynamic Data Structures 741Searching a Linked List 742Doubly Linked Lists 744Adding a Node to a Doubly Linked List 746Deleting a Node from a Doubly Linked List 748Example: A Generic Sorting Template Version of Linked List Tools 75317.2 Linked List Applications 757Example: A Stack Template Class 757Example: A Queue Template Class 764Tip: A Comment on Namespaces 767Friend Classes and Similar Alternatives 768Example: Hash Tables with Chaining 771Efficiency of Hash Tables 777Example: A Set Template Class 778Efficiency of Sets Using Linked Lists 78417.3 Iterators 785Pointers as Iterators 786Iterator Classes 786Example: An Iterator Class 78817.4 Trees 974Tree Properties 795Example: A Tree Template Class 797Chapter Summary 802Answers to Self-Test Exercises 803Programming Projects 812Chapter 18 Exception Handling 81918.1 Exception Handling Basics 821A Toy Example of Exception Handling 821Defining Your Own Exception Classes 830Multiple Throws and Catches 830Pitfall: Catch the More Specific Exception First 834Tip: Exception Classes Can Be Trivial 835Throwing an Exception in a Function 835Exception Specification 837Pitfall: Exception Specification in Derived Classes 83918.2 Programming Techniques for Exception Handling 840When to Throw an Exception 841Pitfall: Uncaught Exceptions 842Pitfall: Nested try-catch Blocks 843Pitfall: Overuse of Exceptions 843Exception Class Hierarchies 844Testing for Available Memory 844Rethrowing an Exception 845Chapter Summary 845Answers to Self-Test Exercises 845Programming Projects 847Chapter 19 Standard Template Library 85119.1 Iterators 853Iterator Basics 853Pitfall: Compiler Problems 858Kinds of Iterators 859Constant and Mutable Iterators 862Reverse Iterators 864Other Kinds of Iterators 86519.2 Containers 86ontainers 866Pitfall: Iterators and Removing Elements 872Tip: Type Definitions in Containers 872The Container Adapters stack and queue 872Pitfall: Underlying Containers 873The Associative Containers set and map 876Efficiency 88119.3 Generic Algorithms 883Running Times and Big-O Notation 884Container Access Running Times 888Nonmodifying Sequence Algorithms 889Modifying Sequence Algorithms 894Set Algorithms 895Sorting Algorithms 897Chapter Summary 897Answers to Self-Test Exercises 898Programming Projects 900Chapter 20 Patterns and UML 90720.1 Patterns 908Adapter Pattern 909The Model-View-Controller Pattern 909Example: A Sorting Pattern 911Efficiency of the Sorting Pattern 917Tip: Pragmatics and Patterns 918Pattern Formalism 919UML 919History of UML 920UML Class Diagrams 920Class Interactions 921Chapter Summary 921Answers to Self-Test Exercises 922Programming Projects 923Appendix 1 C++ Keywords 927Appendix 2 Precedence of Operators 929Appendix 3 The ASCII Character Set 931Appendix 4 Some Library Functions 933Appendix 5 Old and New Header Files 941Index 945

最近チェックした商品