Rent Textbook

Used Textbook

eTextbook

New Textbook

Related Products

Starting Out with C++ From Control Structures through Objects, Brief Edition plus MyProgrammingLab with Pearson eText - Access Card Package

Starting Out with C++ Brief : From Control Structures through Objects

Starting Out with C++ From Control Structures through Objects, Brief Edition

Starting Out with C++ Brief Version : From Control Structures Through Objects

Starting Out With C++: Brief

Brief Version of Starting Out With C++

Starting Out with C++ : Brief Version Update, Visual C++ . NET

Summary

Starting Out with C++ teaches C++ from the ground up, and assumes no prior background in programming. In Starting Out With C++, Gaddis makes a very detailed and slow-paced presentation of both programming and C++ syntax concepts so all readers will be able to follow along. Objects are introduced after control structures, functions, arrays, and pointers, and C-style strings are used throughout. The book includes the hallmark pedagogocial features that readers of Gaddis books have come to expect. Readers who are new to programming, as well as those with prior work in other languages will find this text beneficial.

Table of Contents

Preface

v

About the Authors

xvii

Contents at a Glance

xix

Introduction to Computers and Programming

1

(26)

Why Program?

1

(1)

Computer Systems: Hardware and Software

2

(4)

Programs and Programming Languages

6

(6)

What Is a Program Made of?

12

(4)

Input, Processing, and Output

16

(1)

The Programming Process

17

(4)

Procedural and Object-Oriented Programming

21

(6)

Review Questions and Exercises

23

(4)

Introduction to C++

27

(48)

The Parts of a C++ Program

27

(4)

The cout Object

31

(4)

The #include Directive

35

(2)

Variables and Literals

37

(4)

Identifiers

41

(2)

Integer Data Types

43

(4)

The char Data Type

47

(5)

Floating-Point Data Types

52

(4)

The bool Data Type

56

(1)

Determining the Size of a Data Type

57

(1)

Variable Assignments and Initialization

58

(1)

Scope

59

(1)

Arithmetic Operators

60

(4)

Comments

64

(2)

Focus on Software Engineering: Programming Style

66

(2)

If You Plan to Continue in Computer Science: Standard and Prestandard C++

68

(7)

Review Questions and Exercises

69

(6)

Expressions and Interactivity

75

(70)

The cin Object

75

(7)

Mathematical Expressions

82

(8)

When You Mix Apples and Oranges: Type Conversion

90

(2)

Overflow and Underflow

92

(1)

Type Casting

93

(3)

Named Constants

96

(5)

Multiple Assignment and Combined Assignment

101

(4)

Formatting Output

105

(10)

Formatted Input

115

(5)

Focus on Object-Oriented Programming: More About Member Functions

120

(1)

More Mathematical Library Functions

121

(4)

Introduction to File Input and Output

125

(20)

Review Questions and Exercises

134

(11)

Making Decisions

145

(74)

Relational Operators

145

(5)

The if Statement

150

(7)

Flags

157

(1)

Expanding the if Statement

158

(3)

The if/else Statement

161

(3)

The if/else if Statement

164

(5)

Using a Trailing else

169

(1)

Menus

170

(2)

Focus on Software Engineering: Nested if Statements

172

(3)

Logical Operators

175

(6)

Checking Numeric Ranges with Logical Operators

181

(1)

Focus on Software Engineering: Validating User Input

182

(2)

More About Variable Definitions and Scope

184

(5)

Comparing Strings

189

(5)

The Conditional Operator

194

(3)

The switch Statement

197

(8)

Testing for File Open Errors

205

(14)

Review Questions and Exercises

206

(13)

Looping

219

(44)

The Increment and Decrement Operators

219

(5)

Introduction to Loops: The while Loop

224

(4)

Counters

228

(2)

Letting the User Control the Loop

230

(1)

Keeping a Running Total

231

(1)

Sentinels

232

(2)

Using a Loop to Read Data from a File

234

(2)

The do-while and for Loops

236

(10)

Focus on Software Engineering: Deciding Which Loop to Use

246

(1)

Nested Loops

246

(3)

Breaking Out of a Loop

249

(1)

The continue Statement

250

(2)

Focus on Software Engineering: Using Loops for Data Validation

252

(11)

Review Questions and Exercises

254

(9)

Functions

263

(62)

Focus on Software Engineering: Modular Programming

263

(1)

Defining and Calling Functions

264

(8)

Function Prototypes

272

(2)

Sending Data into a Function

274

(4)

Passing Data by Value

278

(2)

Focus on Software Engineering: Using Functions in a Menu-Driven Program

280

(3)

The return Statement

283

(1)

Returning a Value from a Function

284

(4)

Returning a Boolean Value

288

(2)

Local and Global Variables

290

(6)

Static Local Variables

296

(3)

Default Arguments

299

(4)

Using Reference Variables as Parameters

303

(5)

Overloading Functions

308

(4)

The exit () Function

312

(3)

Stubs and Drivers

315

(10)

Review Questions and Exercises

317

(8)

Arrays

325

(70)

Arrays Hold Multiple Values

325

(2)

Accessing Array Elements

327

(5)

No Bounds Checking in C++

332

(2)

Array Initialization

334

(5)

Processing Array Contents

339

(9)

Focus on Software Engineering: Using Parallel Arrays

348

(3)

Arrays as Function Arguments

351

(9)

Two-dimensional Arrays

360

(8)

Arrays of Strings

368

(2)

Arrays with Three or More Dimensions

370

(2)

If You Plan to Continue in Computer Science: Introduction to the STL vector