Programming with Visual C++: Concepts and Projects

This document was uploaded by one of our users. The uploader already confirmed that they had the permission to publish it. If you are author/publisher or own the copyright of this documents, please report to us by using this DMCA report form.

Simply click on the Download Book button.

Yes, Book downloads on Ebookily are 100% Free.

Sometimes the book is free on Amazon As well, so go ahead and hit "Search on Amazon"

Visual, interactive, and engaging projects are the hallmark of this innovative book that marks a rapid departure from traditional computer science texts. Programming in Visual C++: Concepts and Projects uses a graphical user interface (GUI) approach instead of the traditional console (plan text) mode, to provide a thorough introduction to computer science and C++ concepts that is highly visual and enjoyable for the reader. Because Visual C++ no longer requires advanced skills to produce GUIs, even beginning readers are able to produce attractive and functional GUIs within the first few chapters. Coverage includes a comprehensive introduction to programming basics, including control and data structures, as well as object-oriented programming. Straightforward and easy to understand, this is a valuable resource for anyone interested in a computer science book that is as fun as it is informative.

Author(s): James Allert
Edition: 1
Publisher: Cengage Learning
Year: 2008

Language: English
Pages: 776
Tags: Библиотека;Компьютерная литература;C / C++;

Cover Page......Page 1
Title Page......Page 2
Copyright Page......Page 3
Dedication......Page 4
Brief Contents......Page 6
Table of Contents......Page 8
Preface......Page 19
1 INTRODUCTION......Page 38
Object-Oriented Programming......Page 39
Hardware Fundamentals......Page 43
History of Hardware Development......Page 45
Software Fundamentals......Page 48
History of Software Development......Page 54
The Programming Process......Page 56
Types of Errors......Page 58
A Project Development Strategy......Page 59
The Visual Studio IDE......Page 60
Design......Page 62
Development and Preliminary Testing......Page 63
Understanding the Code......Page 83
Testing the Completed Program......Page 86
Debugging a Program......Page 87
On Your Own......Page 90
Quick Review......Page 94
Terms to Know......Page 97
Exercises......Page 100
Programming Exercises......Page 106
2 READING, PROCESSING, AND DISPLAYING DATA......Page 110
Solving Problems......Page 111
Data and Data Types......Page 113
Variables......Page 116
Initializing Variables......Page 119
Data Input......Page 121
The TryParse() Method......Page 122
Arithmetic Operations......Page 123
Operator Precedence in Arithmetic Expressions......Page 125
Arithmetic Operators and Strings......Page 127
Shorthand Assignment......Page 129
The Math Library......Page 130
The ToString()Method......Page 131
Design......Page 132
Development......Page 134
Testing......Page 140
On Your Own......Page 141
Quick Review......Page 143
Terms to Know......Page 146
Exercises......Page 148
Programming Exercises......Page 151
3 INTEGRAL DATA......Page 154
The Binary Number System......Page 155
Integral Data Types......Page 156
Data Type Conversion......Page 158
Implicit Type Conversion......Page 159
Integer Division......Page 161
The Mod Operator (%)......Page 163
Problem Analysis......Page 164
Design......Page 167
Development......Page 171
Testing......Page 188
On Your Own......Page 189
Quick Review......Page 190
Terms to Know......Page 192
Exercises......Page 193
Programming Exercises......Page 194
4 SELECTION......Page 200
Sequential Control Structures......Page 201
Selection Control Structures......Page 203
Relational Operators......Page 204
Using if Statements to Provide a Single Alternative......Page 205
Using if...else Statements to Provide Two Alternatives......Page 208
Logical Operators......Page 209
The not Operator (!)......Page 210
The and Operator (&&)......Page 211
Determining When to Use the and Operator (&&) and the or Operator (||)......Page 213
The or Operator (||)......Page 215
Nested Control Structures......Page 217
Multiple Alternative Selection......Page 219
switch Statements......Page 222
Problem Analysis......Page 223
Design......Page 225
Development......Page 237
On Your Own......Page 244
Quick Review......Page 245
Terms to Know......Page 247
Exercises......Page 248
Projects......Page 251
5 REPETITION......Page 256
User-Controlled Repetition......Page 257
Accumulating a Sum and Counting......Page 262
Instance Variables......Page 263
Repetition Control Structures......Page 266
The while Loop......Page 267
do...while Loops......Page 270
The for Loop......Page 272
Formula Translation......Page 278
Accumulating a Product......Page 280
Building a String......Page 282
Generating Random Numbers......Page 283
Finding the Largest Value......Page 286
Counting Specific Values......Page 287
Nested Loops......Page 289
Problem Analysis......Page 291
Design......Page 292
Development......Page 294
On Your Own......Page 296
Quick Review......Page 297
Terms to Know......Page 298
Exercises......Page 300
Programming Exercises......Page 302
6 METHODS......Page 306
Methods......Page 307
System-Defined Class Methods......Page 308
The System::Math Class Library......Page 309
Application Methods......Page 311
Programmer-Defined Methods......Page 313
Methods without Parameters or a Return Type......Page 314
Methods with Value Parameters......Page 318
Methods with Reference Parameters......Page 322
Methods with a Return Value......Page 325
Graphics Class Objects and Methods......Page 327
The Use of Constants......Page 331
Problem Analysis......Page 333
Design......Page 335
Development......Page 339
On Your Own......Page 347
Quick Review......Page 348
Terms to Know......Page 350
Exercises......Page 352
Programming Exercises......Page 356
7 ARRAYS......Page 364
Arrays......Page 365
Array Declaration and Initialization......Page 366
Using Arrays......Page 367
Passing a Single Element into a Method by Value......Page 369
Passing an Entire Array into a Method......Page 370
Sequential Search Example......Page 374
Searching with a for Loop......Page 375
Counting Comparisons......Page 377
The Search Comparison Log......Page 378
Parallel Arrays......Page 379
Multidimensional Arrays......Page 382
Problem Analysis......Page 385
Design......Page 386
Development......Page 392
On Your Own......Page 398
Quick Review......Page 399
Exercises......Page 400
Programming Exercises......Page 403
8 BINARY SEARCH......Page 406
Searching a Sorted List......Page 407
Binary Search Algorithm......Page 408
Binary Search Example......Page 415
Direct Lookup......Page 417
Sequential Search......Page 420
Binary Search......Page 421
Determining the Best Approach to Searching......Page 423
The array Class......Page 424
String Operations......Page 428
Problem Analysis......Page 429
Design......Page 431
Development......Page 435
Testing......Page 440
Quick Review......Page 441
Exercises......Page 443
Programming Exercises......Page 447
9 SORTING......Page 454
Exchanging Data Values in an Array......Page 455
Sorting Strategies......Page 459
The Selection Sort......Page 461
The Selection Sort’s Inner Loop: Locating the Smallest Unsorted Value......Page 463
The Bubble Sort......Page 465
The Bubble Sort’s Inner Loop: Exchanging Values in Adjacent Elements......Page 466
The Insertion Sort......Page 469
The Insertion Sort’s Inner Loop: Shifting Data Through Reassignment......Page 475
Comparing Sorting Algorithms......Page 477
Problem Analysis......Page 478
Design......Page 479
Development......Page 482
On Your Own......Page 486
Quick Review......Page 487
Exercises......Page 488
Programming Exercises......Page 492
10 RECURSION......Page 496
Factorial Numbers......Page 497
Recursion......Page 499
Recursion Versus Iteration......Page 505
Creating Fractal Images......Page 507
Drawing Lines with DrawLine()......Page 510
The Recursive DrawBranch() Method......Page 511
Problem Analysis......Page 514
Design......Page 515
Development......Page 524
Testing......Page 532
Analysis......Page 533
On Your Own......Page 534
Quick Review......Page 536
Exercises......Page 537
Programming Exercises......Page 541
11 POINTERS......Page 548
Introduction......Page 549
Basic Pointer Concepts......Page 550
Memory Cell Addresses......Page 551
Creating Pointer Variables......Page 552
Accessing Data Indirectly Through Pointers......Page 556
Pointers and Methods......Page 559
Pointer Return Types......Page 562
Pointers and Arrays......Page 563
Pointer Arithmetic......Page 565
Deleting Pointers......Page 568
Arrays of Pointers......Page 569
Sorting With Pointers......Page 571
The Swap() Method......Page 578
Problem Description......Page 582
Design......Page 585
Development......Page 594
Testing......Page 599
Quick Review......Page 600
Terms to Know......Page 601
Exercises......Page 602
Programming Exercises......Page 606
12 LINKED LISTS: THE Node CLASS......Page 610
The List Data Structure......Page 611
The Problem with Arrays......Page 612
Linked Lists......Page 615
Inserting a Node......Page 617
Deleting a Node......Page 619
Class Definitions......Page 620
The Node Class......Page 622
Constructors......Page 624
Destructors......Page 625
Class Diagrams......Page 626
Header Files......Page 628
Implementation Files......Page 629
Class Definition Files and Client Code......Page 632
Using Node Objects......Page 633
Accessing Node Attributes......Page 634
Problem Description......Page 635
Design......Page 640
Development......Page 648
Testing......Page 658
On Your Own......Page 659
Quick Review......Page 660
Terms to Know......Page 661
Exercises......Page 663
Programming Exercises......Page 666
13 OBJECT-ORIENTED PROGRAMMING......Page 672
OOP Example......Page 674
The Frog Class Definition......Page 675
Instantiation and Use......Page 676
Initializing Constructors......Page 677
Data Hiding......Page 679
Accessor and Mutator Methods......Page 680
Utility Methods......Page 682
Complete Frog Class Definition......Page 683
Client Code......Page 685
Tutorial: Maze Program......Page 687
Problem Analysis......Page 688
Mouse Class Definition......Page 689
The Cell Class Definition......Page 692
Design......Page 694
Development......Page 701
On Your Own......Page 708
Terms to Know......Page 709
Exercises......Page 710
Programming Exercises......Page 713
Appendix A: Concepts and Features Covered in Each Chapter......Page 718
Appendix B: Documentation and Reference Materials......Page 730
Appendix C: Common Errors......Page 740
Index......Page 752