Learning to Program in C++

Learning to Program in C++

3.5 (2 ratings by Goodreads)
By (author) 

List price: US$47.99

Currently unavailable

Add to wishlist

AbeBooks may have this title (opens in new window).

Try AbeBooks

Description

For introductory courses in C++.There are dozens of introductory C++ books on the market, but few of them are effective in training the complete novice, as they make too many assumptions of prior knowledge. Unlike other introductory C++ books, this book was developed with the assistance of a complete novice to the language. Her comments are questions were incorporated in the text to assist readers who have had no previous experience with programming.Many readers, whether taking formal C++ course or studying on their own, report that the approach this book takes is far superior to any other they have encountered. A number of customer comments on Amazon.com also testify to its effectiveness.
show more

Product details

  • Mixed media product | 1120 pages
  • 178.8 x 238.3 x 40.4mm | 1,564.91g
  • Prentice Hall
  • Upper Saddle River, United States
  • English
  • 0130324108
  • 9780130324108

Table of contents

Foreword. Preface. Acknowledgements. Letter from a Novice. 1. Introduction to Programming. Definitions. How to Write a Program. Baby Steps. On with the Show.2. Hardware Fundamentals. Definitions. Objectives of This Chapter. Behind the Curtain. Disk. 1985: A Space Odyssey. RAM. Return to Sender, Address Unknown. The CPU. RAM vs CPU Speeds. A Memory Hierarchy. Caching In. Please Register Here. Odometer Trouble. The First Few Numbers. The Next Few Numbers. How Many Combinations? Back to the Future. Over-Hexed. Binary to Hex Conversion Table. Different Representations of the Same Numbers. Exercises. Registering Relief. 32 and 16 Bit Registers, before Add Ax,1. 32 and 16 Bit Registers, after Add Ax,1. 32 and 16 Bit Registers, after Add Eax,1. On a RAMpage. Registering Bewilderment. 32- and 16-Bit Register Codes. Slimming the Program. A Fetching Tale. Instruction Execution Time, Using Registers and Prefetching. Review. Conclusion. Answers to Exercises.3. Basics of Programming. Definitions. Objectives of This Chapter. Speed Demon. Blaming It on the Computer. That Does Not Compute. Lost in Translation. A Little Numeric Calculation. What's Going on Underneath? A Small Section of RAM. Who's on First? One Little Endian. A Big Endian Example. Exercises, First Set. Exercise 1. Underware? A Really Little Numeric Calculation. Compiling, Part 3. Execution Is Everything. A Cast of Characters. Some Real Characters and Strings (Code\Basic00.Cc). Yet Another Small Section of RAM. A Byte by Any Other Name. Some Strings Attached. Special Characters for Program Text. Exercises, Second Set. A Small Section of RAM. In and Out. Some Simple Output (Code\Basic01.Cc). Some Simple Input and Output (Code\Basic02.Cc). If Only You Knew. Using an If Statement (Code\Basic03.Cc). While We're on the Subject. Using a While Statement (Code\Basic04.Cc). Exercises, Third Set. Just Up the Block. At the Fair. A C++ Program (Code\Pump1.Cc). Novice Alert. Take It for a Spin. Exercises, Fourth Set. Review. Conclusion. Answers to Exercises. First Dinner Party Program (Code\Basic05.Cc). Second Dinner Party Program (Code\Basic06.Cc). Else If Example. Name and Age Program (Code\Basic07.Cc). Novice Program (Code\Basic08.Cc). Allowance Program (Code\Basic09.Cc).4. More Basics. Objectives of This Chapter. Algorithmic Thinking. Finding the Top Two Weights, First Try (Code\Pump1a.Cc). A Prize Catch. Susan's Solution to the Bug in the First Attempt. Using an If Statement with an Else Clause. Finding the Top Two Weights (Code\Pump2.Cc). What A Tangled Web We Weave. You May Already Have Won. Variables, By The Numbers. Using A Vector (Code\Vect1.Cc). Zero Isn't Nothing. Index Variables. Using A For Statement (From Code\Vect1.Cc). Sorting The Weights (From Code\Vect1.Cc). Elements Vs Values. Details, Details. Initial Situation. After The First Pass. After The Second Pass. Final Situation. To Err Is Human. A Possible Error Message. Sorting The Weights, Again (From Code\Vect1.Cc). Sorting The Weights, With Correct Initialization (From Code\Vect2.Cc). To Really Foul Things Up Requires A Computer. What, Me Worry? Garbage In, Garbage Out. Garbage Prevention, First Attempt (From Code\Vect2a.Cc). Finding The Top Three Weights Using Vectors (Code\Vect3.Cc). Review. Exercises. Exercise 1 (Code\Morbas00.Cc). Exercise 2 (Code\Morbas01.Cc). Conclusion. Answers To Exercises. Weight Requesting Program, First Try (Code\Morbas02.Cc). Error Messages From The Erroneous Weight Program (Code\Morbas02.Cc). The Corrected Weight Program (Code\Morbas03.Cc). The Weight Totaling Program (Code\Morbas04.Cc).5. Functional Literacy. Definitions. Objectives of This Chapter. Functioning Normally. A Sample Program with Duplicated Code (Code\Nofunc.Cc). A Function Call. Above Average. A Function to Average Two Values. Return to Sender. For the Sake of Argument. Argument Passing with One Argument (Code\Birthday.Cc). General Delivery. Using a Function. Using the Average Function (Code\Func1.Cc). A Convincing Argument. The Man Behind the Curtain. The Object of My Affections. Making an Executable. Operating Systematically. Using Your Library Card. Automatic Pilot. Stacking the Deck. A Stack with One Entry. A Stack with Two Entries. A Stack with Three Entries. Don't Call Me, I'll Call You. How It All Stacks Up. An Empty Stack. The Stack Immediately after the Call to Average. The Stack after Auto Variable Allocation. Scoped Out. Scope Vs Storage Class. Static Cling. Using an Auto Variable and Initializing It (Code\Count1.Cc). Using an Auto Variable and Not Initializing It (Code\Count2.Cc). Using a Local Static Variable and Initializing It (Code\Count3.Cc). Using a Local Static Variable and Not Initializing It (Code\Count4.Cc). Using a Global Variable and Not Initializing It (Code\Count6.Cc). Using a Global Variable and Initializing It (Code\Count5.Cc). Using Variables of Different Scopes and Storage Classes (Code\Scopclas.Cc). The Results of Using Variables of Different Scopes and Storage Classes (Code\Scopclas.Out). Exercises, First Set. Exercise 1a (Code\Inita.Cc). Exercise 1b (Code\Initb.Cc). Exercise 1c (Code\Initc.Cc). Exercise 1d (Code\Initd.Cc). Exercise 1e (Code\Inite.Cc). Exercise 1f (Code\Initf.Cc). Think Globally? A BASIC Difficulty. I Say "Live It, Or Live with It". Nesting Instinct. The Stack after the Initialization of Result. The Stack after Exiting from Average. Review. Exercises, Second Set. Exercise 2 (Code\Calc1.Cc). Conclusion. Answers to Exercises. The Stack Immediately before the Call to Mess. Immediately before Executing the First Instruction in Mess. The Stack after Mess Has Declared the Auto Variable Xyz. The Stack after Xyz Has Been Initialized. The Stack before Counter Is Called. Immediately Upon Entry to Counter. Before Execution of the First Instruction in Counter.6. Taking Inventory. Definitions. Objectives Of This Chapter. Pay Some Attention To The Man Behind The Curtain. Taking Stock. The Initial Sample Program For The Stockitem Class (Code\Itemtst1.Cc). More Definitions. Common Behavior. Comparison Between Native And User-Defined Types. The Initial Interface Of The Stockitem Class (Code\Item1.H). The Default Constructor For The Stockitem Class (From Code\Item1.Cc). Another Way To Write The Default Stockitem Constructor. Go To The Head Of The Class. Shop Till You Drop. Another Constructor For The Stockitem Class (From Code\Item1.Cc). Display Member Function For The Stockitem Class (From Code\Item1.Cc). The Initial Interface Of The Stockitem Class (Code\Item1.H). The Initial Implementation Of The Stockitem Class (Code\Item1.Cc). Vectoring In. Reading And Displaying A Vector Of Stockitems (Code\Itemtst2.Cc). The Read Function For The Stockitem Class (From Code\Item2.Cc). The Second Version Of The Interface For The Stockitem Class (Code\Item2.H). References Required. Don't Fence Me In. Can I Help You? First Attempt To Update Inventory Of Stockitems (Code\Itemtst3.Cc). Access Denied. An Enhanced Interface For The Stockitem Class (Code\Item4.H). The Customer Is Always Right. Some New Functions For The Stockitem Class (From Code\Item4.Cc). Updating Stockitem Inventory (Code\Itemtst4.Cc). Next Customer, Please? Interface Of Inventory Class (Code\Invent1.H). Default Constructor For Inventory Class (From Code\Invent1.Cc). Loadinventory Function For Inventory Class (From Code\Invent1.Cc). Nothing Ventured, Nothing Gained. The Implementation Of Isnull (From Code\Item5.Cc). Finditem Function For Inventory Class (From Code\Invent1.Cc). Updateitem Function For Inventory Class (From Code\Invent1.Cc). The Implementation Of Getupc (From Code\Item5.Cc). The Implementation Of Getprice (From Code\Item5.Cc). Current Interface For Inventory Class (Code\Invent1.H). Current Implementation For Inventory Class (Code\Invent1.Cc). Current Interface For Stockitem Class (Code\Item5.H). Current Implementation For Stockitem Class (Code\Item5.Cc). Updated Inventory Application (Code\Itemtst5.Cc). Paging Rosie Scenario. Review. Exercises. Conclusion. Answers To Exercises. The Write Member Function For The Stockitem Class (From Code\Item6.Cc). The Storeinventory Member Function For The Inventory Class (From Code\Invent2.Cc). The Changes To The Application Program (From Code\Itemtst6.Cc).7. Stringing Along. Objectives of This Chapter. Playing out the String. The String Class Interface, Initial Version (Code\String1.H). The Initial Implementation for the String Class (Code\String1.Cc). The Default Constructor for the String Class (From Code\String1.Cc). Passing Along a Few Pointers. The Dynamic Duo, New and Delete. An Empty String in Memory. Our First Test Program for The String Class (Code\Strtst1.Cc). Caution: Construction Area. The Char* Constructor for the String Class (From Code\String1.Cc). String N During Construction. A Simple Test Program for the String Class (Code\Strtst1.Cc). Constructive Criticism? The Char* Constructor for the String Class, Again (From Code\String1.Cc). Tricky Assignment. String N in Memory. Strings N and S in Memory after Compiler-Generated =. Assignment Of Responsibility. Strings N and S in Memory after Custom =. References Required. The Declaration of Operator = For the String Class. Hello, Operator? Calling the Operator = Implementation. What Is the Meaning of This? The Assignment Operator (Operator =) For the String Class (from Code\String1.Cc). Equality Now! Please Delete Me, Let Me Go. Running on Empty. the Next Assignment. A Hypothetical Assignment Operator (Operator =) for the String Class with Explicit This. The Terminator. The Destructor for the String Class (from Code/String1.Cc). Review. Exercises. Exercise 1 (Code\Strex1.Cc). Exercise 2 (Code\Strex2.Cc). Exercise 3 (Code\Strex3.Cc). Conclusion. Answers to Exercises.8. Down the Garden Path. Objectives of This Chapter. For Reference Only. Call by Value ("Normal Argument") Using the Compiler-Generated Copy Constructor. Unfair Copy. Call by Reference. Our First Test Program for the String Class (Code\Strtst1.Cc). Temporary Help Wanted. Assigning a C String to a String Via String::String(Char*). Copy Cat. The String Class Interface (Code\String1.H). The Copy Constructor for the String Class. Screen Test. The String Class Interface, with Display Function (Code\String3.H). The String Class Test Program, Using the Display Function (Code\Strtst3.Cc). The String Class Implementation of the Display Function. A Character Study. Array of Hope? Dangerous Characters (Code\Dangchar.Cc). A Slippery Character. Overwrought. Reaping the Whirlwind. Private Property: Keep Out! Attempted Privacy Violation (Code\Strtst3a.Cc). Maintenance Required. Yet Another Version of the String Class Interface (Code\String4.H). The String Class Implementation of the Getlength Function (from Code\String4.Cc). Using the Getlength Function in the String Class (Code\Strtst4.Cc). First Review. a String of Wins. Sorting a Vector of Strings (Code\Strsort1.Cc). The Updated String Class Interface, Including Comparison and I/O Operators (Code\String5.H). Less Than Obvious. Down for the Count. Strings X and Y in Memory. Strings X and Y in Memory, with an Embedded Null Byte. Using Operator For Strings (Code\Strtst5x.Cc). The Implementation of Operator for Strings (from Code\String5a.Cc). For Better Or Worse? Is Our Character Less Than the Other One? (from Code\String5a.Cc). The Else Clause in the Comparison Loop (from Code\String5a.Cc). Handling the Return Value (from Code\String5a.Cc). A Greater Cause. Simple Pleasures. Implementing Operator for Strings (from Code\String5.Cc). Equalization of Opportunity. Implementing Operator == for Strings (From Code\String5.Cc). Displaying Expertise. Down by the Old Cout Stream. Chaining Several Operator (from Code\Hmit1.Cc). The (Incorrect) While Loop in the Original Implementation of Operator >>. Making All Local Stops. What Have I Started? A Legal Program (Code\Fortest.Cc). Stereo Typing. An Incorrect Default Constructor for the Homeitembasic Class. Homeitembasic::Gettype (from Code\Hmit1.Cc). Homeitemmusic::Gettype (from Code\Hmit1.Cc). Homeitembasic::Write (from Code\Hmit1.Cc). Virtual Reality. Homeitemmusic::Write (from Code\Hmit1.Cc). The Initial Homeinventory Class Interface (Code\Hmin2.H). The Initial Implementation of Homeinventory (Code\Hmin2.Cc). Waste Not, Want Not. You Can Get What You Need. Another Possible Implementation of Loadinventory (from Code\Hmin2a.Cc). A Smith and Wesson Beats Four Aces. Yet Another Implementation of Loadinventory (from Code\Hmin3.Cc). Everything Is More Complicated Than It Looks. Back to the Future. The Next Interface for the Homeinventory Class (Code\Hmin4.H). The Additem Member Function of Homeinventory (from Code\Hmin4.Cc). The New Interface for Homeitem (Code\Hmit4.H). The Implementation of Homeitem::Newitem() (From Code\Hmit4.Cc). The New Version Of Operator >> (from Code\Hmit4.Cc). Strong Like Bool. Homeitembasic::Formatteddisplay (from Code\Hmit4.Cc). Homeitemmusic::Formatteddisplay (from Code\Hmit4.Cc). Leaving Well Enough Alone. the Test Program for Adding a Homeitem Interactively (Hmtst4.Cc). The Next Version of the Interface for Homeinventory (Code\Hmin5.H). The Next Version of The Homeinventory Test Program (Code\Hmtst5.Cc). The Edititem Function of Homeinventory (From Code\Hmin5.Cc). 'Tis a Gift to Be Simple. The Latest Version of the Homeitem Class Interface (Code\Hmit5.H). Homeitem::Edit (from Code\Hmit5.Cc). Homeitembasic::Copydata(). Better Read Than Dead. The Latest Version of Operator >> (From Code\Hmit5.Cc). For Your Eyes Only. The Latest Version of the Interface for the Homeitem Worker Classes (Code\Hmiti5.H). U Pluribus Enum. Homeitembasic::Getfieldname (from Code\Hmit5.Cc). Taking a Shortcut. Homeitem::Read (from Code\Hmit5.Cc). Homeitembasic::Read (from Code\Hmit5.Cc). Homeitembasic::Readinteractive (from Code\Hmit5.Cc). This Must Be the Place. Homeitembasic::Readfromfile (From Code\Hmit5.Cc). Homeitembasic::Edit (From Code\Hmit5.Cc). Homeitembasic::Formatteddisplay (from Code\Hmit5.Cc). Homeitembasic::Editfield (from Code\Hmit5.Cc). Facing the Music. Homeitemmusic::Formatteddisplay (from Code\Hmit5.Cc). Maintaining Our Position. Homeitemmusic::Readinteractive (from Code\Hmit5.Cc). Homeitemmusic::Readfromfile (from Code\Hmit5.Cc). Homeitemmusic::Editfield (from Code\Hmit5.Cc). Review. Exercises. Conclusion.12. Homeward Bound. Definitions. Objectives of This Chapter. Super-String Theory. The New String Class Interface (Code\String7.H). Batteries Not #Included. Construction Ahead. Default Is Mine. A Simplified Interface File for w String Class (Code\String7x.H). An Alternate String(Short Length) Constructor (from Code\String7x.Cc). Warning: Explicit Material. An Explicit Constructor Call Vs an Implicit One (Code\Strtstx.Cc). The String(Short, Char) Constructor for the String Class (From Code\String7.Cc). Adding Insult to Injury. Using Operator + for String Concatenation (Code\Strtst7a.Cc). The Implementation of Operator + for the String Class (from Code\String7.Cc). Inner Peace. The New Implementation of Operator >> (from Code\String7.Cc). Location, Location, Location. Using String::Find_Nocase (Code\Strtst7b.Cc). The Implementation of String::Find_Nocase (from Code\String7.Cc). The Less_Nocase Function (from Code\String7.Cc). Home, Sweet Home. The Latest Home Inventory Application Program (Code\Hmtst6.Cc). The Latest Version of the Homeinventory Interface (Hmin6.H). Homeinventory::Finditembydescription (from Code\Hmin6.Cc). The New Version of the Homeitem Interface (Code\Hmit6.H). Homeitembasic::Isnull (from Code\Hmit6.Cc). Nothing Ventured, Nothing Gained. A Slightly Odd Default Constructor for Homeitem (From Code\Hmit2.Cc). Error Messages Triggered by Accidental Use of 0 to Initialize a String (Code\Hmit6a.Err). Putting It All Together. First Test Session: Change Requests and Problem Reports. Second Test Session: Change Requests and Problem Reports. Third Test Session: Change Requests and Problem Reports. Fourth Test Session: Change Requests and Problem Reports. Fifth Test Session: Change Requests and Problem Reports. Round and Round We Go. Review. Exercises. Conclusion.13. Stealing Home. Definitions. Objectives of This Chapter. The Final Voyage. The Main() Function of the Final Version of the Home Inventory Main Program (from Code\Hmtst8.Cc). The Menuitem Enum (from Code\Hmtst8.Cc). The Getmenuchoice Function (from Code\Hmtst8.Cc). Executemenuchoice (from Code\Hmtst8.Cc). Utility Room. The Homeutility Interface (Code\Hmutil1.H). Homeutility::Ignoretillcr (from Code\Hmutil1.Cc). Homeutility::Handleerror (from Code\Hmutil1.Cc). Homeutility::Checknumericinput (from Code\Hmutil1.Cc). Number, Please. Making a List, Checking It Twice. Homeutility::Checkdateinput (from Code\Hmutil1.Cc). Enter Here. Homeutility::Getnumberorenter (from Code\Hmutil1.Cc). Secret Decoder Ring Not Required. The Rest of the Story. I Can See Clearly Now. Homeutility::Clearrestofscreen (from Code\Hmutil1.Cc). The Final Frontier. The Homeutility::Selectitem Function (from Code\Hmutil1.Cc). Checking the Inventory. the Latest Header File for the Homeinventory Class (Code\Hmin8.H). The Latest Version of Additem (from Code\Hmin8.Cc). The New Version of the Edititem Function (from Code\Hmin8.Cc). The Latest Implementation of Locateitembydescription (from Code\Hmin8.Cc). Homeinventory::Locateitembycategory (from Code\Hmin8.Cc). The Printnames Function (from Code\Hmin8.Cc). The Printall Function (from Code\Hmin8.Cc). The Storeinventory Function (from Code\Hmin8.Cc). The Displayitem Function (from Code\Hmin8.Cc). A Better Sort of Function. The Sortinventorybyname Function (from Code\Hmin8.Cc). The Selectitembypartialname Function (from Code\Hmin8.Cc). The Selectitemfromnamelist Function (from Code\Hmin8.Cc). Categorical Imperative. The Selectitemfromcategorylist Function (from Code\Hmin8.Cc). The Deleteitem Function (from Code\Hmin8.Cc). Homing In. The New Operator >> Implementation (from Code\Hmit8.Cc). The Latest Version of the Homeitembasic::Edit Function (from Code\Hmit8.Cc). The Newest Version of Homeitembasic::Readinteractive (from Code\Hmit8.Cc). The New Version of the Homeitembasic::Edititem Function (from Code\Hmit8.Cc). The Latest Version of Homeitemmusic::Readinteractive (from Code\Hmit8.Cc). The Latest Version of Homeitemmusic::Editfield (from Code\Hmit8.Cc). Are We Having Fun Yet? Review. Exercises. Conclusion.Appendix A: Tying Up Loose Ends. Operator Precedence. Another Native Data Type. Wrapping Up.Appendix B: Glossary. About the Author. Index.
show more

About Steve Heller

STEVE HELLER, President of Chrysalis Software Corporation, is a developer based in Sulphur Springs, Texas. His books include The C++ Training Guide, The Java Training Guide, Introduction to C++, Optimizing C++, Efficient C/C++, and Who's Afraid of Java?
show more

Rating details

2 ratings
3.5 out of 5 stars
5 50% (1)
4 0% (0)
3 0% (0)
2 50% (1)
1 0% (0)
Book ratings by Goodreads
Goodreads is the world's largest site for readers with over 50 million reviews. We're featuring millions of their reader ratings on our book pages to help you find your new favourite book. Close X