Problem Solving with C++
Home > Computing and Information Technology > Computer programming / software engineering > Programming and scripting languages: general > Problem Solving with C++: The Object of Programming
Problem Solving with C++: The Object of Programming

Problem Solving with C++: The Object of Programming


     0     
5
4
3
2
1



Available


X
About the Book

Problem Solving with C++: The Object of Programming has been used more than any other book to teach the first course on programming in C++. It explains C++ and basic programming techniques in a way suitable for beginning students, but offers a flexible organization that does not tightly prescribe the order in which topics must be covered. The book teaches students how to define their own classes early, while ensuring a solid understanding of basic tools such as simple control structures and function definitions. It takes a measured approach to classes, teaching students how to write some simple classes, then adds constructors, then overloading simple operators, then overloading the I/O operators and , and so forth. Material can be easily rearranged to cover classes earlier or later. *NEW Enhanced chapter on Inheritance. *NEW Chapter on Exception Handling. *NEW Expanded coverage of Templates. *NEW Additional material on vectors. *NEW Contains new exercises and projects, as well as other improvements based upon classroom experience. *Written to allow instructors a wide latitude in reordering the material. *Renowned for a friendly and motivational writing style that is appropriate for beginners.

Table of Contents:
l. Introduction to Computers and C++ Programming. Computer Systems. Hardware. Software. High-Level Languages. Compilers. Self-Test Exercises. History Note. Programming and Problem-Solving. Algorithms. Program Design. The Software Life Cycle. Self-Test Exercises. Introduction to C++. Origins of the C++ Language. A Sample C++ Program. Pitfall-Using the Wrong Slash in \n. Programming Tip-Input and Output Syntax. Pitfall-Putting a Space before the Include File Name. Layout of a Simple C++ Program. Compiling and Running a C++ Program. Self-Test Exercises. Testing and Debugging. Kinds of Program Errors. Pitfall Assuming Your Program Is Correct. Self-Test Exercises. Chapter Summary. Answers to Self-Test Exercises. Programming Projects. 2. C++ BASICS. Variables and Assignments. Variables. Names: Identifiers. Variable Declarations. Assignment Statements. Pitfall initialized Variables. Programming Tip-Use Meaningful Names. Self-Test Exercises. Input and Output. Output Using cout. Escape Sequences. Programming Tip-End Each Program with a \n or endl. Formatting for Numbers with a Decimal Point. Input Using cin. Designing Input and Output. Programming Tip-Line Breaks in I/O. Self-Test Exercises. Data Types and Expressions. The Types int and double. Other Number Types. The Type char. The Type boo? Type Compatibilities. Arithmetic Operators and Expressions. Pitfall--Whole Numbers in Division. Self-Test Exercises. More Assignment Statements. Simple Plow of Control. A Simple Branching Mechanism. Pitfall-Strings of Inequalities. Pitfall-Using = in place of ==. Compound Statements. Self-Test Exercises. Simple Loop Mechanisms. Increment and Decrement Operators. Programming Example-Charge Card Balance. Pitfall-Infinite Loops. Self-Test Exercises. Program Style. Indenting. Comments. Naming Constants. Self-Test Exercises. Chapter Summary. Answers to Self-Test Exercises. Programming Projects. 3. Edural Abstraction and Functions That Return A Value. Top-Down Design. Predefined Functions. Using Predefined Functions. Type Changing Functions. Self-Test Exercises. Programmer-Defined Functions. Function Definitions. Alternate Form for Function Prototypes. Pitfall-Arguments in the Wrong Order. Function Definition-Syntax Summary. More About Placement of Function Definitions. Self-Test Exercises. Procedural Abstraction. The Black Box Analogy. Programming Tip-Choosing Formal Parameter Names. Case Study-Buying Pizza. Programming Tip-Use Pseudocode. Self-Test Exercises. Local Variables. The Small Program Analogy. Programming Example-Experimental Pea Patch. Global Constants and Global Variables. Call-by-Value Formal Parameters Are Local Variables. Self-Test Exercises. Programming Example-The Factorial Function. Overloading Function Names. Introduction to Overloading. Programming Example-Revised Pizza-Buying Program. Automatic Type Conversion. Self-Test Exercises. Chapter Summary. Answers to Self-Test Exercises. Programming Projects. 4. Functions For All Subtasks. Void-Functions. Definitions of void-Functions. Programming Example-Converting Temperatures from Fahrenheit to Celsius. Return-Statements in void-Functions. Self-Test Exercises. Call-by-Reference Parameters. A First View of Call-by-Reference. Call-by-Reference in Detail. Programming Example-The swap-values Function. Mixed Parameter Lists. Programming rip-What Kind of Parameter to Use. Pitfall-Inadvertent Local Variables. Self-Test Exercises. Using Procedural Abstraction. Functions Calling Functions. Preconditions and Postconditions. Case Study-Supermarket Pricing. Self-Test Exercises. Testing and Debugging functions. Stubs and Drivers. Self-Test Exercises. Chapter Summary. Answers to Self-Test Exercises. Programming Projects. 5. I/0 Streams as an Introduction to Objects and Classes. Streams and Basic File I/0. Why Use Files for 1/O? File I/O. Introduction to Classes and Objects. Programming -i-Check that a File Was Opened Successfully. Techniques for File I/O. Self-Test Exercises. File Names as Input (Optional). Tools for Stream I/0. Formatting Output with Stream Functions. Manipulators. Self-Test Exercises. Streams as Arguments to Functions. Programming Tip-Checking for the End of a File. Programming Example-C leaning Up a File Format. Self-Test Exercises. Character I/0. The Member Functions get and put. The putback Member Function (Optional). Programming example--Checking input. Pitfall-Unexpected '\n' in Input. The eof Member Function. Self-Test Exercises. Programming Example-Editing a Text File. Predefined Character Functions. Pitfall-toupper and tolower Return intValues. Self-Test Exercises. Inheritance. Inheritance Among Stream Classes. Programming Example-Another new-1 ine Function. Default Arguments for Functions (Optional). Self-Test Exercises. Chapter Summary. Answers to Self-Test Exercises. Programming Projects. 6. Classes and Abstract Data Types. Structures. Structures for Diverse Data. Pitfall-Forgetting a Semicolon in a Structure Definition. Structures as Function Arguments. Programming Tip-Use Hierarchical Structures. Initializing Structures. Self-Test Exercises. Classes. Defining Classes and Member Functions. Self-Test Exercises. Public and Private Members. Programming Tip-Make All Member Variables Private. Programming Tip-Define Accessor Functions. Programming Tip-Use the Assignment Operator with Objects. Self-Test Exercises. Programming Example-Bank Account Class-Version 1. Summary of Some Properties of Classes. Self-Test Exercises. Constructors for Initialization. Programming Tip--Always Include a Default Constructor. Pitfall Constructors with No Arguments. Self-Test Exercises. Abstract Data Types. Classes to Produce ADTs. Programming Example-Alternative Implementation of a Class. Self-Test Exercises. Chapter Summary. Answers to Self-Test Exercises. Programming Projects. 7. More Flow of Control. Using Boolean Expressions. Evaluating Boolean Expressions. Pitfall-Boolean Expressions Convert to int Values. Self-Test Exercises. Functions That Return a Boolean Value. Self-Test Exercises. Enumeration Types (Optional). Multiway Branches. Nested Statements. Programming Tip-Use Braces in Nested Statements. Multiway if-else-Statements. Programming Example-State Income Tax. Self-Test Exercises. The switch-Statement. Pitfall-Forgetting a break in a switch-Statement. Using switch-Statements for Menus. Programming Tip-Use Function Calls in Branching Statements. Blocks. PitfalL-Inadvertent Local Variables. Self-Test Exercises. More About C++ Loop Statements. The while-Statements Reviewed. Increment and Decrement Operators Revisited. Self-Test Exercises. The for-Statement. Pitfall-Extra Semicolon in a for-Statement. What Kind of Loop to Use. Self-Test Exercises. Pitfall-Uninitialized Variables and Infinite Loops. The break-Statement. Pitfall-The break-Statement in Nested Loops. Self-Test Exercises. Designing Loops. Loops for Sums and Products. Ending a loop. Nested Loops. Self-Test Exercises. Debugging Loops. Self-Test Exercises. Chapter Summary. Answers to Self-Test Exercises. Programming Projects. 8. For Defining ADTs. Defining ADT Operations. Programming Example-An Equality Function. Self-Test Exercise. Friend Functions. Programming Tip-Define Both Accessor Functions and Friend Functions. Programming Tip-Use Both Member and Nonmember Functions. Programming Example-Money ADT (Version 1). Implementation of digit_to_int (Optional). Pitfall--Leading Zeros in Number Constants. Self-Test Exercises. The const Parameter Modifier. Pitfall-Inconsistent Use of const. Self-Test Exercises. Overloading Operators. Self-Test Exercises. Constructors for Automatic Type Conversion. Self-Test Exercises. Overloading Unary Operators. Overloading and . Self-Test Exercise. Separate Compilation. ADTs Reviewed. Case Study-DigitalTime-An ADT Compiled Separately. Programming Tip-Hiding the Helping Functions. Using #ifndef. Programming Tip-Choosing ADT Operations. Programming Tip-Defining Other Libraries. Self-Test Exercises. Chapter Summary. Answers to Self-Test Exercises. Programming Projects. 9. Arrays. Introduction to Arrays. Declaring and Referencing Arrays. Programming Tip-Use for-Loops with Arrays. Arrays in Memory. Pitfall-Array Index Out of Range. Initializing Arrays. Self-Test Exercises. Arrays in Functions. Indexed Variables as Function Arguments. Pitfall--Array Indexes Always Start with Zero. Programming rip-Use a Defined Constant for the Size of an Array. Self-Test Exercises. Entire Arrays as Function Arguments. The const Parameter Modifier. Self-Test Exercises. Programming with Arrays. Case Study-Production Graph. Partially Filled Arrays. Programming Example Searching an Array. Programming Tip-Do Not Skimp on Formal Parameters. Programming Example-Sorting an Array. Self-Test Exercises. Arrays and Classes. Arrays of Classes. Self-Test Exercises. Arrays as Class Members. Programming Example-A Class for a Partially Filled Array. Self-Test Exercises. Chapter Summary. Answers to Self-Test Exercises. Programming Projects. 10. Stings and Multidimensional Arrays. String Basics. Cstring Values and Cstring Variables. Pitfall-Using = and == with Cstrings. Predefined Csfring Functions. Pitfall-Dangers in Using Functions from cstring or string.h. Self-Test Exercises. Defining Cstring Functions. Cstring Input and Output. Cstring-to-Number Conversions and Robust Input. Self-Test Exercises. Multidimensional Arrays. Multidimensional Array Basics. Programming Example Two-dimensional Grading Program. Arrays of Cstrings. Self-Test Exercises. The C++ Standard string Class. Interface for the Standard Class String. Pitfall-Code That Depends on Order of Evaluation is illegal. Programming Tip The Ignore Member Function. Pitfall-Mixing cin variable and getline Can Lose Input. Programming Example-Palindrome Testing. Arrays of Strings Revisited. Self-Test Exercises. Chapter Summary. Answers to Self-Test Exercises. Programming Projects. 11. Pointers and Dynamic Arrays. Pointers. Pointer Variables. Self-Test Exercises. Basic Memory Management. Pitfall--Dangling Pointers. Static, Dynamic, and Automatic Variables. Programming Tip--Define Pointer Types. Self-Test Exercises. Dynamic Arrays. Array Variables and Pointer Variables. Creating and Using Dynamic Arrays. Self-Test Exercises. Pointer Arithmetic (Optional). Classes and Dynamic Arrays. Programming Example-A String Variable Class. Destructors. Pitfall-Pointers as Call-by-Value Parameters. Copy Constructors. Self-Test Exercises. Overloading the Assignment Operator. Self-Test Exercises. Chapter Summary. Answers to Self-Test Exercises. Programming Projects. 12. Recursion. Recursive Functions for Tasks. Case Study--Vertical Numbers. A Closer Look at Recursion. Pitfall---infinite Recursion. Self-Test Exercises. Stacks for Recursion. Pitfall-Stack Overflow. Recursion versus iteration. Self-Test Exercises. Recursive Functions for Values. General Form for a Recursive Function That Returns a Value. Programming Example-Another Powers Function. Self-Test Exercises. Thinking Recursively. Recursive Design Techniques. Case Study-Binary Search- An Example of Recursive Thinking. Programming Example-A Recursive Member Function. Self-Test Exercises. Chapter Summary. Answers to Self-Test Exercises. Programming Projects. 13. Templates is For More Abstraction. Templates for Algorithm Abstraction. Templates for Functions. Pitfall-Compiler Complications. Self-Test Exercises. Programming Example-A Generic Sorting Function. Programming Tip--How to Define Templates. Self-Test Exercise. Templates for Data Abstraction. Syntax for Class Templates. Programming Example-An Array Class. Self-Test Exercises. Chapter Summary. Answers to Self-Test Exercises. Programming Projects. 14. Nodes and Linked Lists. Nodes and Linked Lists. Nodes. Self-Test Exercises. Linked Lists. Inserting a Node at the Head of a List. Pitfall-Losing Nodes. Searching a Linked List. Inserting and Removing Nodes Inside a List. Pitfall--Using the Assignment Operator with Dynamic Data Structures. Self-Test Exercises. A Linked List Application. Stacks. Programming Example--A Stock ADT. Self-Test Exercises. Chapter Summary. Answers to Self-Test Exercises. Programming Projects. 15. Inheritance. Inheritance Basics. The Notation of Inheritance. Constructor Base Initialization List. Derived Classes. Redefinition of Member Functions. Self-Test Exercises. Programming with Inheritance. Self-Test Exercises. Overloading, Overriding, Redefinition (Optional). Virtual Functions and Extended Type Computability. Pitfall-The Slicing Problem. Pitfall-Not Using Virtual Member Functions. Pitfall-Attempting to Compile Class Definitions without Definitions for Every. Virtual Member Function. Programming Example. Self-Test Exercises. Chapter Summary. Answers to Self-Test Exercises. Programming Projects. 16. Exception Handling. Exception-Handling Basics. A Toy Example of Exception Handling. Self-Test Exercises. Defining Your Own Exception Classes. Multiple Throws and Catches. Pitfall-Catch the More Specific Exception First. Programming Tip-Exception Classes Can Be Trivial. Throwing an Exception in a Function. Pitfall-Throw List in Derived Classes. Self-Test Exercises. Programming Techniques for Exception Handling. When to Throw an Exception. Pitfall-Uncaught Exceptions. Pitfall-Nested try-catch-Blocks. Pitfall-Overuse of Exceptions. Exception Class Hierarchies. Testing for Available Memory. Rethrowing an Exception. Self-Test Exercises. Chapter Summary. Answers to Self-Test Exercises. Programming Projects. Appendix 1. C++ Keywords. Appendix 2. Precedence of Operators. Appendix 3. The ASCII Character Set. Appendix 4. Some Library Functions. Arithmetic Functions. Input and Output Member Functions. Character Functions. String Functions. Random Number Generator. Trigonometric Functions. Appendix 5. The Assert-Statement. Appendix 6. Inline Functions. Appendix 7. Constructor Initialization Section. Appendix 8. Overloading the Array Index Square Brackets. Appendix 9. The this Pointer. Appendix 10. Simulating the bool Type. Appendix 11. Old and New Header Files. Appendix 12. Overloading Operators as Member Operator. Bibliography for C++ Language and Library Issues.


Best Sellers


Product Details
  • ISBN-13: 9780201703900
  • Publisher: Pearson Education (US)
  • Publisher Imprint: Pearson
  • Height: 232 mm
  • No of Pages: 974
  • Sub Title: The Object of Programming
  • Width: 188 mm
  • ISBN-10: 0201703904
  • Publisher Date: 30 Nov 2000
  • Binding: Paperback
  • Language: English
  • Spine Width: 34 mm
  • Weight: 1448 gr


Similar Products

Add Photo
Add Photo

Customer Reviews

REVIEWS      0     
Click Here To Be The First to Review this Product
Problem Solving with C++: The Object of Programming
Pearson Education (US) -
Problem Solving with C++: The Object of Programming
Writing guidlines
We want to publish your review, so please:
  • keep your review on the product. Review's that defame author's character will be rejected.
  • Keep your review focused on the product.
  • Avoid writing about customer service. contact us instead if you have issue requiring immediate attention.
  • Refrain from mentioning competitors or the specific price you paid for the product.
  • Do not include any personally identifiable information, such as full names.

Problem Solving with C++: The Object of Programming

Required fields are marked with *

Review Title*
Review
    Add Photo Add up to 6 photos
    Would you recommend this product to a friend?
    Tag this Book Read more
    Does your review contain spoilers?
    What type of reader best describes you?
    I agree to the terms & conditions
    You may receive emails regarding this submission. Any emails will include the ability to opt-out of future communications.

    CUSTOMER RATINGS AND REVIEWS AND QUESTIONS AND ANSWERS TERMS OF USE

    These Terms of Use govern your conduct associated with the Customer Ratings and Reviews and/or Questions and Answers service offered by Bookswagon (the "CRR Service").


    By submitting any content to Bookswagon, you guarantee that:
    • You are the sole author and owner of the intellectual property rights in the content;
    • All "moral rights" that you may have in such content have been voluntarily waived by you;
    • All content that you post is accurate;
    • You are at least 13 years old;
    • Use of the content you supply does not violate these Terms of Use and will not cause injury to any person or entity.
    You further agree that you may not submit any content:
    • That is known by you to be false, inaccurate or misleading;
    • That infringes any third party's copyright, patent, trademark, trade secret or other proprietary rights or rights of publicity or privacy;
    • That violates any law, statute, ordinance or regulation (including, but not limited to, those governing, consumer protection, unfair competition, anti-discrimination or false advertising);
    • That is, or may reasonably be considered to be, defamatory, libelous, hateful, racially or religiously biased or offensive, unlawfully threatening or unlawfully harassing to any individual, partnership or corporation;
    • For which you were compensated or granted any consideration by any unapproved third party;
    • That includes any information that references other websites, addresses, email addresses, contact information or phone numbers;
    • That contains any computer viruses, worms or other potentially damaging computer programs or files.
    You agree to indemnify and hold Bookswagon (and its officers, directors, agents, subsidiaries, joint ventures, employees and third-party service providers, including but not limited to Bazaarvoice, Inc.), harmless from all claims, demands, and damages (actual and consequential) of every kind and nature, known and unknown including reasonable attorneys' fees, arising out of a breach of your representations and warranties set forth above, or your violation of any law or the rights of a third party.


    For any content that you submit, you grant Bookswagon a perpetual, irrevocable, royalty-free, transferable right and license to use, copy, modify, delete in its entirety, adapt, publish, translate, create derivative works from and/or sell, transfer, and/or distribute such content and/or incorporate such content into any form, medium or technology throughout the world without compensation to you. Additionally,  Bookswagon may transfer or share any personal information that you submit with its third-party service providers, including but not limited to Bazaarvoice, Inc. in accordance with  Privacy Policy


    All content that you submit may be used at Bookswagon's sole discretion. Bookswagon reserves the right to change, condense, withhold publication, remove or delete any content on Bookswagon's website that Bookswagon deems, in its sole discretion, to violate the content guidelines or any other provision of these Terms of Use.  Bookswagon does not guarantee that you will have any recourse through Bookswagon to edit or delete any content you have submitted. Ratings and written comments are generally posted within two to four business days. However, Bookswagon reserves the right to remove or to refuse to post any submission to the extent authorized by law. You acknowledge that you, not Bookswagon, are responsible for the contents of your submission. None of the content that you submit shall be subject to any obligation of confidence on the part of Bookswagon, its agents, subsidiaries, affiliates, partners or third party service providers (including but not limited to Bazaarvoice, Inc.)and their respective directors, officers and employees.

    Accept

    New Arrivals


    Inspired by your browsing history


    Your review has been submitted!

    You've already reviewed this product!