* A world-renowned C++ guru adopts a unique, practical approach that gets readers programming in the first chapter
* Visually appealing programs provide a major departure from the usual mathematical approach
* Tasks provide a key pedagogical vehicle for learning, are intrinsic to the presentation, and can serve as a foundation upon which to build employable skills
* CD-ROM includes a tool set to be used in conjunction with the book
Author(s): Francis Glassborow
Publisher: Wiley
Year: 2004
Language: English
Pages: 378
Cover
Contents
How to Use This Book
Introduction
Before Purchase
Why C++?
Getting the Best from This Book
What You Will Achieve
Notes for Students
Notes for Instructors
Personal Introductions
Acknowledgments
1 You Can Program
What Is Programming?
Introduction to Your Programming Tools
Our First Program
Elements of C++ Programs
A Playpen Doesn't Have To Be White
Plotting a Point
Mixing Colors
Modern Art?
Tasks, Exercises and Fun
Roberta's Comments
Summary
2 You Can Loop
Drawing a Cross
for-Loops
Drawing a Cross Revisited
Practicing Looping
Simple Arithmetic Operators
Roberta's Comments
Solutions to Exercises
Summary
3 You Can Write a Function
Drawing a Square
The Function Concept
Functions in C++
Writing a Function
Header and Implementation Files
Drawing Lines
Drawing Sets of Lines
Creating Your Own Utility Functions
Roberta's Comments
Solutions to Exercises
Summary
4 You Can Communicate
Names and Namespaces
Interaction
The char and int Types
Streams
The string Type
Creating a Simple Dialog
Sequence Containers
Walkthrough
Getting ints from the Keyboard
Handling the Unexpected
Roberta's Comments
Hints
Solutions to Exercises
Summary
5 You Can Create a Type
On Not Being Underrated
Designing a Type
The double Type
Creating a Two-Dimensional Point Type
Roberta's Comments
Solutions to Exercises
Summary
6 You Can Use point2d
Adding Functionality with Free Functions
Supporting I/O for point2d
Drawing Lines and Polygons
Drawing Regular Polygons
A Type and an Origin
Roberta's Comments
Hints
Solutions to Tasks
Solutions to Exercises
Summary
7 You Can Have Fun
Valuing Your Skills
Just for Fun
Fun Programming Ideas
Looking Forward
8 You Can Write a Menu
Offering a Set of Choices
Dealing with Dependencies
Functions that Fill a Polygon
Roberta's Comments
Solutions to Tasks
Solutions to Exercises
Summary
9 You Can Keep Data
Saving and Restoring Images
Using Captured Data
A Menu-Driven Program with Persistence
Further Practice
Iterators
Before the Next Chapter
Hints
Solutions to Tasks
Summary
10 Lotteries, Ciphers and Random Choices
Random and Pseudo-Random Sequences
Algorithms for Random Numbers
Understanding a Lottery Program
Sending Hidden Messages
Over to You
Roberta's Comments
Solutions to Tasks
Summary
11 Keyboards and Mice
A Keyboard Type
Using a Mouse
Refactoring Code
More Practice
Roberta's Comments
Solutions to Exercises
Summary
12 A Pot Pourri Spiced with Bitset
Computing a List of Primes
A Weaving Simulation
Dr Conway's Game of Life
Roberta's Comments
Solutions to Tasks
Summary
13 How Many ...? in Which Set and Map Lend a Hand
What Is an Associative Container?
What Is a Set?
What Is a Map?
Roberta's Comments
Solutions to Tasks
Solutions to Exercises
Summary
14 Getting, Storing and Restoring Graphical Items
Preparing to Program
Icons, Sprites and Related Items
Making a Font
Displaying a String in the Playpen
Roberta's Comments
Solutions to Tasks
Solutions to Exercises
Summary
15 Functions as Objects and Simple Animation
Functions that Remember
First Steps to Animation
A Matter of Palettes
More Advanced Animation
Roberta's Comments
Solutions to Tasks
Solutions to Exercises
Summary
16 Turtles and Eating Your Own Tail
Some History
Designing a Turtle Type
Exploring Turtle Graphics
Recursion
Wrapping It Up
Roberta's Comments
Solutions to Tasks
Summary
17 You Can Program
What Use Is What You Have Learnt?
Games-Based Problems
Analytical Problems
Mathematical Problems
Conclusion
Where Next
Appendix A: Some Common Errors
Index