Teaching Approach

[Page xxix (continued)]

Teaching Approach

Visual C# 2005 How to Program, 2/e contains a rich collection of examples that have been tested on Windows 2000 and Windows XP. The book concentrates on the principles of good software engineering and stresses program clarity. We avoid arcane terminology and syntax specifications in favor of teaching by example. We are educators who teach leadingedge topics in industry classrooms worldwide. Dr. Harvey M. Deitel has 20 years of college teaching experience and 15 years of industry teaching experience. Paul Deitel has 12 years of industry teaching experiencehe has taught courses at all levels to government, industry, military and academic clients of Deitel & Associates.

Learning C# via the Live-Code Approach

Visual C# 2005 How to Program, 2/e is loaded with live-code exampleseach new concept is presented in the context of a complete working C# application that is immediately followed by one or more sample executions showing the program's inputs and outputs. This style exemplifies the way we teach and write about programming. We call this method of teaching and writing the "live-code" approach.

World Wide Web Access

All of the source-code examples for Visual C# 2005 How to Program, 2/e, (and for our other publications) are available for download from:



Registration is quick and easy, and the downloads are free. Download all the examples, then run each program as you read the corresponding text discussions. Making changes to the examples and immediately seeing the effects of those changes is a great way to enhance your C# learning experience.


Each chapter begins with a statement of objectives. This lets students know what to expect and gives them an opportunity, after reading the chapter, to determine if they have met these objectives.

[Page xxx]


The learning objectives are followed by quotations. Some are humorous, philosophical or offer interesting insights. We hope that you will enjoy relating the quotations to the chapter material. Many of the quotations are worth a second look after reading the chapter.


The chapter outline helps students approach the material in a top-down fashion, so they can anticipate what is to come, and set a comfortable and effective learning pace.

17,544 Lines of Code in 230 Example Programs (with Program Outputs)

Our live-code programs range in size from just a few lines of code to substantial examples containing hundreds of lines of code (e.g., our ATM system implementation contains 655 lines of code). Each program is followed by a window containing the outputs produced when the program is run, so you can confirm that the programs run as expected. Our programs demonstrate the diverse features of C#. The code is syntax shaded, with C# keywords, comments and other program text emphasized with variations of bold, italic and gray text. This facilitates reading the code, especially when you're reading the larger programs.

725 Illustrations/Figures

An abundance of charts, tables, line drawings, programs and program outputs is included. We model the flow of control in control statements with UML activity diagrams. UML class diagrams model the fields, constructors and methods of classes. We use additional types of UML diagrams throughout our optional OOD/UML ATM case study.

317 Programming Tips

We include programming tips to help students focus on important aspects of program development. We highlight these tips in the form of Good Programming Practices, Common Programming Errors, Error-Prevention Tips, Look-and-Feel Observations, Performance Tips, Portability Tips and Software Engineering Observations. These tips and practices represent the best we have gleaned from a combined six decades of programming and teaching experience. One of our studentsa mathematics majortold us that she feels this approach is like the highlighting of axioms, theorems and corollaries in mathematics books; it provides a basis on which to build good software.

Good Programming Practice 3.1

Good Programming Practices call attention to techniques that will help you produce programs that are clearer, more understandable and more maintainable.

Common Programming Error 3.1

Students learning a language tend to make certain kinds of errors frequently. Pointing out these Common Programming Errors reduces the likelihood that readers will make the same mistakes.

Error-Prevention Tip 3.1

When we first designed this tip type, we thought the tips would contain suggestions for exposing bugs and removing them from programs. In fact, many of the tips describe aspects of C# that prevent bugs from getting into programs in the first place, thus simplifying the testing and debugging processes.

[Page xxxi]

Look-and-Feel Observation 3.1

We provide Look-and-Feel Observations to highlight graphical-user-interface conventions. These observations help you design attractive, user-friendly graphical user interfaces that conform to industry norms.

Performance Tip 3.1

Students like to "turbo charge" their programs. We include Performance Tips that highlight opportunities for improving program performancemaking programs run faster or minimizing the amount of memory that they occupy.

Portability Tip 3.1

We include Portability Tips to help you write portable code and to explain how C# achieves its high degree of portability.

Software Engineering Observation 3.1

The object-oriented programming paradigm necessitates a complete rethinking of the way we build software systems. C# is an effective language for achieving good software engineering. The Software Engineering Observations highlight architectural and design issues that affect the construction of software systems, especially large-scale systems.

Wrap-Up Section

Each chapter ends with a brief "wrap-up" section that recaps the chapter content and transitions to the next chapter.

Summary Bullets

Each chapter ends with additional pedagogical devices. We present a thorough, bullet-liststyle summary of the chapter. This helps the students review and reinforce key concepts.


We include an alphabetized list of the important terms defined in each chapteragain, for further reinforcement. Each term also appears in the index, and the defining occurrence of each term is highlighted in the index with a bold, italic page number so the student can locate the definitions of terms quickly.

Self-Review Exercises and Answers

Extensive self-review exercises and answers are included for self-study. This gives you a chance to build confidence with the material and prepare for the regular exercises. We encourage students to do all the self-review exercises and check their answers.


Each chapter concludes with a set of exercises, including simple recall of important terminology and concepts; writing individual C# statements; writing small portions of C# methods and classes; writing complete C# methods, classes and applications; and writing major term projects. The large number of exercises across a wide variety of areas enables instructors to tailor their courses to the unique needs of their classes and to vary course assignments each semester. Instructors can use these exercises to form homework assignments, short quizzes and/or major examinations. The solutions for the vast majority of the exercises are included in the Prentice Hall Instructor's Resource Center, which is available only to instructors through their Prentice Hall representatives. [NOTE: Please do not write to us requesting access to the Prentice Hall Instructor's Resource Center. Access is limited strictly to college instructors teaching from the book. Instructors may obtain access only through their Prentice Hall representatives.]

[Page xxxii]

Approximately 5500 Index Entries

We have included an extensive index which is especially useful to developers who use the book as a reference.

"Double Indexing" of C# Live-Code Examples

Visual C# 2005 How to Program, 2/e has 230 live-code examples, which we have double indexed. For every source-code program in the book, we indexed the figure caption both alphabetically and as a subindex item under "Examples." This makes it easier to find examples using particular features.