C++ Without Fear: A Beginner's Guide That Makes You Feel Smart / Edition 2

C++ Without Fear: A Beginner's Guide That Makes You Feel Smart / Edition 2

3.0 8
by Brian Overland
     
 

View All Available Formats & Editions

ISBN-10: 0132673266

ISBN-13: 9780132673266

Pub. Date: 05/05/2011

Publisher: Prentice Hall

If you've always wanted to learn how to program a computer, or to learn the popular C++ programming language, here's the perfect book and CD to get you started. You'll find everything you need patiently explained and clearly illustrated, from general programming concepts and techniques to the particulars of the C++ language. In no time, you'll be writing your own

Overview

If you've always wanted to learn how to program a computer, or to learn the popular C++ programming language, here's the perfect book and CD to get you started. You'll find everything you need patiently explained and clearly illustrated, from general programming concepts and techniques to the particulars of the C++ language. In no time, you'll be writing your own programs! Yes, programming can be a complex task, and C++ is a language often used by professionals. In fact, many of the coolest games, graphics, and Internet applications are created with C++. But the language, like the monster on the cover, need not be all that fearsome. Broken down to its essentials, and enhanced by simple examples and practical exercises, you'll be amazed at the quick progress you can make. With C++ Without Fear you will: Learn the basics of C++ programming, Get started writing your own programs, See how and why each piece of a program does what it does, Create useful and reusable program code, Understand object-oriented programming - for once explained in simple, down-to-earth terms. Whether you wish to learn C++ programming for pleasure - and you'll discover here how much fun it can be - or might be considering a career in programming, this book is an intelligent first step.

Product Details

ISBN-13:
9780132673266
Publisher:
Prentice Hall
Publication date:
05/05/2011
Pages:
624
Sales rank:
515,987
Product dimensions:
6.84(w) x 8.98(h) x 1.32(d)

Table of Contents

Prefacexix
Why a New C++ Book?xix
What Else Is New about This Book?xx
Multiple Learning Paths: What Fits You Bestxx
What If You Already Have a Programming Background?xxi
What Is Not Covered?xxi
Why Should Anyone Start with C++?xxii
To Get Started...xxiii
Tips and Tricks: What Do I Watch Out For?xxiii
Acknowledgmentsxxv
Chapter 1Your First C++ Programs1
Thinking like a Programmer1
What's Different about C++?6
Building a C++ Program8
Installing Your Own C++ Compiler11
Example 1.1Print a Message12
Advancing to the Next Print Line17
Example 1.2Print Multiple Lines18
Storing Data: C++ Variables20
Introduction to Data Types21
Example 1.3Convert Temperatures23
A Word about Variable Names and Keywords29
Chapter 1 Summary30
Chapter 2Decisions, Decisions33
But First, a Few Words about Data Types33
Decision Making in Programs37
If and if-else37
Example 2.1Odd or Even?41
Introducing Loops44
Example 2.2Print 1 to N48
True and False in C++50
The Increment Operator (++)51
Statements vs. Expressions53
Introducing Boolean (Short-Circuit) Logic54
Example 2.3Testing a Person's Age56
Introducing the Math Library57
Example 2.4Prime-Number Test58
Chapter 2 Summary61
Chapter 3The Handy, All-Purpose "for" Statement65
Loops Used for Counting65
Introducing the "for" Loop66
A Wealth of Examples68
Example 3.1Printing 1 to N with "for"70
Statement Blocks with "for"71
Declaring Loop Variables on the Fly72
Example 3.2Prime-Number Test with "for"73
Comparative Languages 101: The Basic "for" Statement77
Chapter 3 Summary78
Chapter 4Functions: Many Are Called81
The Concept of Function81
Function Calls and the Flow of the Program83
The Basics of Using Functions84
Example 4.1Triangle-Number Function88
Example 4.2Prime-Number Function92
Local and Global Variables95
Recursive Functions97
Example 4.3Greatest Common Factor (GCF)98
Example 4.4Prime Factorization102
Example 4.5Random-Number Generator106
Chapter 4 Summary109
Chapter 5Arrays: We've Got Their Number111
A First Look at C++ Arrays111
Initializing Arrays113
Zero-Based Indexing114
Example 5.1Print Out Elements115
Example 5.2How Random Is Random?117
Strings and Arrays of Strings122
Example 5.3Card Dealer #1123
Example 5.4Card Dealer #2126
Example 5.5Card Dealer #3130
A Word to the Wise135
2-D Arrays: Into the Matrix136
Chapter 5 Summary137
Chapter 6Pointers: Getting a Handle on Data139
The Concept of Pointer139
Declaring and Using Pointers142
Example 6.1The Double-It Function145
Swap: Another Function Using Pointers147
Example 6.2Array Sorter149
Pointer Arithmetic154
Pointers and Array Processing156
Example 6.3Zero Out an Array157
Chapter 6 Summary161
Chapter 7Strings: Analyzing the Text163
Text Storage on the Computer163
It Don't Mean a Thing If It Ain't Got That String165
String-Manipulation Functions166
Example 7.1Building Strings168
Reading String Input172
Example 7.2Get a Number175
Example 7.3Convert to Uppercase177
Individual Characters vs. Strings180
Example 7.4Analyze Input181
The New C++ String Class186
Example 7.5Building Strings with the string Type189
Other Operations on the string Type191
Chapter 7 Summary193
Chapter 8Files: Electronic Storage197
Introducing File-Stream Objects197
How to Refer to Disk Files199
Example 8.1Write Text to a File200
Example 8.2Display a Text File200
Text Files vs. "Binary" Files203
Introducing Binary Operations208
Example 8.3Random-Access Write211
Example 8.4Random-Access Read214
Chapter 8 Summary217
Chapter 9Some Advanced Programming Techniques219
Command-Line Arguments219
Example 9.1Display File from Command Line221
Function Overloading224
Example 9.2Printing Different Types of Arrays226
The do-while Loop228
The switch-case Statement230
Multiple Modules231
Exception Handling234
Example 9.3Exception Handling with GCF239
Chapter 9 Summary242
Chapter 10Getting Yourself Object Oriented245
Why Get Object Oriented?245
A String Parser247
Objects vs. Classes248
Another Example: The Fraction Class249
Object Creation and Destruction250
Inheritance, or Subclassing251
Creating Shared Interfaces252
Polymorphism: True Object Independence253
Polymorphism and Virtual Functions255
What about Reusability?257
Chapter 10 Summary259
Chapter 11The Fraction Class261
Point: A Simple Class261
Private: Members Only (Protecting the Data)263
Example 11.1Testing the Point Class266
Introducing the Fraction Class268
Inline Functions271
Find the Greatest Common Factor273
Find the Lowest Common Multiple275
Example 11.2Fraction Support Functions276
Example 11.3Testing the Fraction Class280
Example 11.4Fraction Arithmetic: add and mult283
Chapter 11 Summary288
Chapter 12Constructors: If You Build It...291
Introducing Constructors291
Multiple Constructors (Overloading)293
The Default Constructor...and a Warning294
Example 12.1Point Class Constructors296
Example 12.2Fraction Class Constructors299
Reference Variables and Arguments (&)302
The Copy Constructor304
Example 12.3Fraction Class Copy Constructor306
Chapter 12 Summary310
Chapter 13Operator Functions: Doing It with Class313
Introducing Class Operator Functions313
Operator Functions As Global Functions316
Improve Efficiency with References318
Example 13.1Point Class Operators320
Example 13.2Fraction Class Operators323
Working with Other Types328
The Class Assignment Function (=)329
The Test-for-Equality Function (==)330
A Class "Print" Function332
Example 13.3The Completed Fraction Class333
Chapter 13 Summary339
Chapter 14What's "new": The StringParser Class343
The "new" Operator343
Objects and "new"345
Allocating Array Data347
Example 14.1Dynamic Memory in Action349
Design for a Parser (Lexical Analyzer)350
Example 14.2The StringParser Class355
Chapter 14 Summary361
Chapter 15What's "this": The String Class363
Introducing the String Class363
Introducing Class Destructors364
Example 15.1A Simple String Class366
"Deep" Copying and the Copy Constructor370
The "this" Keyword372
Revisiting the Assignment Operator374
Writing a Concatenation Function375
Example 15.2The Complete String Class377
Chapter 15 Summary382
Chapter 16Inheritance: What a Legacy385
Subclassing for Fun and Profit385
Example 16.1The FloatFraction Class389
Problems with the FloatFraction Class394
Example 16.2The Completed FloatFraction Class398
Example 16.3The ProperFraction Class399
Private and Protected Members404
Example 16.4Contained Members: Fraction Units406
Chapter 16 Summary410
Chapter 17Polymorphism: Object Independence413
A Different Approach to the FloatFraction Class413
Virtual Functions to the Rescue!415
Example 17.1The Revised FloatFraction Class418
"Pure Virtual" and Other Arcane Matters423
Abstract Classes and Interfaces424
Why cout Is Not Truly Polymorphic426
Example 17.2True Polymorphism: The Printable Class427
A Final Word (or Two)431
A Final Final Word432
Chapter 17 Summary433
Appendix AC++ Operators435
Appendix BIntrinsic Data Types439
Appendix CC++ Syntax Summary441
Literal Constants441
Basic Expression Syntax441
Basic Statement Syntax442
Control Structures443
Special Control Statements445
Data Declarations446
Function Declarations447
Class Declarations448
Appendix DASCII Codes451
Appendix ECommon Library Functions453
String Functions453
Data-Conversion Functions454
Single-Character Functions455
Math Functions455
Randomization457
Appendix FGlossary of Terms459
Index469

Customer Reviews

Average Review:

Write a Review

and post it to your social network

     

Most Helpful Customer Reviews

See all customer reviews >

C++ Without Fear: A Beginner's Guide That Makes You Feel Smart 3 out of 5 based on 0 ratings. 8 reviews.
Eileen Burker More than 1 year ago
Buy it if you want to learn C++ and you know nothing of programming. It works! I should know, I used it.
Anonymous More than 1 year ago
Anonymous More than 1 year ago
The graphics are fine there big enough
AvidReaderJK More than 1 year ago
Great written description. Easy to follow. Well designed for beginners. Graphics are too small to be viewable on a Nook Reader. Graphics are unusable which is a shame. Had they be useable, this would have been a perfect entry-level book. Can't recommend it for Nook users. 
Anonymous More than 1 year ago
Very interesting book. Holds my attention. Author explains very well.
Anonymous More than 1 year ago
Anonymous More than 1 year ago
Anonymous More than 1 year ago
I'd love to write a review, but the stupid book won't unlock on the Nook that I used to purchase it.