SlideShare a Scribd company logo
1 of 1560
Download to read offline
Contents
Contents viii
Illustrations xix
Preface xxxviii
1 Introduction to Computers, the Internet,
the Web and C# 1
1.1 Introduction 2
1.2 What Is a Computer? 3
1.3 Computer Organization 3
1.4 Evolution of Operating Systems 4
1.5 Personal Computing, Distributed Computing and Client/Server Computing 5
1.6 Machine Languages, Assembly Languages and High-level Languages 6
1.7 C, C++, Visual Basic .NET and Java™ 7
1.8 C# 9
1.9 Other High-level Languages 10
1.10 Structured Programming 10
1.11 Key Software Trend: Object Technology 11
1.12 Hardware Trends 13
1.13 History of the Internet and World Wide Web 13
1.14 World Wide Web Consortium (W3C) 15
1.15 Extensible Markup Language (XML) 15
1.16 Introduction to Microsoft .NET 16
1.17 .NET Framework and the Common Language Runtime 18
1.18 Tour of the Book 20
1.19 Internet and World Wide Web Resources 29
Contents IX
2 Introduction to the Visual Studio .NET IDE 33
2.1 Introduction 34
2.2 Visual Studio .NET Integrated Development Environment (IDE) Overview 34
2.3 Menu Bar and Toolbar 37
2.4 Visual Studio .NET Windows 39
2.4.1 Solution Explorer 39
2.4.2 Toolbox 40
2.4.3 Properties Window 42
2.5 Using Help 42
2.6 Simple Program: Displaying Text and an Image 44
3 Introduction to C# Programming 59
3.1 Introduction 60
3.2 Simple Program: Printing a Line of Text 60
3.3 Another Simple Program: Adding Integers 71
3.4 Memory Concepts 75
3.5 Arithmetic 76
3.6 Decision Making: Equality and Relational Operators 80
4 Control Structures: Part 1 94
4.1 Introduction 95
4.2 Algorithms 95
4.3 Pseudocode 96
4.4 Control Structures 96
4.5 if Selection Structure 99
4.6 if/else Selection Structure 100
4.7 while Repetition Structure 105
4.8 Formulating Algorithms: Case Study 1 (Counter-Controlled Repetition) 106
4.9 Formulating Algorithms with Top-Down, Stepwise Refinement:
Case Study 2 (Sentinel-Controlled Repetition) 109
4.10 Formulating Algorithms with Top-Down, Stepwise Refinement:
Case Study 3 (Nested Control Structures) 116
4.11 Assignment Operators 120
4.12 Increment and Decrement Operators 121
4.13 Introduction to Windows Application Programming 124
5 Control Structures: Part 2 139
5.1 Introduction 140
5.2 Essentials of Counter-Controlled Repetition 140
5.3 for Repetition Structure 142
5.4 Examples Using the for Structure 146
5.5 switch Multiple-Selection Structure 152
5.6 do/while Repetition Structure 156
5.7 Statements break and continue 158
5.8 Logical and Conditional Operators 160
5.9 Structured-Programming Summary 166
X Contents
6 Methods 178
6.1 Introduction 179
6.2 Program Modules in C# 179
6.3 Math Class Methods 181
6.4 Methods 181
6.5 Method Definitions 183
6.6 Argument Promotion 193
6.7 C# Namespaces 195
6.8 Value Types and Reference Types 196
6.9 Passing Arguments: Pass-by-Value vs. Pass-by-Reference 197
6.10 Random-Number Generation 200
6.11 Example: Game of Chance 207
6.12 Duration of Variables 212
6.13 Scope Rules 212
6.14 Recursion 215
6.15 Example Using Recursion: The Fibonacci Series 219
6.16 Recursion vs. Iteration 222
6.17 Method Overloading 223
7 Arrays 236
7.1 Introduction 237
7.2 Arrays 237
7.3 Declaring and Allocating Arrays 239
7.4 Examples Using Arrays 240
7.4.1 Allocating an Array and Initializing Its Elements 240
7.4.2 Totaling the Elements of an Array 242
7.4.3 Using Histograms to Display Array Data Graphically 243
7.4.4 Using the Elements of an Array as Counters 244
7.4.5 Using Arrays to Analyze Survey Results 247
7.5 Passing Arrays to Methods 250
7.6 Passing Arrays by Value and by Reference 253
7.7 Sorting Arrays 257
7.8 Searching Arrays: Linear Search and Binary Search 260
7.8.1 Searching an Array with Linear Search 260
7.8.2 Searching a Sorted Array with Binary Search 261
7.9 Multiple-Subscripted Arrays 265
7.10 foreach Repetition Structure 272
8 Object-Based Programming 280
8.1 Introduction 281
8.2 Implementing a Time Abstract Data Type with a Class 282
8.3 Class Scope 290
8.4 Controlling Access to Members 290
8.5 Initializing Class Objects: Constructors 292
8.6 Using Overloaded Constructors 293
8.7 Properties 297
Contents XI
8.8 Composition: Objects References as Instance Variables of Other Classes 306
8.9 Using the this Reference 309
8.10 Garbage Collection 311
8.11 static Class Members 312
8.12 const and readonly Members 317
8.13 Indexers 319
8.14 Data Abstraction and Information Hiding 326
8.15 Software Reusability 327
8.16 Namespaces and Assemblies 328
8.17 Class View and Object Browser 333
9 Object-Oriented Programming: Inheritance 342
9.1 Introduction 343
9.2 Base Classes and Derived Classes 344
9.3 protected and internal Members 347
9.4 Relationship between Base Classes and Derived Classes 347
9.5 Case Study: Three-Level Inheritance Hierarchy 368
9.6 Constructors and Destructors in Derived Classes 371
9.7 Software Engineering with Inheritance 377
10 Object-Oriented Programming: Polymorphism 382
10.1 Introduction 383
10.2 Derived-Class-Object to Base-Class-Object Conversion 383
10.3 Type Fields and switch Statements 390
10.4 Polymorphism Examples 391
10.5 Abstract Classes and Methods 392
10.6 Case Study: Inheriting Interface and Implementation 394
10.7 sealed Classes and Methods 402
10.8 Case Study: Payroll System Using Polymorphism 403
10.9 Case Study: Creating and Using Interfaces 413
10.10 Delegates 425
10.11 Operator Overloading 430
11 Exception Handling 438
11.1 Introduction 439
11.2 Exception Handling Overview 440
11.3 Example: DivideByZeroException 443
11.4 .NET Exception Hierarchy 448
11.5 finally Block 449
11.6 Exception Properties 457
11.7 Programmer-Defined Exception Classes 462
11.8 Handling Overflows with Operators checked and unchecked 466
12 Graphical User Interface Concepts: Part 1 474
12.1 Introduction 475
12.2 Windows Forms 476
XII Contents
12.3 Event-Handling Model 479
12.3.1 Basic Event Handling 480
12.4 Control Properties and Layout 484
12.5 Labels, TextBoxes and Buttons 488
12.6 GroupBoxes and Panels 495
12.7 CheckBoxes and RadioButtons 498
12.8 PictureBoxes 507
12.9 Mouse Event Handling 509
12.10 Keyboard Event Handling 511
13 Graphical User Interfaces Concepts:
Part 2 520
13.1 Introduction 521
13.2 Menus 521
13.3 LinkLabels 530
13.4 ListBoxes and CheckedListBoxes 534
13.4.1 ListBoxes 537
13.4.2 CheckedListBoxes 539
13.5 ComboBoxes 542
13.6 TreeViews 547
13.7 ListViews 553
13.8 Tab Control 560
13.9 Multiple-Document-Interface (MDI) Windows 565
13.10 Visual Inheritance 574
13.11 User-Defined Controls 578
14 Multithreading 590
14.1 Introduction 591
14.2 Thread States: Life Cycle of a Thread 592
14.3 Thread Priorities and Thread Scheduling 594
14.4 Thread Synchronization and Class Monitor 599
14.5 Producer/Consumer Relationship without Thread Synchronization 601
14.6 Producer/Consumer Relationship with Thread Synchronization 607
14.7 Producer/Consumer Relationship: Circular Buffer 616
15 Strings, Characters and Regular Expressions 632
15.1 Introduction 633
15.2 Fundamentals of Characters and Strings 633
15.3 String Constructors 635
15.4 String Indexer, Length Property and CopyTo Method 636
15.5 Comparing Strings 638
15.6 String Method GetHashCode 642
15.7 Locating Characters and Substrings in Strings 643
15.8 Extracting Substrings from Strings 646
15.9 Concatenating Strings 647
15.10 Miscellaneous String Methods 648
Contents XIII
15.11 Class StringBuilder 650
15.12 StringBuilder Indexer, Length and Capacity Properties,
and EnsureCapacity Method 652
15.13 StringBuilder Append and AppendFormat Methods 654
15.14 StringBuilder Insert, Remove and Replace Methods 658
15.15 Char Methods 661
15.16 Card Shuffling and Dealing Simulation 664
15.17 Regular Expressions and Class Regex 668
16 Graphics and Multimedia 684
16.1 Introduction 685
16.2 Graphics Contexts and Graphics Objects 687
16.3 Color Control 688
16.4 Font Control 696
16.5 Drawing Lines, Rectangles and Ovals 701
16.6 Drawing Arcs 704
16.7 Drawing Polygons and Polyli]nes 707
16.8 Advanced Graphics Capabilities 711
16.9 Introduction to Multimedia 717
16.10 Loading, Displaying and Scaling Images 718
16.11 Animating a Series of Images 720
16.12 Windows Media Player 733
16.13 Microsoft Agent 736
17 Files and Streams 757 6
17.1 Introduction 757
17.2 Data Hierarchy 757
17.3 Files and Streams 759
17.4 Classes File and Directory 761
17.5 Creating a Sequential-Access File 771
17.6 Reading Data from a Sequential-Access File 783
17.7 Random-Access Files 794
17.8 Creating a Random-Access File 798
17.9 Writing Data Randomly to a Random-Access File 802
17.10 Reading Data Sequentially from a Random-Access File 807
17.11 Case Study: A Transaction-Processing Program 812
18 Extensible Markup Language (XML) 838
18.1 Introduction 839
18.2 XML Documents 839
18.3 XML Namespaces 844
18.4 Document Object Model (DOM) 847
18.5 Document Type Definitions (DTDs), Schemas and Validation 865
18.5.1 Document Type Definitions 866
18.5.2 Microsoft XML Schemas 869
18.5.3 W3C XML Schema 872
XIV Contents
18.5.4 Schema Validation in C# 873
18.6 Extensible Stylesheet Language and XslTransform 877
18.7 Microsoft BizTalk™ 884
18.8 Internet and World Wide Web Resources 887
19 Database, SQL and
ADO .NET 895
19.1 Introduction 896
19.2 Relational Database Model 897
19.3 Relational Database Overview: Books Database 898
19.4 Structured Query Language (SQL) 905
19.4.1 Basic SELECT Query 905
19.4.2 WHERE Clause 906
19.4.3 ORDER BY Clause 909
19.4.4 Merging Data from Multiple Tables: INNER JOIN 912
19.4.5 Joining Data from Tables Authors, AuthorISBN,
Titles and Publishers 914
19.4.6 INSERT Statement 917
19.4.7 UPDATE Statement 918
19.4.8 DELETE Statement 919
19.5 ADO .NET Object Model 920
19.6 Programming with ADO .NET: Extracting Information from a DBMS 921
19.6.1 Connecting to and Querying an Access Data Source 921
19.6.2 Querying the Books Database 928
19.7 Programming with ADO.NET: Modifying a DBMS 930
19.8 Reading and Writing XML Files 938
20 ASP .NET, Web Forms and Web Controls 948
20.1 Introduction 949
20.2 Simple HTTP Transaction 950
20.3 System Architecture 952
20.4 Creating and Running a Simple Web Form Example 953
20.5 Web Controls 966
20.5.1 Text and Graphics Controls 967
20.5.2 AdRotator Control 971
20.5.3 Validation Controls 976
20.6 Session Tracking 987
20.6.1 Cookies 988
20.6.2 Session Tracking with HttpSessionState 997
20.7 Case Study: Online Guest Book 1006
20.8 Case Study: Connecting to a Database in ASP .NET 1013
20.9 Tracing 1027
20.10 Internet and World Wide Web Resources 1030
21 ASP .NET and Web Services 1039
21.1 Introduction 1040
Contents XV
21.2 Web Services 1041
21.3 Simple Object Access Protocol (SOAP) and Web Services 1044
21.4 Publishing and Consuming Web Services 1046
21.5 Session Tracking in Web Services 1062
21.6 Using Web Forms and Web Services 1075
21.7 Case Study: Temperature Information Application 1081
21.8 User-Defined Types in Web Services 1091
22 Networking: Streams-Based Sockets and Datagrams1106
22.1 Introduction 1107
22.2 Establishing a Simple Server (Using Stream Sockets) 1108
22.3 Establishing a Simple Client (Using Stream Sockets) 1110
22.4 Client/Server Interaction with Stream-Socket Connections 1111
22.5 Connectionless Client/Server Interaction with Datagrams 1120
22.6 Client/Server Tic-Tac-Toe Using a Multithreaded Server 1125
23 Data Structures and Collections 1145
23.1 Introduction 1146
23.2 Self-Referential Classes 1146
23.3 Linked Lists 1148
23.4 Stacks 1160
23.5 Queues 1165
23.6 Trees 1168
23.6.1 Binary Search Tree of Integer Values 1170
23.6.2 Binary Search Tree of IComparable Objects 1177
23.7 Collection Classes 1185
23.7.1 Class Array 1185
23.7.2 Class ArrayList 1188
23.7.3 Class Stack 1194
23.7.4 Class Hashtable 1198
24 Accessibility 1212
24.1 Introduction 1213
24.2 Regulations and Resources 1214
24.3 Web Accessibility Initiative 1216
24.4 Providing Alternatives for Images 1216
24.5 Maximizing Readability by Focusing on Structure 1218
24.6 Accessibility in Visual Studio .NET 1218
24.6.1 Enlarging Toolbar Icons 1219
24.6.2 Enlarging the Text 1220
24.6.3 Modifying the Toolbox 1221
24.6.4 Modifying the Keyboard 1221
24.6.5 Rearranging Windows 1222
24.7 Accessibility in C# 1224
24.8 Accessibility in XHTML Tables 1230
24.9 Accessibility in XHTML Frames 1234
XVI Contents
24.10 Accessibility in XML 1235
24.11 Using Voice Synthesis and Recognition with VoiceXML™ 1235
24.12 CallXML™ 1243
24.13 JAWS® for Windows 1248
24.14 Other Accessibility Tools 1249
24.15 Accessibility in Microsoft® Windows® 2000 1251
24.15.1 Tools for People with Visual Impairments 1252
24.15.2 Tools for People with Hearing Impairments 1254
24.15.3 Tools for Users Who Have Difficulty Using the Keyboard 1255
24.15.4 Microsoft Narrator 1258
24.15.5 Microsoft On-Screen Keyboard 1261
24.15.6 Accessibility Features in Microsoft Internet Explorer 5.5 1262
24.16 Internet and World Wide Web Resources 1264
A Operator Precedence Chart 1273
B Number Systems (on CD) 1275
B.1 Introduction 1276
B.2 Abbreviating Binary Numbers as Octal Numbers and
Hexadecimal Numbers 1279
B.3 Converting Octal Numbers and Hexadecimal Numbers
to Binary Numbers 1281
B.4 Converting from Binary, Octal or Hexadecimal to Decimal 1281
B.5 Converting from Decimal to Binary, Octal, or Hexadecimal 1282
B.6 Negative Binary Numbers: Two’s Complement Notation 1283
C Career Opportunities (on CD) 1289
C.1 Introduction 1290
C.2 Resources for the Job Seeker 1291
C.3 Online Opportunities for Employers 1292
C.4 Recruiting Services 1297
C.5 Career Sites 1298
C.6 Internet and World Wide Web Resources 1303
D Visual Studio .NET Debugger 1311
D.1 Introduction 1312
D.2 Breakpoints 1313
D.3 Examining Data 1315
D.4 Program Control 1318
D.5 Additional Method Debugging Capabilities 1322
D.6 Additional Class Debugging Capabilities 1324
E Generating Documentation in Visual Studio (on CD) 1329
E.1 Introduction 1330
E.2 Documentation Comments 1330
E.3 Documenting C# Source Code 1331
Contents XVII
E.4 Creating Comment Web Pages 1339
E.5 Creating XML Documentation Files 1341
F ASCII Character Set 1348
G Unicode® (on CD) 1349
G.1 Introduction 1350
G.2 Unicode Transformation Formats 1351
G.3 Characters and Glyphs 1352
G.4 Advantages and Disadvantages of Unicode 1353
G.5 Unicode Consortium’s Web Site 1353
G.6 Using Unicode 1355
G.7 Character Ranges 1357
H COM Integration (on CD) 1362
H.1 Introduction 1362
H.2 ActiveX Integration 1364
H.3 DLL Integration 1367
H.4 Internet and World Wide Web Resources 1371
I Introduction to HyperText Markup Language 4:
Part 1 (on CD) 1374
I.1 Introduction 1375
I.2 Markup Languages 1375
I.3 Editing HTML 1376
I.4 Common Elements 1376
I.5 Headers 1379
I.6 Linking 1380
I.7 Images 1382
I.8 Special Characters and More Line Breaks 1386
I.9 Unordered Lists 1388
I.10 Nested and Ordered Lists 1389
I.11 Internet and World Wide Web Resources 1392
J Introduction to HyperText Markup Language 4:
Part 2 (on CD) 1397
J.1 Introduction 1398
J.2 Basic HTML Tables 1398
J.3 Intermediate HTML Tables and Formatting 1400
J.4 Basic HTML Forms 1403
J.5 More Complex HTML Forms 1406
J.6 Internal Linking 1413
J.7 Creating and Using Image Maps 1416
J.8 <meta> Tags 1418
J.9 frameset Element 1420
XVIII Contents
J.10 Nested framesets 1422
J.11 Internet and World Wide Web Resources 1424
K Introduction to XHTML: Part 1 (on CD) 1430
K.1 Introduction 1431
K.2 Editing XHTML 1431
K.3 First XHTML Example 1432
K.4 W3C XHTML Validation Service 1435
K.5 Headers 1436
K.6 Linking 1438
K.7 Images 1441
K.8 Special Characters and More Line Breaks 1445
K.9 Unordered Lists 1447
K.10 Nested and Ordered Lists 1448
K.11 Internet and World Wide Web Resources 1451
L Introduction to XHTML: Part 2 (on CD) 1456
L.1 Introduction 1457
L.2 Basic XHTML Tables 1457
L.3 Intermediate XHTML Tables and Formatting 1460
L.4 Basic XHTML Forms 1462
L.5 More Complex XHTML Forms 1465
L.6 Internal Linking 1473
L.7 Creating and Using Image Maps 1476
L.8 meta Elements 1478
L.9 frameset Element 1479
L.10 Nested framesets 1483
L.11 Internet and World Wide Web Resources 1485
M HTML/XHTML Special Characters 1491
N HTML/XHTML Colors 1492
O Bit Manipulation (on CD) 1495
O.1 Introduction 1496
O.2 Bit Manipulation and the Bitwise Operators 1496
O.3 Class BitArray 1508
P Crystal Reports® for Visual Studio .NET 1513
P.1 Introduction 1513
P.2 Crystal Reports Web Site Resources 1513
P.3 Crystal Reports and Visual Studio .NET 1514
Bibliography 1518
Index 1522
Illustrations
1 Introduction to Computers, the Internet, the Web and C#
1.1 .NET Languages . 19
2 Introduction to the Visual Studio .NET IDE
2.1 Start Page in Visual Studio .NET. 35
2.2 New Project dialog. 36
2.3 Visual Studio .NET environment after a new project has been created. 37
2.4 Visual Studio .NET menu bar. 38
2.5 Visual Studio .NET menu summary. 38
2.6 Visual Studio .NET toolbar. 38
2.7 Tool tip demonstration. 39
2.8 Toolbar icons for various Visual Studio .NET windows. 39
2.9 Solution Explorer window. 40
2.10 Toolbox window. 41
2.11 Demonstrating window auto-hide. 41
2.12 Properties window. 43
2.13 Dynamic Help window. 44
2.14 Simple program as it executes. 45
2.15 Creating a new Windows application. 45
2.16 Setting the project location. 46
2.17 Setting the form’s Text property. 46
2.18 Form with sizing handles. 47
2.19 Changing property BackColor. 47
2.20 Adding a new label to the form. 48
2.21 Label in position with its Text property set. 48
2.22 Properties window displaying the label’s properties. 49
2.23 Font window for selecting fonts, styles and sizes. 49
2.24 Centering the text in the label. 50
XX Illustrations
2.25 Inserting and aligning the picture box. 50
2.26 Image property of the picture box. 51
2.27 Selecting an image for the picture box. 51
2.28 Picture box after the image has been inserted. 51
2.29 IDE in run mode, with the running application in the foreground. 52
3 Introduction to C# Programming
3.1 Our first program in C#. 60
3.2 Visual Studio .NET-generated console application. 65
3.3 Execution of the Welcome1 program. 66
3.4 Printing on one line with separate statements. 67
3.5 Printing on multiple lines with a single statement. 67
3.6 Some common escape sequences. 68
3.7 Displaying multiple lines in a dialog. 68
3.8 Adding a reference to an assembly in Visual Studio .NET. 70
3.9 Internet Explorer’s GUI. 71
3.10 Dialog displayed by calling MessageBox.Show. 71
3.11 Addition program that adds two values entered by the user. 72
3.12 Memory location showing name and value of variable number1. 75
3.13 Memory locations after values for variables number1 and number2
have been input. 76
3.14 Memory locations after a calculation. 76
3.15 Arithmetic operators. 77
3.16 Precedence of arithmetic operators. 78
3.17 Order in which a second-degree polynomial is evaluated. 80
3.18 Equality and relational operators. 81
3.19 Using equality and relational operators. 81
3.20 Precedence and associativity of operators discussed in this chapter. 85
4 Control Structures: Part 1
4.1 Flowcharting C#’s sequence structure. 97
4.2 C# keywords. 98
4.3 Flowcharting a single-selection if structure. 100
4.4 Flowcharting a double-selection if/else structure. 101
4.5 Flowcharting the while repetition structure. 106
4.6 Pseudocode algorithm that uses counter-controlled repetition to solve
the class-average problem. 107
4.7 Class average program with counter-controlled repetition. 107
4.8 Pseudocode algorithm that uses sentinel-controlled repetition to solve
the class-average problem. 111
4.9 Class-average program with sentinel-controlled repetition. 112
4.10 Pseudocode for examination-results problem. 118
4.11 C# program for examination-results problem. 118
4.12 Arithmetic assignment operators. 120
4.13 The increment and decrement operators. 121
4.14 The difference between preincrementing and postincrementing. 122
4.15 Precedence and associativity of the operators discussed so far in this book. 123
Illustrations XXI
4.16 IDE showing program code for Fig. 2.15. 125
4.17 Windows Form Designer generated code when expanded. 126
4.18 Code generated by the IDE for welcomeLabel. 127
4.19 Using the Properties window to set a property value. 127
4.20 Windows Form Designer generated code reflecting new property values. 128
4.21 Changing a property in the code view editor. 128
4.22 New Text property value reflected in design mode. 129
4.23 Method FrmASimpleProgram_Load. 129
4.24 Changing a property value at runtime. 130
5 Control Structures: Part 2
5.1 Counter-controlled repetition with while structure. 141
5.2 Counter-controlled repetition with the for structure. 142
5.3 Components of a typical for header. 143
5.4 Flowcharting a typical for repetition structure. 146
5.5 Summation using for. 147
5.6 Icons for message dialogs. 148
5.7 Buttons for message dialogs. 148
5.8 Calculating compound interest with for. 149
5.9 string formatting codes. 151
5.10 switch multiple-selection structure. 152
5.11 Flowcharting the switch multiple-selection structure. 155
5.12 do/while repetition structure. 156
5.13 Flowcharting the do/while repetition structure. 157
5.14 break statement in a for structure. 158
5.15 continue statement in a for structure. 159
5.16 Truth table for the && (conditional AND) operator. 161
5.17 Truth table for the || (conditional OR) operator. 162
5.18 Truth table for the logical exclusive OR (^) operator. 163
5.19 Truth table for operator! (logical NOT). 163
5.20 Conditional and logical operators. 164
5.21 Precedence and associativity of the operators discussed so far. 166
5.22 C#’s single-entry/single-exit sequence, selection and repetition structures. 167
5.23 Rules for forming structured programs. 168
5.24 Simplest flowchart. 168
5.25 Repeatedly applying rule 2 of Fig. 5.23 to the simplest flowchart. 169
5.26 Applying rule 3 of Fig. 5.23 to the simplest flowchart. 169
5.27 Stacked, nested and overlapped building blocks. 170
5.28 Unstructured flowchart. 170
6 Methods
6.1 Hierarchical boss method/worker method relationship. 180
6.2 Commonly used Math class methods. 182
6.3 Using programmer-defined method Square. 183
6.4 Programmer-defined Maximum method. 188
6.5 Allowed implicit conversions. 194
6.6 Namespaces in the Framework Class Library. 195
XXII Illustrations
6.7 C# built-in data types. 196
6.8 Demonstrating ref and out parameters. 198
6.9 Random integers in the range 1–6. 201
6.10 Rolling dice in a Windows application . 203
6.11 Simulating rolling 12 six-sided dice. 205
6.12 Program to simulate the game of craps. 208
6.13 Scoping. 213
6.14 Recursive evaluation of 5!. 217
6.15 Calculating factorials with a recursive method. 217
6.16 Recursively generating Fibonacci numbers. 219
6.17 Set of recursive calls to method Fibonacci. 221
6.18 Using overloaded methods. 223
6.19 Syntax error generated from overloaded methods with identical
parameter lists and different return types. 225
6.20 The Towers of Hanoi for the case with four disks. 234
7 Arrays
7.1 A 12-element array. 238
7.2 Precedence and associativity of the operators discussed so far. 239
7.3 Initializing element arrays in three different ways. 240
7.4 Computing the sum of the elements of an array. 242
7.5 Program that prints histograms. 243
7.6 Using arrays to eliminate a switch structure. 245
7.7 Simple student-poll analysis program. 248
7.8 Passing arrays and individual array elements to methods. 251
7.9 Passing an array reference by value and by reference . 254
7.10 Sorting an array with bubble sort. 257
7.11 Linear search of an array. 260
7.12 Binary search of a sorted array. 262
7.13 Double-subscripted array with three rows and four columns. 266
7.14 Initializing multidimensional arrays. 267
7.15 Example using double-subscripted arrays. 270
7.16 Using For Each/Next with an array. 272
8 Object-Based Programming
8.1 Time1 abstract data type represents the time in 24-hour format. 283
8.2 Using an abstract data type. 287
8.3 Accessing private class members from client code generates
syntax errors. 291
8.4 Overloaded constructors provide flexible object-initialization options. 293
8.5 Overloaded constructor demonstration. 295
8.6 Properties provide controlled access to an object’s data. 298
8.7 Properties demonstration for class Time3. 301
8.8 Date class encapsulates day, month and year information. 306
8.9 Employee class encapsulates employee name, birthday and hire date. 308
8.10 Composition demonstration. 309
Illustrations XXIII
8.11 this reference used implicitly and explicitly to enable an object to
manipulate its own data and invoke its own methods. (Part 1 of 2) 310
8.12 this reference demonstration. 311
8.13 static members are accessible to all objects of a class. 314
8.14 static member demonstration. 315
8.15 const and readonly class member demonstration. 318
8.16 Indexers provide subscripted access to an object’s members. 320
8.17 Assembly TimeLibrary contains class Time3. 329
8.18 Simple Class Library. 332
8.19 Assembly TimeLibrary used from class AssemblyTest. 333
8.20 Class View of class Time1 (Fig. 8.1) and class TimeTest (Fig. 8.2). 334
8.21 Object Browser when user selects Object from Time1.cs. 335
9 Object-Oriented Programming: Inheritance
9.1 Inheritance examples. 345
9.2 Inheritance hierarchy for university CommunityMembers. 346
9.3 Portion of a Shape class hierarchy. 347
9.4 Point class represents an x-y coordinate pair. 348
9.5 PointTest class demonstrates class Point functionality. 350
9.6 Circle class contains an x-y coordinate and a radius. 351
9.7 CircleTest demonstrates class Circle functionality. 354
9.8 Circle2 class that inherits from class Point. 355
9.9 Point2 class represents an x-y coordinate pair as protected data. 357
9.10 Circle3 class that inherits from class Point2. 359
9.11 CircleTest3 demonstrates class Circle3 functionality. 360
9.12 Point3 class uses properties to manipulate its private data. 362
9.13 Circle4 class that inherits from class Point3, which does not
provide protected data. 364
9.14 CircleTest4 demonstrates class Circle4 functionality. 366
9.15 Cylinder class inherits from class Circle4 and overrides
method Area. 368
9.16 Testing class Cylinder. 370
9.17 Point4 base class contains constructors and finalizer. 372
9.18 Circle5 class inherits from class Point3 and overrides a
finalizer method. 374
9.19 Order in which constructors and destructors are called. 376
10 Object-Oriented Programming: Polymorphism
10.1 Point class represents an x-y coordinate pair. 384
10.2 Circle class that inherits from class Point. 385
10.3 Assigning derived-class references to base-class references. 387
10.4 Abstract Shape base class. 394
10.5 Point2 class inherits from abstract class Shape. 395
10.6 Circle2 class that inherits from class Point2. 397
10.7 Cylinder2 class inherits from class Circle2. 398
10.8 AbstractShapesTest demonstrates polymorphism in
Point-Circle-Cylinder hierarchy. 400
XXIV Illustrations
10.9 abstract class Employee definition. 404
10.10 Boss class inherits from class Employee. 405
10.11 CommissionWorker class inherits from class Employee. 406
10.12 PieceWorker class inherits from class Employee. 408
10.13 HourlyWorker class inherits from class Employee . 410
10.14 EmployeesTest class tests the Employee class hierarchy. 412
10.15 Interface for returning age of objects of disparate classes. 415
10.16 Person class implements IAge interface. 415
10.17 Tree class implements IAge interface. 416
10.18 Demonstrate polymorphism on objects of disparate classes. 417
10.19 IShape interface provides methods Area and Volume and
property Name. 419
10.20 Point3 class implements interface IShape. 420
10.21 Circle3 class inherits from class Point3. 421
10.22 Cylinder3 class inherits from class Circle3. 423
10.23 Interfaces2Test uses interfaces to demonstrate polymorphism
in Point-Circle-Cylinder hierarchy. 424
10.24 Bubble sort using delegates. 426
10.25 Bubble-sort Form application. 427
10.26 Overloading operators for complex numbers. 430
10.27 Using operator overloading. 433
11 Exception Handling
11.1 Exception handlers for FormatException and
DivideByZeroException. 443
11.2 Demonstrating that finally blocks always execute regardless of
whether or not an exception occurs. 452
11.3 Exception properties and stack unwinding. 458
11.4 ApplicationException subclass thrown when a program
performs illegal operations on negative numbers. 463
11.5 SquareRootTest class thrown an exception if error occurs
when calculating the square root. 464
11.6 Operators checked and unchecked and the handling of
arithmetic overflow. 467
12 Graphical User Interface Concepts: Part 1
12.1 Sample Internet Explorer window with GUI components. 476
12.2 Some basic GUI components. 476
12.3 Components and controls for Windows Forms. 477
12.4 Common Form properties and events. 478
12.5 Event-handling model using delegates. 479
12.6 Events section of the Properties window. 480
12.7 Simple event-handling example using visual programming. 481
12.8 List of Form events. 482
12.9 Details of Click event. 483
12.10 Class Control properties and methods. 485
12.11 Anchoring demonstration. 486
Illustrations XXV
12.12 Manipulating the Anchor property of a control. 487
12.13 Docking demonstration. 487
12.14 Class Control layout properties. 487
12.15 Label properties. 489
12.16 TextBox properties and events. (Part 1 of 2) 489
12.17 Button properties and events. 490
12.18 Program to display hidden text in a password box. 490
12.19 GroupBox properties. 495
12.20 Panel properties. 495
12.21 Creating a Panel with scrollbars. 496
12.22 Using GroupBoxes and Panels to arrange Buttons. 496
12.23 CheckBox properties and events. 498
12.24 Using CheckBoxes to change font styles. 499
12.25 RadioButton properties and events. 502
12.26 Using RadioButtons to set message-window options. 502
12.27 PictureBox properties and events. 507
12.28 Using a PictureBox to display images. 507
12.29 Mouse events, delegates and event arguments. 509
12.30 Using the mouse to draw on a form. 510
12.31 Keyboard events, delegates and event arguments. 512
12.32 Demonstrating keyboard events . 513
12.33 GUI for Exercise 12.4. 519
12.34 GUI for Exercise 12.5. 519
12.35 GUI for Exercise 12.6. 519
13 Graphical User Interfaces Concepts: Part 2
13.1 Expanded and checked menus. 522
13.2 Visual Studio .NET Menu Designer. 523
13.3 MainMenu and MenuItem properties and events. 524
13.4 Menus for changing text font and color. 525
13.5 LinkLabel control in the design phase and in running program. 531
13.6 LinkLabel properties and events. 531
13.7 LinkLabels used to link to a folder, a Web page and an application. 532
13.8 ListBox and CheckedListBox on a form. 535
13.9 ListBox properties, methods and events. 535
13.10 String Collection Editor. 537
13.11 ListBox used in a program to add, remove and clear items. 537
13.12 CheckedListBox properties, methods and events. 540
13.13 CheckedListBox and ListBox used in a program to display a
user selection. 541
13.14 ComboBox demonstration. 543
13.15 ComboBox properties and events. 543
13.16 ComboBox used to draw a selected shape. 544
13.17 TreeView displaying a sample tree. 548
13.18 TreeView properties and events. 548
13.19 TreeNode properties and methods. 549
XXVI Illustrations
13.20 TreeNode Editor. 550
13.21 TreeView used to display directories. 550
13.22 ListView properties and events. 554
13.23 Image Collection Editor window for an ImageList component. 555
13.24 ListView displaying files and folders. 555
13.25 Tabbed pages in Visual Studio .NET. 560
13.26 TabControl with TabPages example. 561
13.27 TabPages added to a TabControl. 561
13.28 TabControl properties and events. 561
13.29 TabControl used to display various font settings. 562
13.30 MDI parent window and MDI child windows. 566
13.31 SDI and MDI forms. 566
13.32 MDI parent and MDI child events and properties. 567
13.33 Minimized and maximized child windows. 568
13.34 MenuItem property MdiList example. 569
13.35 LayoutMdi enumeration values. 570
13.36 MDI parent-window class. 571
13.37 Child class for MDI demonstration. 574
13.38 Class FrmInheritance, which inherits from class Form, contains
a button (Learn More). 575
13.39 Visual Inheritance through the Form Designer. 577
13.40 Class FrmVisualTest, which inherits from class
VisualForm.FrmInheritance, contains an additional button. 577
13.41 Custom control creation. 579
13.42 Programmer-defined control that displays the current time. 580
13.43 Custom-control creation. 582
13.44 Project properties dialog. 582
13.45 Custom control added to the ToolBox. 582
13.46 Custom control added to a Form. 583
14 Multithreading
14.1 Thread life cycle. 593
14.2 Thread-priority scheduling. 596
14.3 Threads sleeping and printing. 596
14.4 Producer and consumer threads accessing a shared object without
synchronization. 602
14.5 Producer and consumer threads accessing a shared object with
synchronization. 607
14.6 Producer and consumer threads accessing a circular buffer. 617
15 Strings, Characters and Regular Expressions
15.1 String constructors. 635
15.2 String indexer, Length properties and CopyTo method. 636
15.3 String test to determine equality. 639
15.4 StartsWith and EndsWith methods. 641
15.5 GetHashCode method demonstration. 642
15.6 Searching for characters and substrings in strings. 643
Illustrations XXVII
15.7 Substrings generated from strings. 646
15.8 Concat static method. 648
15.9 String methods Replace, ToLower, ToUpper, Trim and ToString. 649
15.10 StringBuilder class constructors. 651
15.11 StringBuilder size manipulation. 653
15.12 Append methods of StringBuilder. 655
15.13 StringBuilder’s AppendFormat method. 656
15.14 StringBuilder text insertion and removal. 658
15.15 StringBuilder text replacement. 659
15.16 Char’s static character-testing methods and case-conversion methods. 661
15.17 Card class. 664
15.18 Card dealing and shuffling simulation. 665
15.19 Character classes. 669
15.20 Regular expressions checking birthdays. 669
15.21 Quantifiers used regular expressions. 672
15.22 Validating user information using regular expressions. 672
15.23 Regex methods Replace and Split. 677
16 Graphics and Multimedia
16.1 System.Drawing namespace’s classes and structures. 686
16.2 GDI+ coordinate system. Units are measured in pixels. 687
16.3 Color structure static constants and their RGB values. 689
16.4 Color structure members . 689
16.5 Classes that derive from class Brush. 690
16.6 Color value and alpha demonstration. 690
16.7 ColorDialog used to change background and text color. 693
16.8 Font class read-only properties. 696
16.9 Fonts and FontStyles. 697
16.10 An illustration of font metrics. 699
16.11 FontFamily methods that return font-metric information. 699
16.12 FontFamily class used to obtain font-metric information. 699
16.13 Graphics methods that draw lines, rectangles and ovals. 702
16.14 Demonstration of methods that draw lines, rectangles and ellipses. 702
16.15 Ellipse bounded by a rectangle. 704
16.16 Positive and negative arc angles. 705
16.17 Graphics methods for drawing arcs. 705
16.18 Arc-method demonstration. 705
16.19 Graphics methods for drawing polygons. 708
16.20 Polygon-drawing demonstration. 708
16.21 Shapes drawn on a form. 712
16.22 Paths used to draw stars on a form. 715
16.23 Image resizing. 718
16.24 Animation of a series of images. 720
16.25 Container class for chess pieces. 723
16.26 Chess-game code. 725
16.27 Windows Media Player demonstration. 733
XXVIII Illustrations
16.28 Peedy introducing himself when the window opens. 737
16.29 Peedy’s Pleased animation. 738
16.30 Peedy’s reaction when he is clicked. 738
16.31 Peedy flying animation. 739
16.32 Peedy waiting for speech input. 740
16.33 Peedy repeating the user’s request for Seattle-style pizza. 740
16.34 Peedy repeating the user’s request for anchovies as an additional topping. 741
16.35 Peedy recounting the order. 741
16.36 Peedy calculating the total. 742
16.37 Microsoft Agent demonstration. 742
16.38 GUI for Eight Queens exercise. 755
17 Files and Streams
17.1 Data hierarchy. 759
17.2 C#’s view of an n-byte file. 760
17.3 File class methods (partial list). 761
17.4 Directory class methods (partial list). 761
17.5 Testing classes File and Directory. 762
17.6 Regular expression used to determine file types. 766
17.7 Base class for GUIs in our file-processing applications. 772
17.8 Record for sequential-access file-processing applications. 774
17.9 Create and write to a sequential-access file. 777
17.10 Sample data for the program of Fig. 17.9. 783
17.11 Reading sequential-access files. 784
17.12 Credit-inquiry program. 788
17.13 Random-access file with fixed-length records. 795
17.14 Record for random-access file-processing applications. 795
17.15 Creating files for random-access file-processing applications. 799
17.16 Writing records to random-access files. 802
17.17 Reading records from random-access files sequentially. 807
17.18 Record-transaction class for the transaction-processor case study. 812
17.19 TransactionProcessorForm class runs the transaction-processor
application. 816
17.20 StartDialogForm class enables users to access dialog boxes
associated with various transactions. 817
17.21 UpdateDialogForm class enables users to update records in
transaction-processor case study. 822
17.22 NewDialogForm class enables users to create records in
transaction-processor case study. 827
17.23 DeleteDialogForm class enables users to remove records from
files in transaction-processor case study. 830
17.24 Inventory of a hardware store. 837
18 Extensible Markup Language (XML)
18.1 XML used to mark up an article. 839
18.2 article.xml displayed by Internet Explorer. 842
18.3 XML to mark up a business letter. 842
Illustrations XXIX
18.4 XML namespaces demonstration. 844
18.5 Default namespaces demonstration. 846
18.6 Tree structure for Fig. 18.1. 847
18.7 XmlNodeReader used to iterate through an XML document. 848
18.8 DOM structure of an XML document illustrated by a class . 851
18.9 XPathNavigator class used to navigate selected nodes. 858
18.10 XML document that describes various sports . 864
18.11 XPath expressions and descriptions. 865
18.12 Document Type Definition (DTD) for a business letter. 866
18.13 XML document referencing its associated DTD. 867
18.14 XML Validator validates an XML document against a DTD. 869
18.15 XML Validator displaying an error message. 870
18.16 XML document that conforms to a Microsoft Schema document. 870
18.17 Microsoft Schema file that contains structure to which
bookxdr.xml conforms. 871
18.18 XML document that conforms to W3C XML Schema. 872
18.19 XSD Schema document to which bookxsd.xml conforms. 872
18.20 Schema-validation example. 874
18.21 XML document that does not conform to the XSD schema of Fig. 18.19. 876
18.22 XML file that does not conform to the Schema in Fig. 18.17. 876
18.23 XML document containing book information. 878
18.24 XSL document that transforms sorting.xml (Fig. 18.23) into XHTML. 879
18.25 XSL style sheet applied to an XML document. 882
18.26 BizTalk terminology. 885
18.27 BizTalk markup using an offer Schema. 885
19 Database, SQL and ADO .NET
19.1 Relational-database structure of an Employee table. 897
19.2 Result set formed by selecting Department and Location data
from the Employee table. 898
19.3 Authors table from Books. 898
19.4 Data from the Authors table of Books . 899
19.5 Publishers table from Books. 899
19.6 Data from the Publishers table of Books. 899
19.7 AuthorISBN table from Books. 900
19.8 Data from AuthorISBN table in Books. 900
19.9 Titles table from Books. 901
19.10 Data from the Titles table of Books. 901
19.11 Table relationships in Books. 904
19.12 SQL query keywords. 905
19.13 authorID and lastName from the Authors table. 906
19.14 Titles with copyrights after 1999 from table Titles. 907
19.15 Authors from the Authors table whose last names start with D. 908
19.16 Authors from table Authors whose last names contain i as the
second letter. 909
19.17 Authors from table Authors in ascending order by lastName. 909
XXX Illustrations
19.18 Authors from table Authors in descending order by lastName. 910
19.19 Authors from table Authors in ascending order by lastName and
by firstName. 911
19.20 Books from table Titles whose titles end with How to Program
in ascending order by title. 912
19.21 Authors from table Authors and ISBN numbers of the authors’
books, sorted in ascending order by lastName and firstName. 913
19.22 TitleAuthor query of Books database. 914
19.23 Portion of the result set produced by the query in Fig. 19.22. 915
19.24 Authors after an INSERT operation to add a record. 917
19.25 Table Authors after an UPDATE operation to change a record. 919
19.26 Table Authors after a DELETE operation to remove a record. 920
19.27 Accessing and displaying a database’s data. 921
19.28 Execute SQL statements on a database. 928
19.29 Modifying a database. 930
19.30 Application that writes an XML representation of a DataSet to a file. 939
19.31 XML document generated from DataSet in DatabaseXMLWriter. 941
20 ASP .NET, Web Forms and Web Controls
20.1 Web server/client interaction. Step 1: The GET request,
GET /books/downloads.htm HTTP/1.1. 951
20.2 Client interacting with Web server. Step 2: The HTTP response,
HTTP/1.1 200 OK. 951
20.3 Three-tier architecture. 952
20.4 ASPX page that displays the Web server’s time. 953
20.5 Code-behind file for a page that displays the Web server’s time. 955
20.6 HTML response when the browser requests WebTime.aspx. 958
20.7 Creating an ASP.NET Web Application in Visual Studio. 960
20.8 Visual Studio creating and linking a virtual directory for the
WebTime project folder. 961
20.9 Solution Explorer window for project WebTime. 961
20.10 Web Forms menu in the Toolbox. 962
20.11 Design mode of Web Form designer. 962
20.12 HTML mode of Web Form designer. 963
20.13 Code-behind file for WebForm1.aspx generated by Visual Studio .NET. 964
20.14 GridLayout and FlowLayout illustration. 965
20.15 WebForm.aspx after adding two Labels and setting their properties. 966
20.16 Web controls commonly used in ASP.NET applications. 967
20.17 Web controls demonstration. 967
20.18 AdRotator class demonstrated on a Web form . 972
20.19 Code-behind file for page demonstrating the AdRotator class. 973
20.20 AdvertisementFile used in AdRotator example. 974
20.21 Validators used in a Web Form that generates possible letter
combinations from a phone number. 977
20.22 Code-behind file for the word-generator page. 979
20.23 HTML and ECMAScript sent to the client browser. 984
Illustrations XXXI
20.24 ASPX file that presents a list of programming languages. 989
20.25 Code-behind file that writes cookies to the client. 991
20.26 ASPX page that displays book information. 994
20.27 Cookies being read from a client in an ASP .NET application. 995
20.28 HttpCookie properties. 997
20.29 Options supplied on an ASPX page. 997
20.30 Sessions are created for each user in an ASP .NET Web application. 999
20.31 HttpSessionState properties. 1003
20.32 Session information displayed in a ListBox. 1003
20.33 Session data read by an ASP .NET Web application to provide
recommendations for the user. 1004
20.34 Guest-book application GUI. 1007
20.35 ASPX file for the guest book application. 1007
20.36 Code-behind file for the guest book application. 1009
20.37 Log in Web Form. 1013
20.38 ASCX code for the header. 1015
20.39 Code-behind file for the log-in page of authors application. 1016
20.40 ASPX file that allows a user to select an author from a drop-down list. 1021
20.41 Database information input into a DataGrid . 1023
20.42 ASPX page with tracing turned off. 1028
20.43 Tracing enabled on a page. 1029
20.44 Tracing information for a project. 1029
21 ASP .NET and Web Services
21.1 ASMX file rendered in Internet Explorer. 1042
21.2 Service description for a Web service. 1043
21.3 Invoking a method of a Web service from a Web browser. 1044
21.4 Results of invoking a Web-service method from a Web browser. 1044
21.5 SOAP request for the HugeInteger Web service. 1045
21.6 HugeInteger Web service. 1046
21.7 Design view of a Web service. 1054
21.8 Adding a Web service reference to a project. 1055
21.9 Add Web Reference dialog. 1055
21.10 Web services located on localhost. 1056
21.11 Web reference selection and description. 1056
21.12 Solution Explorer after adding a Web reference to a project. 1057
21.13 Using the HugeInteger Web service. 1057
21.14 Blackjack Web service. 1063
21.15 Blackjack game that uses Blackjack Web service. 1067
21.16 Airline reservation Web service. 1076
21.17 Airline Web Service in design view. 1078
21.18 ASPX file that takes reservation information. 1078
21.19 Code-behind file for the reservation page. 1079
21.20 TemperatureServer Web service. 1082
21.21 Class that stores weather information about a city. 1085
21.22 Receiving temperature and weather data from a Web service. 1087
XXXII Illustrations
21.23 Class that stores equation information. 1093
21.24 Web service that generates random equations . 1095
21.25 Returning an object from a Web-service method. 1097
21.26 Math tutor application. 1098
22 Networking: Streams-Based Sockets and Datagrams
22.1 Server portion of a client/server stream-socket connection. 1111
22.2 Client portion of a client/server stream-socket connection. 1114
22.3 Server-side portion of connectionless client/server computing. 1120
22.4 Client portion of connectionless client/server computing. 1122
22.5 Server side of client/server Tic-Tac-Toe program. 1126
22.6 Client side of client/server Tic-Tac-Toe program. 1132
22.7 Class Square. 1139
22.8 English letters of the alphabet and decimal digits as expressed in
international Morse code. 1144
23 Data Structures and Collections
23.1 Sample self-referential Node class definition. 1147
23.2 Two self-referential class objects linked together. 1148
23.3 A graphical representation of a linked list. 1149
23.4 Definitions of classes ListNode, List and EmptyListException. 1151
23.5 Demonstrating the linked list. 1155
23.6 A graphical representation of the InsertAtFront operation. 1158
23.7 A graphical representation of the InsertAtBack operation. 1158
23.8 A graphical representation of the RemoveFromFront operation. 1159
23.9 A graphical representation of the RemoveFromBack operation. 1160
23.10 StackInheritance extends class List. 1161
23.11 Using class StackInheritance. 1162
23.12 StackComposition class encapsulates functionality of class List. 1164
23.13 QueueInheritance extends class List . 1166
23.14 Using inheritance to create a queue. 1167
23.15 A graphical representation of a binary tree. 1169
23.16 A binary search tree containing 12 values. 1169
23.17 Definitions of TreeNode and Tree for a binary search tree. 1170
23.18 Creating and traversing a binary tree. 1174
23.19 A binary search tree. 1176
23.20 Definitions of class TreeNode and Tree for manipulating
IComparable objects. 1178
23.21 Demonstrating class Tree with IComparable objects. 1181
23.22 Program that demonstrates class Array . 1186
23.23 Some methods of class ArrayList. 1189
23.24 Demomstrating the ArrayList class. 1189
23.25 Using the Stack class . 1195
23.26 Using the Hashtable class. 1200
Illustrations XXXIII
24 Accessibility
24.1 Acts designed to improve Internet and computer accessibility
for people with disabilities. 1214
24.2 We Media’s home page. (Courtesy of WeMedia, Inc.) 1215
24.3 Enlarging icons using the Customize feature. 1219
24.4 Enlarged icons in the development window. 1219
24.5 Text Editor before modifying the font size. 1220
24.6 Enlarging text in the Options window. 1220
24.7 Text Editor after the font size is modified. 1221
24.8 Adding tabs to the Toolbox. 1222
24.9 Shortcut key creation. 1223
24.10 Removing tabs from Visual Studio environment. 1223
24.11 Console windows with tabs and without tabs. 1224
24.12 Properties of class Control related to accessibility. 1225
24.13 Application with accessibility features. 1226
24.14 XHTML table without accessibility modifications. 1231
24.15 Table optimized for screen reading, using attribute headers. 1232
24.16 Home page written in VoiceXML. 1236
24.17 Publication page of Deitel and Associates’ VoiceXML page. 1238
24.18 VoiceXML tags. 1242
24.19 Hello World CallXML example. (Courtesy of Voxeo, © Voxeo
Corporation 2000–2001.) 1243
24.20 CallXML example that reads three ISBN values. (Courtesy of Voxeo,
© Voxeo Corporation 2000–2001.) 1245
24.21 CallXML elements. 1248
24.22 Display Settings dialog. 1251
24.23 Accessibility Wizard initialization options. 1252
24.24 Scroll Bar and Window Border Size dialog. 1252
24.25 Adjusting window-element sizes. 1253
24.26 Display Color Settings options. 1253
24.27 Accessibility Wizard mouse cursor adjustment tool. 1254
24.28 SoundSentry dialog. 1254
24.29 ShowSounds dialog. 1255
24.30 StickyKeys window. 1255
24.31 BounceKeys dialog. 1256
24.32 ToggleKeys window. 1256
24.33 Extra Keyboard Help dialog. 1257
24.34 MouseKeys window. 1257
24.35 Mouse Button Settings window. 1258
24.36 Mouse Speed dialog. 1259
24.37 Set Automatic Timeouts dialog. 1259
24.38 Saving new accessibility settings. 1260
24.39 Narrator window. 1260
24.40 Voice-settings window. 1261
24.41 Narrator reading Notepad text. 1261
24.42 Microsoft On-Screen Keyboard. 1262
XXXIV Illustrations
24.43 Microsoft Internet Explorer 5.5’s accessibility options. 1262
24.44 Advanced accessibility settings in Microsoft Internet Explorer 5.5. 1263
A Operator Precedence Chart
A.1 Operator precedence chart. 1273
B Number Systems (on CD)
B.1 Digits of the binary, octal, decimal and hexadecimal number systems. 1277
B.2 Comparison of the binary, octal, decimal and hexadecimal
number systems. 1278
B.3 Positional values in the decimal number system. 1278
B.4 Positional values in the binary number system. 1278
B.5 Positional values in the octal number system. 1279
B.6 Positional values in the hexadecimal number system. 1279
B.7 Decimal, binary, octal, and hexadecimal equivalents . 1279
B.8 Converting a binary number to decimal. 1281
B.9 Converting an octal number to decimal. 1281
B.10 Converting a hexadecimal number to decimal. 1282
C Career Opportunities (on CD)
C.1 Monster.com home page. (Courtesy of Monster.com.] 1292
C.2 FlipDog.com job search. (Courtesy of Flipdog.com.) 1293
C.3 List of a job seeker’s criteria. 1295
C.4 Advantage Hiring, Inc.’s Net-Interview™ service. (Courtesy of
Advantage Hiring, Inc.) 1298
C.5 eLance.com request for proposal (RFP) example.
(Courtesy of eLance, Inc.] 1301
D Visual Studio .NET Debugger
D.1 Syntax error. 1312
D.2 Debug sample program. 1313
D.3 Setting a breakpoint. 1314
D.4 Debug configuration setting. 1315
D.5 Console application suspended for debugging. 1315
D.6 Execution suspended at a breakpoint. 1316
D.7 Watch window. 1316
D.8 Autos, Locals and This windows. 1317
D.9 Immediate window. 1319
D.10 Debug toolbar icons. 1319
D.11 Breakpoints window. 1319
D.12 Disabled breakpoint. 1320
D.13 New Breakpoint dialog. 1321
D.14 Breakpoint Hit Count dialog. 1321
D.15 Breakpoint Condition dialog. 1321
D.16 Debugging methods. 1322
D.17 Call Stack window. 1323
Illustrations XXXV
D.18 IDE displaying a method’s calling point. 1323
D.19 Debug program control features. 1324
D.20 Using the Immediate window to debug methods. 1324
D.21 Object debugging example. 1325
D.22 Breakpoint location for class debugging. 1326
D.23 Expanded class in Watch window. 1327
D.24 Expanded array in Watch window. 1327
E Generating Documentation in Visual Studio (on CD)
E.1 Point marked up with XML comments. 1331
E.2 Circle class marked up with XML comments. 1333
E.3 CircleTest class marked up with XML comments. 1336
E.4 Selecting the Build Comment Web Pages from Tools menu. 1339
E.5 Saving a document to a file. 1340
E.6 XHTML documentation of class Circle. 1340
E.7 XHTML documentation of method Area method of class Circle. 1341
E.8 XML documentation generated by Visual Studio .NET. 1341
F ASCII Character Set
F.1 ASCII character set. 1348
G Unicode® (on CD) 1349
G.1 Correlation between the three encoding forms. 1352
G.2 Various glyphs of the character A. 1352
G.3 Unicode values for multiple languages. 1354
G.4 Some character ranges. 1357
H COM Integration (on CD)
H.1 ActiveX control registration. 1363
H.2 Customize Toolbox dialog with an ActiveX control selected. 1364
H.3 IDE’s toolbox and LabelScrollbar properties. 1365
H.4 ActiveX COM control integration in C#. 1365
H.5 Add Reference dialog DLL Selection. 1368
H.6 COM DLL component in C#. 1369
I Introduction to HyperText Markup Language 4:
Part 1 (on CD)
I.1 Basic HTML file. 1377
I.2 Header elements h1 through h6. 1379
I.3 Linking to other Web pages. 1380
I.4 Linking to an email address. 1381
I.5 Placing images in HTML files. 1382
I.6 Using images as link anchors. 1384
I.7 Inserting special characters into HTML. 1386
I.8 Unordered lists in HTML. 1388
XXXVI Illustrations
I.9 Nested and ordered lists in HTML. 1389
J Introduction to HyperText Markup Language 4:
Part 2 (on CD)
J.1 HTML table. 1398
J.2 Complex HTML table. 1401
J.3 Simple form with hidden fields and a text box. 1403
J.4 Form including textareas, password boxes and checkboxes. 1406
J.5 Form including radio buttons and pulldown lists. 1409
J.6 Using internal hyperlinks to make your pages more navigable. 1413
J.7 Picture with links anchored to an image map. 1416
J.8 Using meta to provide keywords and a description. 1418
J.9 Web site using two frames—navigation and content. 1420
J.10 Framed Web site with a nested frameset. 1423
K Introduction to XHTML: Part 1 (on CD)
K.1 First XHTML example. 1432
K.2 Validating an XHTML document. (Courtesy of World Wide Web
Consortium (W3C).) 1434
K.3 XHTML validation results. (Courtesy of World Wide Web
Consortium (W3C).) 1436
K.4 Header elements h1 through h6. 1437
K.5 Linking to other Web pages. 1438
K.6 Linking to an e-mail address. 1440
K.7 Placing images in XHTML files. 1441
K.8 Using images as link anchors. 1443
K.9 Inserting special characters into XHTML. 1445
K.10 Nested and ordered lists in XHTML. 1448
L Introduction to XHTML: Part 2 (on CD)
L.1 XHTML table. 1457
L.2 Complex XHTML table. 1460
L.3 Simple form with hidden fields and a textbox. 1463
L.4 Form with textareas, password boxes and checkboxes. 1466
L.5 Form including radio buttons and drop-down lists. 1469
L.6 Using internal hyperlinks to make pages more easily navigable. 1473
L.7 Image with links anchored to an image map. 1476
L.8 Using meta to provide keywords and a description. 1478
L.9 Web document containing two frames—navigation and content. 1480
L.10 XHTML document displayed in the left frame of Fig. L.5. 1482
L.11 Framed Web site with a nested frameset. 1484
L.12 XHTML table for Exercise L.7. 1489
L.13 XHTML table for Exercise L.8. 1490
M HTML/XHTML Special Characters
M.1 XHTML special characters. 1491
Illustrations XXXVII
N HTML/XHTML Colors
N.1 HTML/XHTML standard colors and hexadecimal RGB values. 1492
N.2 XHTML extended colors and hexadecimal RGB values . 1493
O Bit Manipulation (on CD)
O.1 Bitwise operators. 1497
O.2 Results of combining two bits with the bitwise AND operator (&). 1497
O.3 Results of combining two bits with the bitwise inclusive OR operator (|). 1497
O.4 Results of combining two bits with the bitwise exclusive OR operator (^). 1498
O.5 Displaying the bit representation of an integer. 1498
O.6 Demonstrating the bitwise AND, bitwise inclusive OR, bitwise
exclusive OR and bitwise complement operators. 1501
O.7 Using the bitshift operators. 1505
O.8 Bitwise assignment operators. 1507
O.9 Sieve of Eratosthenes. 1508
P Crystal Reports® for Visual Studio .NET
P.1 Report expert choices. (Courtesy Crystal Decisions) 1514
P.2 Expert formatting menu choices. (Courtesy of Crystal Decisions) 1515
P.3 Crystal Reports designer interface. (Courtesy of Crystal Decisions) 1516
Preface
Live in fragments no longer. Only connect.
Edward Morgan Forster
We wove a web in childhood,
A web of sunny air.
Charlotte Brontë
Welcome to C# and the world of Windows, Internet and World-Wide-Web programming
with Visual Studio and the .NET platform! This book is the second in our new .NET How
to Program series, which presents various leading-edge computing technologies in the con-
text of the .NET platform.
C# is the next phase in the evolution of C and C++ and was developed expressly for
Microsoft’s .NET platform. C# provides the features that are most important to program-
mers, such as object-oriented programming, strings, graphics, graphical-user-interface
(GUI) components, exception handling, multithreading, multimedia (audio, images, ani-
mation and video), file processing, prepackaged data structures, database processing,
Internet and World-Wide-Web-based client/server networking and distributed computing.
The language is appropriate for implementing Internet- and World-Wide-Web-based appli-
cations that seamlessly integrate with PC-based applications.
The .NET platform offers powerful capabilities for software development and deploy-
ment, including independence from a specific language or platform. Rather than requiring
developers to learn a new programming language, programmers can contribute to the same
software project, but write code using any (or several) of the .NET languages (such as C#,
Visual Basic .NET, Visual C++ .NET and others) with which they are most competent. In
addition to providing language independence, .NET extends program portability by
enabling .NET applications to reside on, and communicate across, multiple platforms—
thus facilitating the delivery of Web services over the Internet. The .NET platform enables
Web-based applications to be distributed to consumer-electronic devices, such as cell
Preface XXXIX
phones and personal digital assistants, as well as to desktop computers. The capabilities that
Microsoft has incorporated into the .NET platform create a new software-development par-
adigm that will increase programmer productivity and decrease development time.
New Features in C# How to Program
This edition contains many new features and enhancements, including:
• Full-Color Presentation. This book is now in full color. Full color enables readers
to see sample outputs as they would appear on a color monitor. Also, we now syn-
tax color the C# code, similar to the way Visual Studio .NET colors the code in its
editor window. Our syntax-coloring conventions are as follows:
comments appear in green
keywords appear in dark blue
literal values appear in light blue
text, class, method and variable names appear in black
errors and ASP .NET directives appear in red
• “Code Washing.” This is our term for the process we use to format the programs
in the book so that they have a carefully commented, open layout. The code ap-
pears in full color and is grouped into small, well-documented pieces. This greatly
improves code readability—an especially important goal for us, considering that
this book contains approximately 23,500 lines of code.
• Web Services and ASP .NET. Microsoft’s .NET strategy embraces the Internet
and Web as integral to the software development and deployment processes. Web
services—a key technology in this strategy—enables information sharing, com-
merce and other interactions using standard Internet protocols and technologies,
such as Hypertext Transfer Protocol (HTTP), Simple Object Access Protocol
(SOAP) and Extensible Markup Language (XML). Web services enable program-
mers to package application functionality in a form that turns the Web into a li-
brary of reusable software components. In Chapter 21, ASP .NET and Web
Services, we present a Web service that allows users to make airline seat reserva-
tions. In this example, a user accesses a Web page, chooses a seating option and
submits the page to the Web server. The page then calls a Web service that checks
seat availability. We also present information related to Web services in Appendix
P, Crystal Reports® for Visual Studio® .NET, which discusses popular reporting
software for database-intensive applications. Crystal Reports, which is integrated
into Visual Studio .NET, provides the ability to expose a report as a Web service.
The appendix provides introductory information and directs readers to a walk-
through of this process on the Crystal Decisions Web site (www.crystalde-
cisions.com/net).
• Web Forms, Web Controls and ASP .NET. Application developers must be able
to create robust, scalable Web-based applications. The .NET platform architecture
supports such applications. Microsoft’s .NET server-side technology, Active
Server Pages (ASP) .NET, allows programmers to build Web documents that re-
spond to client requests. To enable interactive Web pages, server-side programs
process information users input into HTML forms. ASP .NET is a significant de-
XL Preface
parture from previous versions of ASP, allowing developers to program Web-
based applications using the powerful object-oriented languages of .NET. ASP
.NET also provides enhanced visual programming capabilities, similar to those
used in building Windows forms for desktop programs. Programmers can create
Web pages visually, by dragging and dropping Web controls onto Web forms.
Chapter 20, ASP .NET, Web Forms and Web Controls, introduces these powerful
technologies.
• Object-Oriented Programming. Object-oriented programming is the most widely
employed technique for developing robust, reusable software, and C# offers en-
hanced object-oriented programming features. This text offers a rich presentation
of object-oriented programming. Chapter 8, Object-Based Programming, intro-
duces how to create classes and objects. These concepts are extended in Chapter
9, Object-Oriented Programming: Inheritance, which discusses how programmers
can create new classes that “absorb” the capabilities of existing classes. Chapter
10, Object-Oriented Programming: Polymorphism, familiarizes the reader with
the crucial concepts of polymorphism, abstract classes, concrete classes and inter-
faces, which facilitate powerful manipulations among objects belonging to an in-
heritance hierarchy.
• XML. Use of Extensible Markup Language (XML) is exploding in the software-
development industry, the e-business and e-commerce communities, and is perva-
sive throughout the .NET platform. Because XML is a platform-independent tech-
nology for describing data and for creating markup languages, XML’s data
portability integrates well with C#’s portable applications and services. Chapter
18, Extensible Markup Language (XML), introduces XML. In this chapter, we in-
troduce basic XML markup and discuss the technologies such as DTDs and Sche-
ma, which are used to validate XML documents’ contents. We also explain how
to programmatically manipulate XML documents using the Document Object
Model (DOM™) and how to transform XML documents into other types of doc-
uments via Extensible Stylesheet Language Transformations (XSLT).
• Multithreading. Computers enable us to perform many tasks in parallel (or con-
currently), such as printing documents, downloading files from a network and
surfing the Web. Multithreading is the technology through which programmers
can develop applications that perform concurrent tasks. Historically, a computer
has contained a single, expensive processor, which its operating system would
share among all applications. Today, processors are becoming so inexpensive that
it is possible to build affordable computers that contain many processors that work
in parallel—such computers are called multiprocessors. Multithreading is effec-
tive on both single-processor and multiprocessor systems. C#’s multithreading ca-
pabilities make the platform and its related technologies better prepared to deal
with today’s sophisticated multimedia-intensive, database-intensive, network-
based, multiprocessor-based distributed applications. Chapter 14, Multithreading,
provides a detailed discussion of multithreading.
• ADO .NET. Databases store vast amounts of information that individuals and or-
ganizations must access to conduct business. As an evolution of Microsoft's Ac-
tiveX Data Objects (ADO), ADO .NET represents a new approach for building
Preface XLI
applications that interact with databases. ADO .NET uses XML and an enhanced
object model to provide developers with the tools they need to access and manip-
ulate databases for large-scale, extensible, mission-critical multi-tier applications.
Chapter 19, Database, SQL and ADO .NET, details the capabilities of ADO .NET
and the Structured Query Language (SQL) to manipulate databases.
• Visual Studio .NET Debugger. Debuggers are programs that help programmers
find and correct logic errors in program code. Visual Studio .NET contains a pow-
erful debugging tool that allows programmers to analyze their programs line-by-
line as those programs execute. In Appendix D, Visual Studio .NET Debugger, we
explain how to use key debugger features, such as setting breakpoints and “watch-
es,” stepping into and out of procedures, and examining the procedure call stack.
• COM (Component Object Model) Integration. Prior to the introduction of .NET,
many organizations spent tremendous amounts of time and money creating reus-
able software components called COM components, which include ActiveX®
controls and ActiveX DLLs (dynamic link libraries) for Windows applications. In
Appendix H, COM Integration, we discuss some of the tools available in Visual
Studio .NET for integrating these legacy components into .NET applications. This
integration allows programmers to use existing sets of COM-based controls with
.NET components.
• XML Documentation. Documenting program code is crucial for software devel-
opment, because different programmers often work on an application during the
software’s lifecycle, which usually includes multiple versions and can span many
years. If programmers document software code and methods, other programmers
working on the application can learn and understand the logic underlying the code,
thus saving time and avoiding misunderstandings. To automate documenting pro-
grams, Visual Studio .NET provides an XML tool for C# programmers. Appendix
E, XML Documentation, explains how a programmer can insert comments in the
code, which produces a separate file providing the code documentation.
• Career Opportunities. Appendix C, Career Opportunities, introduces career ser-
vices available on the Internet. We explore online career services from both the
employer’s and employee’s perspectives. We list many Web sites at which you
can submit applications, search for jobs and review applicants (if you are interest-
ed in hiring someone). We also review services that build recruiting pages directly
into e-businesses. One of our reviewers told us that he had used the Internet as a
primary tool in a recent job search, and that this appendix would have helped him
expand his search dramatically.
• Unicode. As computer systems evolved worldwide, computer vendors developed
numeric representations of character sets and special symbols for the local lan-
guages spoken in different countries. In some cases, different representations were
developed for the same languages. Such disparate character sets hindered commu-
nication among computer systems. C# supports the Unicode Standard (main-
tained by a non-profit organization called the Unicode Consortium), which
maintains a single character set that specifies unique numeric values for characters
and special symbols in most of the world’s languages. Appendix G, Unicode, dis-
cusses the standard, overviews the Unicode Consortium Web site (www.uni-
XLII Preface
code.org) and presents a C# application that displays “Welcome to Unicode!”
in several languages.
• XHTML. The World Wide Web Consortium (W3C) has declared HTML to be a
legacy technology that will undergo no further development. HTML is being re-
placed by the Extensible Hypertext Markup Language (XHTML)—an XML-
based technology that is rapidly becoming the standard for describing Web con-
tent. We use XHTML in Chapter 18, Extensible Markup Language (XML), and
offer an introduction to the technology in Appendix K, Introduction to XHTML:
Part 1, and Appendix L, Introduction to XHTML: Part 2. These appendices over-
view headers, images, lists, image maps and other features of this emerging mark-
up language. (We also present a treatment of HTML in Appendices I and J,
because ASP .NET, used in Chapters 20 and 21, generates HTML content).
• Accessibility. Although the World Wide Web has become an important part of
many people’s lives, the medium currently presents many challenges to people
with disabilities. Individuals with hearing and visual impairments, in particular,
have difficulty accessing multimedia-rich Web sites. In an attempt to improve this
situation, the World Wide Web Consortium (W3C) launched the Web Accessibil-
ity Initiative (WAI), which provides guidelines for making Web sites accessible
to people with disabilities. Chapter 24, Accessibility, describes these guidelines
and highlights various products and services designed to improve the Web-brows-
ing experiences of individuals with disabilities. For example, the chapter introduc-
es VoiceXML and CallXML—two XML-based technologies for increasing the
accessibility of Web-based content for people with visual impairments.
• Bit Manipulation. Computers work with data in the form of binary digits, or bits,
which can assume the values 1 or 0. Computer circuitry performs various simple
bit manipulations, such as examining the value of a bit, setting the value of a bit
and reversing a bit (from 1 to 0 or from 0 to 1). Operating systems, test-equipment,
networking software and many other kinds of software require that programs com-
municate “directly with the hardware” by using bit manipulation. Appendix O, Bit
Manipulation, overviews the bit manipulation capabilities that the .NET Frame-
work provides.
Some Notes to Instructors
Students Enjoy Learning a Leading-Edge Language
Dr. Harvey M. Deitel taught introductory programming courses in universities for 20 years
with an emphasis on developing clearly written, well-designed programs. Much of what is
taught in such courses represents the basic principles of programming, concentrating on the
effective use of data types, control structures, arrays and functions. Our experience has
been that students handle the material in this book in about the same way that they handle
other introductory and intermediate programming courses. There is one noticeable differ-
ence, though: Students are highly motivated by the fact that they are learning a leading-
edge language, C#, and a leading-edge programming paradigm (object-oriented program-
ming) that will be immediately useful to them as they enter the business world. This in-
creases their enthusiasm for the material—which is essential when you consider that there
is much more to learn in a C# course now that students must master both the base language
Preface XLIII
and substantial class libraries as well. Although C# is a new language that may require pro-
grammers to revamp their skills, programmers will be motivated to do so because of the
powerful range of capabilities that Microsoft is offering in its .NET initiative.
A World of Object Orientation
In the late 1990s, universities were still emphasizing procedural programming. The lead-
ing-edge courses were using object-oriented C++, but these courses generally mixed a sub-
stantial amount of procedural programming with object-oriented programming—
something that C++ lets programmers do. Many instructors now are emphasizing a pure ob-
ject-oriented programming approach. This book—the first edition of C# How to Program
and the second text in our .NET series—takes a predominantly object-oriented approach
because of the object orientation provided in C#.
Focus of the Book
Our goal was clear: Produce a C# textbook for introductory university-level courses in
computer programming aimed at students with little or no programming experience, yet of-
fer the depth and the rigorous treatment of theory and practice demanded by both profes-
sionals and students in traditional, upper-level programming courses. To meet these
objectives, we produced a comprehensive book that patiently teaches the principles of com-
puter programming and of the C# language, including control structures, object-oriented
programming, C# class libraries, graphical-user-interface concepts, event-driven program-
ming and more. After mastering the material in this book, students will be well-prepared to
program in C# and to employ the capabilities of the .NET platform.
Multimedia-Intensive Communications
People want to communicate. Sure, they have been communicating since the dawn of civili-
zation, but the potential for information exchange has increased dramatically with the evolu-
tion of various technologies. Until recently, even computer communications were limited
mostly to digits, alphabetic characters and special characters. The current wave of communi-
cation technology involves the distribution of multimedia—people enjoy using applications
that transmit color pictures, animations, voices, audio clips and even full-motion color video
over the Internet. At some point, we will insist on three-dimensional, moving-image transmis-
sion.
There have been predictions that the Internet will eventually replace radio and televi-
sion as we know them today. Similarly, it is not hard to imagine newspapers, magazines
and books delivered to “the palm of your hand” (or even to special eyeglasses) via wireless
communications. Many newspapers and magazines already offer Web-based versions, and
some of these services have spread to the wireless world. When cellular phones were first
introduced, they were large and cumbersome. Today, they are small devices that fit in our
pockets, and many are Internet-enabled. Given the current rate of advancement, wireless
technology soon could offer enhanced streaming-video and graphics-packed services, such
as video conference calls and high-power, multi-player video games.
Teaching Approach
C# How to Program contains a rich collection of examples, exercises and projects drawn
from many fields and designed to provide students with a chance to solve interesting, real-
world problems. The code examples in this text have been tested on Windows 2000 and
XLIV Preface
Windows XP. The book concentrates on the principles of good software engineering, and
stresses program clarity. We are educators who teach edge-of-the-practice topics in indus-
try classrooms worldwide. We avoid arcane terminology and syntax specifications in favor
of teaching by example. The text emphasizes good pedagogy.1
LIVE-CODE™ Teaching Approach
C# How to Program is loaded with numerous LIVE-CODE™ examples. This style exemplifies
the way we teach and write about programming and is the focus of our multimedia Cyber
Classrooms and Web-based training courses. Each new concept is presented in the context of
a complete, working example that is immediately followed by one or more windows showing
the program’s input/output dialog. We call this method of teaching and writing the LIVE-
CODE™ Approach. We use programming languages to teach programming languages.
Reading the examples in the text is much like entering and running them on a computer.
World Wide Web Access
All of the examples for C# How to Program (and our other publications) are available on
the Internet as downloads from the following Web sites:
www.deitel.com
www.prenhall.com/deitel
Registration is quick and easy and these downloads are free. We suggest downloading all
the examples, then running each program as you read the corresponding text. Make changes
to the examples and immediately see the effects of those changes—a great way to learn pro-
gramming. Each set of instructions assumes that the user is running Windows 2000 or Win-
dows XP and is using Microsoft’s Internet Information Services (IIS). Additional setup
instructions for Web servers and other software can be found at our Web sites along with
the examples. [Note: This is copyrighted material. Feel free to use it as you study, but you
may not republish any portion of it in any form without explicit permission from Prentice
Hall and the authors.]
Visual Studio .NET, which includes C#, can be purchased and downloaded from
Microsoft. Three different versions of Visual Studio .NET are available—Enterprise, Pro-
fessional and Academic. Visit developerstore.com/devstore/ for more details
and to order. If you are a member of the Microsoft Developer Network, visit
msdn.microsoft.com/default.asp.
Objectives
Each chapter begins with objectives that inform students of what to expect and give them an
opportunity, after reading the chapter, to determine whether they have met the intended goals.
The objectives serve as confidence builders and as a source of positive reinforcement.
Quotations
The chapter objectives are followed by sets of quotations. Some are humorous, some are
philosophical and some offer interesting insights. We have found that students enjoy relat-
1. We use fonts to distinguish between Visual Studio .NET’s Integrated Development Environment
(IDE) features (such as menu names and menu items) and other elements that appear in the IDE.
Our convention is to emphasize IDE features in a sans-serif bold Helvetica font (e.g., Project
menu) and to emphasize program text in a serif bold Courier font (e.g., bool x = true;).
Preface XLV
ing the quotations to the chapter material. Many of the quotations are worth a “second look”
after you read each chapter.
Outline
The chapter outline enables students to approach the material in top-down fashion. Along
with the chapter objectives, the outline helps students anticipate future topics and set a com-
fortable and effective learning pace.
Approximately 23,500 Lines of Code in 204 Example Programs (with Program Outputs)
We present C# features in the context of complete, working C# programs. The programs
range in size from just a few lines of code to substantial examples containing several hundred
lines of code. All examples are available on the CD that accompanies the book or as down-
loads from our Web site, www.deitel.com.
607 Illustrations/Figures
An abundance of charts, line drawings and program outputs is included. The discussion of
control structures, for example, features carefully drawn flowcharts. [Note: We do not
teach flowcharting as a program-development tool, but we do use a brief, flowchart-orient-
ed presentation to explain the precise operation of each C# control structure.]
509 Programming Tips
We have included programming tips to help students focus on important aspects of program
development. We highlight hundreds of these tips in the form of Good Programming Prac-
tices, Common Programming Errors, Testing and Debugging Tips, Performance Tips,
Portability Tips, Software Engineering Observations and Look-and-Feel Observations.
These tips and practices represent the best the authors have gleaned from a combined seven
decades of programming and teaching experience. One of our students—a mathematics
major—told us that she feels this approach is like the highlighting of axioms, theorems and
corollaries in mathematics books; it provides a foundation on which to build good software.
91 Good Programming Practices
Good Programming Practices are tips that call attention to techniques that will help students
produce better programs. When we teach introductory courses to nonprogrammers, we state
that the “buzzword” for each course is “clarity,” and we tell the students that we will high-
light (in these Good Programming Practices) techniques for writing programs that are clear-
er, more understandable and more maintainable. 0.0
165 Common Programming Errors
Students learning a language—especially in their first programming course—tend to make
certain kinds of errors frequently. Pointing out these Common Programming Errors reduces
the likelihood that students will make the same mistakes. It also shortens long lines outside
instructors’ offices during office hours! 0.0
44 Testing and Debugging Tips
When we first designed this “tip type,” we thought the tips would contain suggestions strictly
for exposing bugs and removing them from programs. In fact, many of the tips describe as-
pects of C# that prevent “bugs” from getting into programs in the first place, thus simplifying
the testing and debugging process. 0.0
XLVI Preface
57 Performance Tips
In our experience, teaching students to write clear and understandable programs is by far
the most important goal for a first programming course. But students want to write programs
that run the fastest, use the least memory, require the smallest number of keystrokes or dazzle
in other ways. Students really care about performance and they want to know what they can
do to “turbo charge” their programs. We have included 57 Performance Tips that highlight
opportunities for improving program performance—making programs run faster or minimiz-
ing the amount of memory that they occupy. 0.0
16 Portability Tips
We include Portability Tips to help students write portable code and to provide insights on
how C# achieves its high degree of portability. 0.0
115 Software Engineering Observations
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 engineer-
ing. The Software Engineering Observations highlight architectural and design issues that
affect the construction of software systems, especially large-scale systems. Much of what the
student learns here will be useful in upper-level courses and in industry as the student begins
to work with large, complex real-world systems. 0.0
21 Look-and-Feel Observations
We provide Look-and-Feel Observations to highlight graphical-user-interface conventions.
These observations help students design attractive, user-friendly graphical user interfaces
that conform to industry norms. 0.0
Summary (1277 Summary bullets)
Each chapter ends with additional pedagogical devices. We present a thorough, bullet-list-
style summary of the chapter. On average, there are 39 summary bullets per chapter. This
helps the students review and reinforce key concepts.
Terminology (2932 Terms)
We include an alphabetized list of the important terms defined in the chapter in a Terminol-
ogy section. Again, this serves as further reinforcement. On average, there are 89 terms per
chapter. Each term also appears in the index, so the student can locate terms and definitions
quickly.
693 Self-Review Exercises and Answers (Count Includes Separate Parts)
Extensive self-review exercises and answers are included for self-study. These questions
and answers give the student a chance to build confidence with the material and prepare for
the regular exercises. Students should be encouraged to attempt all the self-review exercis-
es and check their answers.
367 Exercises (Solutions in Instructor’s Manual; Count Includes Separate Parts)
Each chapter concludes with a substantial set of exercises that involve simple recall of im-
portant 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 projects. These exercises cover a wide variety of topics, enabling instructors
to tailor their courses to the unique needs of their audiences and to vary course assignments
Preface XLVII
each semester. Instructors can use the exercises to form homework assignments, short quiz-
zes and major examinations. The solutions for the exercises are included in the Instructor’s
Manual and on the disks available only to instructors through their Prentice-Hall represen-
tatives. [NOTE: Please do not write to us requesting the instructor’s manual. Distri-
bution of this publication is strictly limited to college professors teaching from the
book. Instructors may obtain the solutions manual from their regular Prentice Hall
representatives. We regret that we cannot provide the solutions to professionals.] So-
lutions to approximately half the exercises are included on the C# Multimedia Cyber Class-
room CD-ROM (available in April 2002 at www.InformIT.com/
cyberclassrooms; also see the last few pages of this book or visit www.dei-
tel.com for ordering instructions). Also available in April 2002 is the boxed product, The
Complete C# Training Course, which includes both our textbook, C# How to Program and
the C# Multimedia Cyber Classroom. All of our Complete Training Course products are
available at bookstores and online booksellers, including www.InformIT.com.
Approximately 5,420 Index Entries (with approximately 6,450 Page References)
We have included an extensive Index at the back of the book. Using this resource, students
can search for any term or concept by keyword. The Index is especially useful to practicing
programmers who use the book as a reference. Each of the 2932 terms in the Terminology
sections appears in the Index (along with many more index items from each chapter). Stu-
dents can use the index in conjunction with the Terminology sections to ensure that they
have covered the key material in each chapter.
“Double Indexing” of All C# LIVE-CODE™ Examples
C# How to Program has 204 LIVE-CODE™ examples, which we have “double indexed.”
For every C# source-code program in the book, we took the file name with the .cs exten-
sion, such as ChessGame.cs, and indexed it both alphabetically (in this case, under “C”)
and as a subindex item under “Examples.” This makes it easier to find examples using par-
ticular features.
C# Multimedia Cyber Classroom and The Complete C# Training
Course,
We have prepared an interactive, CD-ROM-based, software version of C# How to Pro-
gram, called the C# Multimedia Cyber Classroom. This resource is loaded with e-Learning
features that are ideal for both learning and reference. The Cyber Classroom is packaged
with the textbook at a discount in The Complete C# Training Course. If you already have
the book and would like to purchase the C# Multimedia Cyber Classroom separately, please
visit www.InformIT.com/cyberclassrooms. The ISBN number for the C# Mul-
timedia Cyber Classroom is 0-13-064587-7. All Deitel™ Cyber Classrooms are available
in CD-ROM and Web-based training formats.
The CD provides an introduction in which the authors overview the Cyber Class-
room’s features. The textbook’s 204 LIVE-CODE™ example C# programs truly “come
alive” in the Cyber Classroom. If you are viewing a program and want to execute it, you
simply click the lightning-bolt icon, and the program will run. You immediately will see—
and hear, when working with audio-based multimedia programs—the program’s outputs.
If you want to modify a program and see the effects of your changes, simply click the
XLVIII Preface
floppy-disk icon that causes the source code to be “lifted off” the CD and “dropped into”
one of your own directories so you can edit the text, recompile the program and try out your
new version. Click the audio icon, and one of the authors will discuss the program and
“walk you through” the code.
The Cyber Classroom also provides navigational aids, including extensive hyper-
linking. The Cyber Classroom is browser based, so it remembers sections that you have vis-
ited recently and allows you to move forward or backward among these sections. The
thousands of index entries are hyperlinked to their text occurrences. Furthermore, when
you key in a term using the “find” feature, the Cyber Classroom will locate occurrences of
that term throughout the text. The Table of Contents entries are “hot,” so clicking a chapter
name takes you immediately to that chapter.
Students like the fact that solutions to approximately half the exercises in the book are
included with the Cyber Classroom. Studying and running these extra programs is a great
way for students to enhance their learning experience.
Students and professional users of our Cyber Classrooms tell us that they like the inter-
activity and that the Cyber Classroom is an effective reference due to its extensive hyper-
linking and other navigational features. We received an e-mail from a person who said that
he lives “in the boonies” and cannot take a live course at a university, so the Cyber Class-
room provided an ideal solution to his educational needs.
Professors tell us that their students enjoy using the Cyber Classroom and spend more
time on the courses and master more of the material than in textbook-only courses. For a
complete list of the available and forthcoming Cyber Classrooms and Complete Training
Courses, see the Deitel™ Series page at the beginning of this book, the product listing and
ordering information at the end of this book or visit www.deitel.com, www.pren-
hall.com/deitel and www.InformIT.com/deitel.
Deitel e-Learning Initiatives
e-Books and Support for Wireless Devices
Wireless devices will play an enormous role in the future of the Internet. Given recent band-
width enhancements and the emergence of 2.5 and 3G technologies, it is projected that,
within two years, more people will access the Internet through wireless devices than
through desktop computers. Deitel & Associates, Inc., is committed to wireless accessibil-
ity and has recently published Wireless Internet & Mobile Business How to Program. To
fulfill the needs of a wide range of customers, we currently are developing our content both
in traditional print formats and in newly developed electronic formats, such as e-books so
that students and professors can access content virtually anytime, anywhere. Visit
www.deitel.com for periodic updates on this initiative.
e-Matter
Deitel & Associates, Inc., is partnering with Prentice Hall’s parent company, Pearson PLC,
and its information technology Web site, InformIT.com, to launch the Deitel e-Matter
series at www.InformIT.com/deitel. This series will provide professors, students
and professionals with an additional source of information on specific programming topics.
e-Matter consists of stand-alone sections taken from published texts, forthcoming texts or
pieces written during the Deitel research-and-development process. Developing e-Matter
based on pre-publication books allows us to offer significant amounts of the material to ear-
Preface XLIX
ly adopters for use in courses. Some possible C# e-Matter titles we are considering include
Object-Based Programming and Object-Oriented Programming in C#; Graphical User In-
terface Programming in C#; Multithreading in C#; ASP .NET and Web Forms: A C# View;
and ASP .NET and Web Services: A C# View.
Course Management Systems: WebCT, Blackboard, and CourseCompass
We are working with Prentice Hall to integrate our How to Program Series courseware into
three Course Management Systems: WebCT, Blackboard™ and CourseCompass. These
Course Management Systems enable instructors to create, manage and use sophisticated
Web-based educational programs. Course Management System features include course cus-
tomization (such as posting contact information, policies, syllabi, announcements, assign-
ments, grades, performance evaluations and progress tracking), class and student
management tools, a gradebook, reporting tools, communication tools (such as chat rooms),
a whiteboard, document sharing, bulletin boards and more. Instructors can use these products
to communicate with their students, create online quizzes and tests from questions directly
linked to the text and automatically grade and track test results. For more information about
these upcoming products, visit www.deitel.com/whatsnew.html. For demonstra-
tions of existing WebCT, Blackboard and CourseCompass courses, visit
cms.pren_hall.com/WebCT, cms.prenhall.com/Blackboard and
cms.prenhall.com/CourseCompass, respectively.
Deitel and InformIT Newsletters
Deitel Column in the InformIT Newsletters
Deitel & Associates, Inc., contributes a weekly column to the popular InformIT newsletter,
currently subscribed to by more than 800,000 IT professionals worldwide. For opt-in reg-
istration, visit www.InformIT.com.
Deitel Newsletter
Our own free, opt-in newsletter includes commentary on industry trends and developments,
links to articles and resources from our published books and upcoming publications, infor-
mation on future publications, product-release schedules and more. For opt-in registration,
visit www.deitel.com.
The Deitel .NET Series
Deitel & Associates, Inc., is making a major commitment to .NET programming through
the launch of our .NET Series. C# .NET How to Program and Visual Basic .NET How to
Program, Second Edition are the first books in this new series. We intend to follow these
books with Advanced C# How to Program and Advanced Visual Basic .NET How to Pro-
gram, which will be published in December 2002. We also plan to publish Visual C++
.NET How to Program in July 2002, followed by Advanced Visual C++ .NET How to Pro-
gram in July 2003.
Advanced C# How to Program
C# How to Program covers introductory through intermediate-level C# programming top-
ics, as well as core programming fundamentals. By contrast, our upcoming textbook Ad-
L Preface
vanced C# How to Program will be geared toward experienced C# developers. This new
book will cover enterprise-level programming topics, including: Creating multi-tier, data-
base intensive ASP .NET applications using ADO .NET and XML; constructing custom
Windows controls; developing custom Web controls; and building Windows services. The
book also will include more in-depth explanations of object-oriented programming (with
the UML), ADO .NET, XML Web services, wireless programming and security. Advanced
C# How to Program will be published in December 2002.
Acknowledgments
One of the great pleasures of writing a textbook is acknowledging the efforts of many peo-
ple whose names may not appear on the cover, but whose hard work, cooperation, friend-
ship and understanding were crucial to the production of the book.
Many other people at Deitel & Associates, Inc., devoted long hours to this project.
• Sean E. Santry, a graduate of Boston College with degrees in Computer Science
and Philosophy, Director of Software Development at Deitel & Associates, Inc.,
and co-author of Advanced Java 2 Platform How to Program, contributed to
Chapters 1–10, 12–13 and 18–23.
• Matthew R. Kowalewski, a graduate of Bentley College with a degree in Account-
ing Informations Systems, is the Director of Wireless Development at Deitel &
Associates, Inc. He contributed to Chapters 19–20, Appendices B, F, I–N, P and
edited the Index.
• Jonathan Gadzik, a graduate of the Columbia University School of Engineering
and Applied Science with a major in Computer Science, co-authored Chapter 17
and contributed to Chapters 9, 22 and Appendices D and E.
• Kyle Lomelí, a graduate of Oberlin College with a degree in Computer Science
and a minor in East Asian Studies, contributed to Chapters 11, 14–15, 19 and 24.
• Lauren Trees, a graduate if Brown University in English, edited the entire manu-
script for smoothness, clarity and effectiveness of presentation; she also co-au-
thored the Preface, Chapter 1 and Appendix P.
• Rashmi Jayaprakash, a graduate of Boston University with a major in Computer
Science, co-authored Chapter 24 and Appendix G.
• Laura Treibick, a graduate of the University of Colorado at Boulder with a degree
in Photography and Multimedia, is Director of Multimedia at Deitel & Associates,
Inc. She contributed to Chapter 16 and enhanced many of the graphics throughout
the text.
• Betsy DuWaldt, a graduate of Metropolitan State College of Denver with a major
in Technical Communications (Writing and Editing emphasis) and a minor in
Computer Information Systems, is Editorial Director at Deitel & Associates, Inc.
She co-authored the Preface, Chapter 1 and Appendix P and managed the permis-
sions process for the book.
• Barbara Deitel applied the copy edits to the manuscript. She did this in parallel
with handling her extensive financial and administrative responsibilities at Deitel
Preface LI
& Associates, Inc., which include serving as Chief Financial Officer. [Everyone
at the company works on book content.]
• Abbey Deitel, a graduate of Carnegie Mellon University’s Industrial Management
Program and President of Deitel & Associates, Inc., recruited 40 additional full-
time employees and interns during 2001. She also leased, equipped and furnished
our second building to create the work environment from which C# How to Pro-
gram and our other year 2001 publications were produced. She suggested the title
for the How to Program series, and edited this preface and several of the book’s
chapters.
We would also like to thank the participants in the Deitel & Associates, Inc., College
Internship Program.2
• Jeffrey Hamm, a sophomore at Northeastern University in Computer Science, co-
authored Chapters 16, 18, 20–21 and Appendices D and H.
• Kalid Azad, a sophomore at Princeton University in Computer Science, contrib-
uted to Chapters 1, 2, 12–13, 16 and Appendix D. He created PowerPoint-slide an-
cillaries for Chapters 1–7 and researched Visual Studio .NET and Microsoft's
.NET initiative.
• Christopher Cassa, a junior at MIT in Computer Science, contributed to Chapters
3–7 and 18.
• David Tuttle, a senior at Harvard in Computer Science, contributed to Chapters 8,
18–19 and 24 and coded examples for Chapters 3–6, 7, 11,16–17,19, 23 and 26.
• Ori Schwartz, a sophomore at Boston University in Computer Science, produced
solutions for all the chapters and contributed to Chapter 16.
• Thiago Lucas da Silva, a sophomore at Northeastern University in Computer Sci-
ence, tested all the programming examples through the various beta releases and
release candidates of Visual Studio .NET.
• Matthew Rubino, a sophomore at Northeastern University in Computer Science,
created ancillary materials for the entire book.
• Elizabeth Rockett, a senior in English at Princeton University, edited 1-3, 7–8, 14,
17 and 19-24.
• Barbara Strauss, a senior in English at Brandeis University, edited Chapters 1–6,
9–13 and 18–24.
• Christina Carney, a senior in Psychology and Business at Framingham State Col-
lege, helped with the Preface.
2. The Deitel & Associates, Inc. College Internship Program offers a limited number of salaried po-
sitions to Boston-area college students majoring in Computer Science, Information Technology,
Marketing, Management and English. Students work at our corporate headquarters in Sudbury,
Massachusetts full-time in the summers and (for those attending college in the Boston area) part-
time during the academic year. We also offer full-time internship positions for students interested
in taking a semester off from school to gain industry experience. Regular full-time positions are
available to college graduates. For more information about this competitive program, please con-
tact Abbey Deitel at deitel@deitel.com and visit our Web site, www.deitel.com.
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf
C How To Program.pdf

More Related Content

Similar to C How To Program.pdf

Asp.net Lab manual
Asp.net Lab manualAsp.net Lab manual
Asp.net Lab manualTamil Dhasan
 
Data structures and algorithm analysis in java
Data structures and algorithm analysis in javaData structures and algorithm analysis in java
Data structures and algorithm analysis in javaMuhammad Aleem Siddiqui
 
Event Driven Programming Course Outline.pptx
Event Driven Programming Course Outline.pptxEvent Driven Programming Course Outline.pptx
Event Driven Programming Course Outline.pptxBekeleTsanga2
 
A Practical Introduction To Data Structures And Algorithm Analysis Third Edit...
A Practical Introduction To Data Structures And Algorithm Analysis Third Edit...A Practical Introduction To Data Structures And Algorithm Analysis Third Edit...
A Practical Introduction To Data Structures And Algorithm Analysis Third Edit...Claire Webber
 
A practical introduction to data structures and algorithm analysis.pdf
A practical introduction to data structures and algorithm analysis.pdfA practical introduction to data structures and algorithm analysis.pdf
A practical introduction to data structures and algorithm analysis.pdfKatie Robinson
 
Net Fundamentals
Net FundamentalsNet Fundamentals
Net FundamentalsAli Taki
 
Example PseudocodeProblem Given a sorted array a with n elements .docx
Example PseudocodeProblem Given a sorted array a with n elements .docxExample PseudocodeProblem Given a sorted array a with n elements .docx
Example PseudocodeProblem Given a sorted array a with n elements .docxcravennichole326
 
Example PseudocodeProblem Given a sorted array a with n elements .docx
Example PseudocodeProblem Given a sorted array a with n elements .docxExample PseudocodeProblem Given a sorted array a with n elements .docx
Example PseudocodeProblem Given a sorted array a with n elements .docxelbanglis
 
Python Cookbook_ Nho Vĩnh Share.pdf
Python Cookbook_ Nho Vĩnh Share.pdfPython Cookbook_ Nho Vĩnh Share.pdf
Python Cookbook_ Nho Vĩnh Share.pdfNho Vĩnh
 
Oracle forms developer 10g vol1
Oracle forms developer 10g vol1Oracle forms developer 10g vol1
Oracle forms developer 10g vol1abdull466
 
Mit press a semantic web primer - 2004 !! - (by laxxuss)
Mit press   a semantic web primer - 2004 !! - (by laxxuss)Mit press   a semantic web primer - 2004 !! - (by laxxuss)
Mit press a semantic web primer - 2004 !! - (by laxxuss)okeee
 
Python django flash_Course Content.pdf
Python django flash_Course Content.pdfPython django flash_Course Content.pdf
Python django flash_Course Content.pdfMultisoft Systems
 
Semantic web-primer
Semantic web-primerSemantic web-primer
Semantic web-primerokeee
 
Sw 5semantic web-primer
Sw 5semantic web-primerSw 5semantic web-primer
Sw 5semantic web-primerokeee
 
Really usefulebooks 0262012421_the mit press a semantic web primer 2nd editio...
Really usefulebooks 0262012421_the mit press a semantic web primer 2nd editio...Really usefulebooks 0262012421_the mit press a semantic web primer 2nd editio...
Really usefulebooks 0262012421_the mit press a semantic web primer 2nd editio...okeee
 
Microsoft .net 2015 Training in Noida Delhi ncr
Microsoft .net 2015 Training in Noida Delhi ncrMicrosoft .net 2015 Training in Noida Delhi ncr
Microsoft .net 2015 Training in Noida Delhi ncrShri Prakash Pandey
 
Oracle Business Intelligence Publisher for Primavera Contract Management Trai...
Oracle Business Intelligence Publisher for Primavera Contract Management Trai...Oracle Business Intelligence Publisher for Primavera Contract Management Trai...
Oracle Business Intelligence Publisher for Primavera Contract Management Trai...Ten Six Consulting
 
Overview of VS2010 and .NET 4.0
Overview of VS2010 and .NET 4.0Overview of VS2010 and .NET 4.0
Overview of VS2010 and .NET 4.0Bruce Johnson
 

Similar to C How To Program.pdf (20)

Asp.net Lab manual
Asp.net Lab manualAsp.net Lab manual
Asp.net Lab manual
 
Introduction to Visual Studio.NET
Introduction to Visual Studio.NETIntroduction to Visual Studio.NET
Introduction to Visual Studio.NET
 
Data structures and algorithm analysis in java
Data structures and algorithm analysis in javaData structures and algorithm analysis in java
Data structures and algorithm analysis in java
 
Event Driven Programming Course Outline.pptx
Event Driven Programming Course Outline.pptxEvent Driven Programming Course Outline.pptx
Event Driven Programming Course Outline.pptx
 
A Practical Introduction To Data Structures And Algorithm Analysis Third Edit...
A Practical Introduction To Data Structures And Algorithm Analysis Third Edit...A Practical Introduction To Data Structures And Algorithm Analysis Third Edit...
A Practical Introduction To Data Structures And Algorithm Analysis Third Edit...
 
A practical introduction to data structures and algorithm analysis.pdf
A practical introduction to data structures and algorithm analysis.pdfA practical introduction to data structures and algorithm analysis.pdf
A practical introduction to data structures and algorithm analysis.pdf
 
Net Fundamentals
Net FundamentalsNet Fundamentals
Net Fundamentals
 
Example PseudocodeProblem Given a sorted array a with n elements .docx
Example PseudocodeProblem Given a sorted array a with n elements .docxExample PseudocodeProblem Given a sorted array a with n elements .docx
Example PseudocodeProblem Given a sorted array a with n elements .docx
 
Example PseudocodeProblem Given a sorted array a with n elements .docx
Example PseudocodeProblem Given a sorted array a with n elements .docxExample PseudocodeProblem Given a sorted array a with n elements .docx
Example PseudocodeProblem Given a sorted array a with n elements .docx
 
Python Cookbook_ Nho Vĩnh Share.pdf
Python Cookbook_ Nho Vĩnh Share.pdfPython Cookbook_ Nho Vĩnh Share.pdf
Python Cookbook_ Nho Vĩnh Share.pdf
 
Oracle forms developer 10g vol1
Oracle forms developer 10g vol1Oracle forms developer 10g vol1
Oracle forms developer 10g vol1
 
Mit press a semantic web primer - 2004 !! - (by laxxuss)
Mit press   a semantic web primer - 2004 !! - (by laxxuss)Mit press   a semantic web primer - 2004 !! - (by laxxuss)
Mit press a semantic web primer - 2004 !! - (by laxxuss)
 
Python django flash_Course Content.pdf
Python django flash_Course Content.pdfPython django flash_Course Content.pdf
Python django flash_Course Content.pdf
 
Semantic web-primer
Semantic web-primerSemantic web-primer
Semantic web-primer
 
Sw 5semantic web-primer
Sw 5semantic web-primerSw 5semantic web-primer
Sw 5semantic web-primer
 
Really usefulebooks 0262012421_the mit press a semantic web primer 2nd editio...
Really usefulebooks 0262012421_the mit press a semantic web primer 2nd editio...Really usefulebooks 0262012421_the mit press a semantic web primer 2nd editio...
Really usefulebooks 0262012421_the mit press a semantic web primer 2nd editio...
 
Microsoft .net 2015 Training in Noida Delhi ncr
Microsoft .net 2015 Training in Noida Delhi ncrMicrosoft .net 2015 Training in Noida Delhi ncr
Microsoft .net 2015 Training in Noida Delhi ncr
 
Oracle Business Intelligence Publisher for Primavera Contract Management Trai...
Oracle Business Intelligence Publisher for Primavera Contract Management Trai...Oracle Business Intelligence Publisher for Primavera Contract Management Trai...
Oracle Business Intelligence Publisher for Primavera Contract Management Trai...
 
Overview of VS2010 and .NET 4.0
Overview of VS2010 and .NET 4.0Overview of VS2010 and .NET 4.0
Overview of VS2010 and .NET 4.0
 
Dot net training bangalore
Dot net training bangaloreDot net training bangalore
Dot net training bangalore
 

More from Temesgen Molla

Fundamentals_of_Database_Systems,_6th_Edition.pdf
Fundamentals_of_Database_Systems,_6th_Edition.pdfFundamentals_of_Database_Systems,_6th_Edition.pdf
Fundamentals_of_Database_Systems,_6th_Edition.pdfTemesgen Molla
 
Who moved my cheese? Book Review
Who moved my cheese? Book ReviewWho moved my cheese? Book Review
Who moved my cheese? Book ReviewTemesgen Molla
 
Introduction to Simplified instruction computer or SIC/XE
Introduction to Simplified instruction computer or SIC/XEIntroduction to Simplified instruction computer or SIC/XE
Introduction to Simplified instruction computer or SIC/XETemesgen Molla
 

More from Temesgen Molla (7)

Fundamentals_of_Database_Systems,_6th_Edition.pdf
Fundamentals_of_Database_Systems,_6th_Edition.pdfFundamentals_of_Database_Systems,_6th_Edition.pdf
Fundamentals_of_Database_Systems,_6th_Edition.pdf
 
Who moved my cheese? Book Review
Who moved my cheese? Book ReviewWho moved my cheese? Book Review
Who moved my cheese? Book Review
 
system-software-tools
system-software-toolssystem-software-tools
system-software-tools
 
Macro-processor
Macro-processorMacro-processor
Macro-processor
 
loaders and linkers
 loaders and linkers loaders and linkers
loaders and linkers
 
Assembler
AssemblerAssembler
Assembler
 
Introduction to Simplified instruction computer or SIC/XE
Introduction to Simplified instruction computer or SIC/XEIntroduction to Simplified instruction computer or SIC/XE
Introduction to Simplified instruction computer or SIC/XE
 

Recently uploaded

Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfMahmoud M. Sallam
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,Virag Sontakke
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementmkooblal
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...M56BOOKSTORE PRODUCT/SERVICE
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxsocialsciencegdgrohi
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitolTechU
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 

Recently uploaded (20)

Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdf
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of management
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptx
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 

C How To Program.pdf

  • 1. Contents Contents viii Illustrations xix Preface xxxviii 1 Introduction to Computers, the Internet, the Web and C# 1 1.1 Introduction 2 1.2 What Is a Computer? 3 1.3 Computer Organization 3 1.4 Evolution of Operating Systems 4 1.5 Personal Computing, Distributed Computing and Client/Server Computing 5 1.6 Machine Languages, Assembly Languages and High-level Languages 6 1.7 C, C++, Visual Basic .NET and Java™ 7 1.8 C# 9 1.9 Other High-level Languages 10 1.10 Structured Programming 10 1.11 Key Software Trend: Object Technology 11 1.12 Hardware Trends 13 1.13 History of the Internet and World Wide Web 13 1.14 World Wide Web Consortium (W3C) 15 1.15 Extensible Markup Language (XML) 15 1.16 Introduction to Microsoft .NET 16 1.17 .NET Framework and the Common Language Runtime 18 1.18 Tour of the Book 20 1.19 Internet and World Wide Web Resources 29
  • 2. Contents IX 2 Introduction to the Visual Studio .NET IDE 33 2.1 Introduction 34 2.2 Visual Studio .NET Integrated Development Environment (IDE) Overview 34 2.3 Menu Bar and Toolbar 37 2.4 Visual Studio .NET Windows 39 2.4.1 Solution Explorer 39 2.4.2 Toolbox 40 2.4.3 Properties Window 42 2.5 Using Help 42 2.6 Simple Program: Displaying Text and an Image 44 3 Introduction to C# Programming 59 3.1 Introduction 60 3.2 Simple Program: Printing a Line of Text 60 3.3 Another Simple Program: Adding Integers 71 3.4 Memory Concepts 75 3.5 Arithmetic 76 3.6 Decision Making: Equality and Relational Operators 80 4 Control Structures: Part 1 94 4.1 Introduction 95 4.2 Algorithms 95 4.3 Pseudocode 96 4.4 Control Structures 96 4.5 if Selection Structure 99 4.6 if/else Selection Structure 100 4.7 while Repetition Structure 105 4.8 Formulating Algorithms: Case Study 1 (Counter-Controlled Repetition) 106 4.9 Formulating Algorithms with Top-Down, Stepwise Refinement: Case Study 2 (Sentinel-Controlled Repetition) 109 4.10 Formulating Algorithms with Top-Down, Stepwise Refinement: Case Study 3 (Nested Control Structures) 116 4.11 Assignment Operators 120 4.12 Increment and Decrement Operators 121 4.13 Introduction to Windows Application Programming 124 5 Control Structures: Part 2 139 5.1 Introduction 140 5.2 Essentials of Counter-Controlled Repetition 140 5.3 for Repetition Structure 142 5.4 Examples Using the for Structure 146 5.5 switch Multiple-Selection Structure 152 5.6 do/while Repetition Structure 156 5.7 Statements break and continue 158 5.8 Logical and Conditional Operators 160 5.9 Structured-Programming Summary 166
  • 3. X Contents 6 Methods 178 6.1 Introduction 179 6.2 Program Modules in C# 179 6.3 Math Class Methods 181 6.4 Methods 181 6.5 Method Definitions 183 6.6 Argument Promotion 193 6.7 C# Namespaces 195 6.8 Value Types and Reference Types 196 6.9 Passing Arguments: Pass-by-Value vs. Pass-by-Reference 197 6.10 Random-Number Generation 200 6.11 Example: Game of Chance 207 6.12 Duration of Variables 212 6.13 Scope Rules 212 6.14 Recursion 215 6.15 Example Using Recursion: The Fibonacci Series 219 6.16 Recursion vs. Iteration 222 6.17 Method Overloading 223 7 Arrays 236 7.1 Introduction 237 7.2 Arrays 237 7.3 Declaring and Allocating Arrays 239 7.4 Examples Using Arrays 240 7.4.1 Allocating an Array and Initializing Its Elements 240 7.4.2 Totaling the Elements of an Array 242 7.4.3 Using Histograms to Display Array Data Graphically 243 7.4.4 Using the Elements of an Array as Counters 244 7.4.5 Using Arrays to Analyze Survey Results 247 7.5 Passing Arrays to Methods 250 7.6 Passing Arrays by Value and by Reference 253 7.7 Sorting Arrays 257 7.8 Searching Arrays: Linear Search and Binary Search 260 7.8.1 Searching an Array with Linear Search 260 7.8.2 Searching a Sorted Array with Binary Search 261 7.9 Multiple-Subscripted Arrays 265 7.10 foreach Repetition Structure 272 8 Object-Based Programming 280 8.1 Introduction 281 8.2 Implementing a Time Abstract Data Type with a Class 282 8.3 Class Scope 290 8.4 Controlling Access to Members 290 8.5 Initializing Class Objects: Constructors 292 8.6 Using Overloaded Constructors 293 8.7 Properties 297
  • 4. Contents XI 8.8 Composition: Objects References as Instance Variables of Other Classes 306 8.9 Using the this Reference 309 8.10 Garbage Collection 311 8.11 static Class Members 312 8.12 const and readonly Members 317 8.13 Indexers 319 8.14 Data Abstraction and Information Hiding 326 8.15 Software Reusability 327 8.16 Namespaces and Assemblies 328 8.17 Class View and Object Browser 333 9 Object-Oriented Programming: Inheritance 342 9.1 Introduction 343 9.2 Base Classes and Derived Classes 344 9.3 protected and internal Members 347 9.4 Relationship between Base Classes and Derived Classes 347 9.5 Case Study: Three-Level Inheritance Hierarchy 368 9.6 Constructors and Destructors in Derived Classes 371 9.7 Software Engineering with Inheritance 377 10 Object-Oriented Programming: Polymorphism 382 10.1 Introduction 383 10.2 Derived-Class-Object to Base-Class-Object Conversion 383 10.3 Type Fields and switch Statements 390 10.4 Polymorphism Examples 391 10.5 Abstract Classes and Methods 392 10.6 Case Study: Inheriting Interface and Implementation 394 10.7 sealed Classes and Methods 402 10.8 Case Study: Payroll System Using Polymorphism 403 10.9 Case Study: Creating and Using Interfaces 413 10.10 Delegates 425 10.11 Operator Overloading 430 11 Exception Handling 438 11.1 Introduction 439 11.2 Exception Handling Overview 440 11.3 Example: DivideByZeroException 443 11.4 .NET Exception Hierarchy 448 11.5 finally Block 449 11.6 Exception Properties 457 11.7 Programmer-Defined Exception Classes 462 11.8 Handling Overflows with Operators checked and unchecked 466 12 Graphical User Interface Concepts: Part 1 474 12.1 Introduction 475 12.2 Windows Forms 476
  • 5. XII Contents 12.3 Event-Handling Model 479 12.3.1 Basic Event Handling 480 12.4 Control Properties and Layout 484 12.5 Labels, TextBoxes and Buttons 488 12.6 GroupBoxes and Panels 495 12.7 CheckBoxes and RadioButtons 498 12.8 PictureBoxes 507 12.9 Mouse Event Handling 509 12.10 Keyboard Event Handling 511 13 Graphical User Interfaces Concepts: Part 2 520 13.1 Introduction 521 13.2 Menus 521 13.3 LinkLabels 530 13.4 ListBoxes and CheckedListBoxes 534 13.4.1 ListBoxes 537 13.4.2 CheckedListBoxes 539 13.5 ComboBoxes 542 13.6 TreeViews 547 13.7 ListViews 553 13.8 Tab Control 560 13.9 Multiple-Document-Interface (MDI) Windows 565 13.10 Visual Inheritance 574 13.11 User-Defined Controls 578 14 Multithreading 590 14.1 Introduction 591 14.2 Thread States: Life Cycle of a Thread 592 14.3 Thread Priorities and Thread Scheduling 594 14.4 Thread Synchronization and Class Monitor 599 14.5 Producer/Consumer Relationship without Thread Synchronization 601 14.6 Producer/Consumer Relationship with Thread Synchronization 607 14.7 Producer/Consumer Relationship: Circular Buffer 616 15 Strings, Characters and Regular Expressions 632 15.1 Introduction 633 15.2 Fundamentals of Characters and Strings 633 15.3 String Constructors 635 15.4 String Indexer, Length Property and CopyTo Method 636 15.5 Comparing Strings 638 15.6 String Method GetHashCode 642 15.7 Locating Characters and Substrings in Strings 643 15.8 Extracting Substrings from Strings 646 15.9 Concatenating Strings 647 15.10 Miscellaneous String Methods 648
  • 6. Contents XIII 15.11 Class StringBuilder 650 15.12 StringBuilder Indexer, Length and Capacity Properties, and EnsureCapacity Method 652 15.13 StringBuilder Append and AppendFormat Methods 654 15.14 StringBuilder Insert, Remove and Replace Methods 658 15.15 Char Methods 661 15.16 Card Shuffling and Dealing Simulation 664 15.17 Regular Expressions and Class Regex 668 16 Graphics and Multimedia 684 16.1 Introduction 685 16.2 Graphics Contexts and Graphics Objects 687 16.3 Color Control 688 16.4 Font Control 696 16.5 Drawing Lines, Rectangles and Ovals 701 16.6 Drawing Arcs 704 16.7 Drawing Polygons and Polyli]nes 707 16.8 Advanced Graphics Capabilities 711 16.9 Introduction to Multimedia 717 16.10 Loading, Displaying and Scaling Images 718 16.11 Animating a Series of Images 720 16.12 Windows Media Player 733 16.13 Microsoft Agent 736 17 Files and Streams 757 6 17.1 Introduction 757 17.2 Data Hierarchy 757 17.3 Files and Streams 759 17.4 Classes File and Directory 761 17.5 Creating a Sequential-Access File 771 17.6 Reading Data from a Sequential-Access File 783 17.7 Random-Access Files 794 17.8 Creating a Random-Access File 798 17.9 Writing Data Randomly to a Random-Access File 802 17.10 Reading Data Sequentially from a Random-Access File 807 17.11 Case Study: A Transaction-Processing Program 812 18 Extensible Markup Language (XML) 838 18.1 Introduction 839 18.2 XML Documents 839 18.3 XML Namespaces 844 18.4 Document Object Model (DOM) 847 18.5 Document Type Definitions (DTDs), Schemas and Validation 865 18.5.1 Document Type Definitions 866 18.5.2 Microsoft XML Schemas 869 18.5.3 W3C XML Schema 872
  • 7. XIV Contents 18.5.4 Schema Validation in C# 873 18.6 Extensible Stylesheet Language and XslTransform 877 18.7 Microsoft BizTalk™ 884 18.8 Internet and World Wide Web Resources 887 19 Database, SQL and ADO .NET 895 19.1 Introduction 896 19.2 Relational Database Model 897 19.3 Relational Database Overview: Books Database 898 19.4 Structured Query Language (SQL) 905 19.4.1 Basic SELECT Query 905 19.4.2 WHERE Clause 906 19.4.3 ORDER BY Clause 909 19.4.4 Merging Data from Multiple Tables: INNER JOIN 912 19.4.5 Joining Data from Tables Authors, AuthorISBN, Titles and Publishers 914 19.4.6 INSERT Statement 917 19.4.7 UPDATE Statement 918 19.4.8 DELETE Statement 919 19.5 ADO .NET Object Model 920 19.6 Programming with ADO .NET: Extracting Information from a DBMS 921 19.6.1 Connecting to and Querying an Access Data Source 921 19.6.2 Querying the Books Database 928 19.7 Programming with ADO.NET: Modifying a DBMS 930 19.8 Reading and Writing XML Files 938 20 ASP .NET, Web Forms and Web Controls 948 20.1 Introduction 949 20.2 Simple HTTP Transaction 950 20.3 System Architecture 952 20.4 Creating and Running a Simple Web Form Example 953 20.5 Web Controls 966 20.5.1 Text and Graphics Controls 967 20.5.2 AdRotator Control 971 20.5.3 Validation Controls 976 20.6 Session Tracking 987 20.6.1 Cookies 988 20.6.2 Session Tracking with HttpSessionState 997 20.7 Case Study: Online Guest Book 1006 20.8 Case Study: Connecting to a Database in ASP .NET 1013 20.9 Tracing 1027 20.10 Internet and World Wide Web Resources 1030 21 ASP .NET and Web Services 1039 21.1 Introduction 1040
  • 8. Contents XV 21.2 Web Services 1041 21.3 Simple Object Access Protocol (SOAP) and Web Services 1044 21.4 Publishing and Consuming Web Services 1046 21.5 Session Tracking in Web Services 1062 21.6 Using Web Forms and Web Services 1075 21.7 Case Study: Temperature Information Application 1081 21.8 User-Defined Types in Web Services 1091 22 Networking: Streams-Based Sockets and Datagrams1106 22.1 Introduction 1107 22.2 Establishing a Simple Server (Using Stream Sockets) 1108 22.3 Establishing a Simple Client (Using Stream Sockets) 1110 22.4 Client/Server Interaction with Stream-Socket Connections 1111 22.5 Connectionless Client/Server Interaction with Datagrams 1120 22.6 Client/Server Tic-Tac-Toe Using a Multithreaded Server 1125 23 Data Structures and Collections 1145 23.1 Introduction 1146 23.2 Self-Referential Classes 1146 23.3 Linked Lists 1148 23.4 Stacks 1160 23.5 Queues 1165 23.6 Trees 1168 23.6.1 Binary Search Tree of Integer Values 1170 23.6.2 Binary Search Tree of IComparable Objects 1177 23.7 Collection Classes 1185 23.7.1 Class Array 1185 23.7.2 Class ArrayList 1188 23.7.3 Class Stack 1194 23.7.4 Class Hashtable 1198 24 Accessibility 1212 24.1 Introduction 1213 24.2 Regulations and Resources 1214 24.3 Web Accessibility Initiative 1216 24.4 Providing Alternatives for Images 1216 24.5 Maximizing Readability by Focusing on Structure 1218 24.6 Accessibility in Visual Studio .NET 1218 24.6.1 Enlarging Toolbar Icons 1219 24.6.2 Enlarging the Text 1220 24.6.3 Modifying the Toolbox 1221 24.6.4 Modifying the Keyboard 1221 24.6.5 Rearranging Windows 1222 24.7 Accessibility in C# 1224 24.8 Accessibility in XHTML Tables 1230 24.9 Accessibility in XHTML Frames 1234
  • 9. XVI Contents 24.10 Accessibility in XML 1235 24.11 Using Voice Synthesis and Recognition with VoiceXML™ 1235 24.12 CallXML™ 1243 24.13 JAWS® for Windows 1248 24.14 Other Accessibility Tools 1249 24.15 Accessibility in Microsoft® Windows® 2000 1251 24.15.1 Tools for People with Visual Impairments 1252 24.15.2 Tools for People with Hearing Impairments 1254 24.15.3 Tools for Users Who Have Difficulty Using the Keyboard 1255 24.15.4 Microsoft Narrator 1258 24.15.5 Microsoft On-Screen Keyboard 1261 24.15.6 Accessibility Features in Microsoft Internet Explorer 5.5 1262 24.16 Internet and World Wide Web Resources 1264 A Operator Precedence Chart 1273 B Number Systems (on CD) 1275 B.1 Introduction 1276 B.2 Abbreviating Binary Numbers as Octal Numbers and Hexadecimal Numbers 1279 B.3 Converting Octal Numbers and Hexadecimal Numbers to Binary Numbers 1281 B.4 Converting from Binary, Octal or Hexadecimal to Decimal 1281 B.5 Converting from Decimal to Binary, Octal, or Hexadecimal 1282 B.6 Negative Binary Numbers: Two’s Complement Notation 1283 C Career Opportunities (on CD) 1289 C.1 Introduction 1290 C.2 Resources for the Job Seeker 1291 C.3 Online Opportunities for Employers 1292 C.4 Recruiting Services 1297 C.5 Career Sites 1298 C.6 Internet and World Wide Web Resources 1303 D Visual Studio .NET Debugger 1311 D.1 Introduction 1312 D.2 Breakpoints 1313 D.3 Examining Data 1315 D.4 Program Control 1318 D.5 Additional Method Debugging Capabilities 1322 D.6 Additional Class Debugging Capabilities 1324 E Generating Documentation in Visual Studio (on CD) 1329 E.1 Introduction 1330 E.2 Documentation Comments 1330 E.3 Documenting C# Source Code 1331
  • 10. Contents XVII E.4 Creating Comment Web Pages 1339 E.5 Creating XML Documentation Files 1341 F ASCII Character Set 1348 G Unicode® (on CD) 1349 G.1 Introduction 1350 G.2 Unicode Transformation Formats 1351 G.3 Characters and Glyphs 1352 G.4 Advantages and Disadvantages of Unicode 1353 G.5 Unicode Consortium’s Web Site 1353 G.6 Using Unicode 1355 G.7 Character Ranges 1357 H COM Integration (on CD) 1362 H.1 Introduction 1362 H.2 ActiveX Integration 1364 H.3 DLL Integration 1367 H.4 Internet and World Wide Web Resources 1371 I Introduction to HyperText Markup Language 4: Part 1 (on CD) 1374 I.1 Introduction 1375 I.2 Markup Languages 1375 I.3 Editing HTML 1376 I.4 Common Elements 1376 I.5 Headers 1379 I.6 Linking 1380 I.7 Images 1382 I.8 Special Characters and More Line Breaks 1386 I.9 Unordered Lists 1388 I.10 Nested and Ordered Lists 1389 I.11 Internet and World Wide Web Resources 1392 J Introduction to HyperText Markup Language 4: Part 2 (on CD) 1397 J.1 Introduction 1398 J.2 Basic HTML Tables 1398 J.3 Intermediate HTML Tables and Formatting 1400 J.4 Basic HTML Forms 1403 J.5 More Complex HTML Forms 1406 J.6 Internal Linking 1413 J.7 Creating and Using Image Maps 1416 J.8 <meta> Tags 1418 J.9 frameset Element 1420
  • 11. XVIII Contents J.10 Nested framesets 1422 J.11 Internet and World Wide Web Resources 1424 K Introduction to XHTML: Part 1 (on CD) 1430 K.1 Introduction 1431 K.2 Editing XHTML 1431 K.3 First XHTML Example 1432 K.4 W3C XHTML Validation Service 1435 K.5 Headers 1436 K.6 Linking 1438 K.7 Images 1441 K.8 Special Characters and More Line Breaks 1445 K.9 Unordered Lists 1447 K.10 Nested and Ordered Lists 1448 K.11 Internet and World Wide Web Resources 1451 L Introduction to XHTML: Part 2 (on CD) 1456 L.1 Introduction 1457 L.2 Basic XHTML Tables 1457 L.3 Intermediate XHTML Tables and Formatting 1460 L.4 Basic XHTML Forms 1462 L.5 More Complex XHTML Forms 1465 L.6 Internal Linking 1473 L.7 Creating and Using Image Maps 1476 L.8 meta Elements 1478 L.9 frameset Element 1479 L.10 Nested framesets 1483 L.11 Internet and World Wide Web Resources 1485 M HTML/XHTML Special Characters 1491 N HTML/XHTML Colors 1492 O Bit Manipulation (on CD) 1495 O.1 Introduction 1496 O.2 Bit Manipulation and the Bitwise Operators 1496 O.3 Class BitArray 1508 P Crystal Reports® for Visual Studio .NET 1513 P.1 Introduction 1513 P.2 Crystal Reports Web Site Resources 1513 P.3 Crystal Reports and Visual Studio .NET 1514 Bibliography 1518 Index 1522
  • 12. Illustrations 1 Introduction to Computers, the Internet, the Web and C# 1.1 .NET Languages . 19 2 Introduction to the Visual Studio .NET IDE 2.1 Start Page in Visual Studio .NET. 35 2.2 New Project dialog. 36 2.3 Visual Studio .NET environment after a new project has been created. 37 2.4 Visual Studio .NET menu bar. 38 2.5 Visual Studio .NET menu summary. 38 2.6 Visual Studio .NET toolbar. 38 2.7 Tool tip demonstration. 39 2.8 Toolbar icons for various Visual Studio .NET windows. 39 2.9 Solution Explorer window. 40 2.10 Toolbox window. 41 2.11 Demonstrating window auto-hide. 41 2.12 Properties window. 43 2.13 Dynamic Help window. 44 2.14 Simple program as it executes. 45 2.15 Creating a new Windows application. 45 2.16 Setting the project location. 46 2.17 Setting the form’s Text property. 46 2.18 Form with sizing handles. 47 2.19 Changing property BackColor. 47 2.20 Adding a new label to the form. 48 2.21 Label in position with its Text property set. 48 2.22 Properties window displaying the label’s properties. 49 2.23 Font window for selecting fonts, styles and sizes. 49 2.24 Centering the text in the label. 50
  • 13. XX Illustrations 2.25 Inserting and aligning the picture box. 50 2.26 Image property of the picture box. 51 2.27 Selecting an image for the picture box. 51 2.28 Picture box after the image has been inserted. 51 2.29 IDE in run mode, with the running application in the foreground. 52 3 Introduction to C# Programming 3.1 Our first program in C#. 60 3.2 Visual Studio .NET-generated console application. 65 3.3 Execution of the Welcome1 program. 66 3.4 Printing on one line with separate statements. 67 3.5 Printing on multiple lines with a single statement. 67 3.6 Some common escape sequences. 68 3.7 Displaying multiple lines in a dialog. 68 3.8 Adding a reference to an assembly in Visual Studio .NET. 70 3.9 Internet Explorer’s GUI. 71 3.10 Dialog displayed by calling MessageBox.Show. 71 3.11 Addition program that adds two values entered by the user. 72 3.12 Memory location showing name and value of variable number1. 75 3.13 Memory locations after values for variables number1 and number2 have been input. 76 3.14 Memory locations after a calculation. 76 3.15 Arithmetic operators. 77 3.16 Precedence of arithmetic operators. 78 3.17 Order in which a second-degree polynomial is evaluated. 80 3.18 Equality and relational operators. 81 3.19 Using equality and relational operators. 81 3.20 Precedence and associativity of operators discussed in this chapter. 85 4 Control Structures: Part 1 4.1 Flowcharting C#’s sequence structure. 97 4.2 C# keywords. 98 4.3 Flowcharting a single-selection if structure. 100 4.4 Flowcharting a double-selection if/else structure. 101 4.5 Flowcharting the while repetition structure. 106 4.6 Pseudocode algorithm that uses counter-controlled repetition to solve the class-average problem. 107 4.7 Class average program with counter-controlled repetition. 107 4.8 Pseudocode algorithm that uses sentinel-controlled repetition to solve the class-average problem. 111 4.9 Class-average program with sentinel-controlled repetition. 112 4.10 Pseudocode for examination-results problem. 118 4.11 C# program for examination-results problem. 118 4.12 Arithmetic assignment operators. 120 4.13 The increment and decrement operators. 121 4.14 The difference between preincrementing and postincrementing. 122 4.15 Precedence and associativity of the operators discussed so far in this book. 123
  • 14. Illustrations XXI 4.16 IDE showing program code for Fig. 2.15. 125 4.17 Windows Form Designer generated code when expanded. 126 4.18 Code generated by the IDE for welcomeLabel. 127 4.19 Using the Properties window to set a property value. 127 4.20 Windows Form Designer generated code reflecting new property values. 128 4.21 Changing a property in the code view editor. 128 4.22 New Text property value reflected in design mode. 129 4.23 Method FrmASimpleProgram_Load. 129 4.24 Changing a property value at runtime. 130 5 Control Structures: Part 2 5.1 Counter-controlled repetition with while structure. 141 5.2 Counter-controlled repetition with the for structure. 142 5.3 Components of a typical for header. 143 5.4 Flowcharting a typical for repetition structure. 146 5.5 Summation using for. 147 5.6 Icons for message dialogs. 148 5.7 Buttons for message dialogs. 148 5.8 Calculating compound interest with for. 149 5.9 string formatting codes. 151 5.10 switch multiple-selection structure. 152 5.11 Flowcharting the switch multiple-selection structure. 155 5.12 do/while repetition structure. 156 5.13 Flowcharting the do/while repetition structure. 157 5.14 break statement in a for structure. 158 5.15 continue statement in a for structure. 159 5.16 Truth table for the && (conditional AND) operator. 161 5.17 Truth table for the || (conditional OR) operator. 162 5.18 Truth table for the logical exclusive OR (^) operator. 163 5.19 Truth table for operator! (logical NOT). 163 5.20 Conditional and logical operators. 164 5.21 Precedence and associativity of the operators discussed so far. 166 5.22 C#’s single-entry/single-exit sequence, selection and repetition structures. 167 5.23 Rules for forming structured programs. 168 5.24 Simplest flowchart. 168 5.25 Repeatedly applying rule 2 of Fig. 5.23 to the simplest flowchart. 169 5.26 Applying rule 3 of Fig. 5.23 to the simplest flowchart. 169 5.27 Stacked, nested and overlapped building blocks. 170 5.28 Unstructured flowchart. 170 6 Methods 6.1 Hierarchical boss method/worker method relationship. 180 6.2 Commonly used Math class methods. 182 6.3 Using programmer-defined method Square. 183 6.4 Programmer-defined Maximum method. 188 6.5 Allowed implicit conversions. 194 6.6 Namespaces in the Framework Class Library. 195
  • 15. XXII Illustrations 6.7 C# built-in data types. 196 6.8 Demonstrating ref and out parameters. 198 6.9 Random integers in the range 1–6. 201 6.10 Rolling dice in a Windows application . 203 6.11 Simulating rolling 12 six-sided dice. 205 6.12 Program to simulate the game of craps. 208 6.13 Scoping. 213 6.14 Recursive evaluation of 5!. 217 6.15 Calculating factorials with a recursive method. 217 6.16 Recursively generating Fibonacci numbers. 219 6.17 Set of recursive calls to method Fibonacci. 221 6.18 Using overloaded methods. 223 6.19 Syntax error generated from overloaded methods with identical parameter lists and different return types. 225 6.20 The Towers of Hanoi for the case with four disks. 234 7 Arrays 7.1 A 12-element array. 238 7.2 Precedence and associativity of the operators discussed so far. 239 7.3 Initializing element arrays in three different ways. 240 7.4 Computing the sum of the elements of an array. 242 7.5 Program that prints histograms. 243 7.6 Using arrays to eliminate a switch structure. 245 7.7 Simple student-poll analysis program. 248 7.8 Passing arrays and individual array elements to methods. 251 7.9 Passing an array reference by value and by reference . 254 7.10 Sorting an array with bubble sort. 257 7.11 Linear search of an array. 260 7.12 Binary search of a sorted array. 262 7.13 Double-subscripted array with three rows and four columns. 266 7.14 Initializing multidimensional arrays. 267 7.15 Example using double-subscripted arrays. 270 7.16 Using For Each/Next with an array. 272 8 Object-Based Programming 8.1 Time1 abstract data type represents the time in 24-hour format. 283 8.2 Using an abstract data type. 287 8.3 Accessing private class members from client code generates syntax errors. 291 8.4 Overloaded constructors provide flexible object-initialization options. 293 8.5 Overloaded constructor demonstration. 295 8.6 Properties provide controlled access to an object’s data. 298 8.7 Properties demonstration for class Time3. 301 8.8 Date class encapsulates day, month and year information. 306 8.9 Employee class encapsulates employee name, birthday and hire date. 308 8.10 Composition demonstration. 309
  • 16. Illustrations XXIII 8.11 this reference used implicitly and explicitly to enable an object to manipulate its own data and invoke its own methods. (Part 1 of 2) 310 8.12 this reference demonstration. 311 8.13 static members are accessible to all objects of a class. 314 8.14 static member demonstration. 315 8.15 const and readonly class member demonstration. 318 8.16 Indexers provide subscripted access to an object’s members. 320 8.17 Assembly TimeLibrary contains class Time3. 329 8.18 Simple Class Library. 332 8.19 Assembly TimeLibrary used from class AssemblyTest. 333 8.20 Class View of class Time1 (Fig. 8.1) and class TimeTest (Fig. 8.2). 334 8.21 Object Browser when user selects Object from Time1.cs. 335 9 Object-Oriented Programming: Inheritance 9.1 Inheritance examples. 345 9.2 Inheritance hierarchy for university CommunityMembers. 346 9.3 Portion of a Shape class hierarchy. 347 9.4 Point class represents an x-y coordinate pair. 348 9.5 PointTest class demonstrates class Point functionality. 350 9.6 Circle class contains an x-y coordinate and a radius. 351 9.7 CircleTest demonstrates class Circle functionality. 354 9.8 Circle2 class that inherits from class Point. 355 9.9 Point2 class represents an x-y coordinate pair as protected data. 357 9.10 Circle3 class that inherits from class Point2. 359 9.11 CircleTest3 demonstrates class Circle3 functionality. 360 9.12 Point3 class uses properties to manipulate its private data. 362 9.13 Circle4 class that inherits from class Point3, which does not provide protected data. 364 9.14 CircleTest4 demonstrates class Circle4 functionality. 366 9.15 Cylinder class inherits from class Circle4 and overrides method Area. 368 9.16 Testing class Cylinder. 370 9.17 Point4 base class contains constructors and finalizer. 372 9.18 Circle5 class inherits from class Point3 and overrides a finalizer method. 374 9.19 Order in which constructors and destructors are called. 376 10 Object-Oriented Programming: Polymorphism 10.1 Point class represents an x-y coordinate pair. 384 10.2 Circle class that inherits from class Point. 385 10.3 Assigning derived-class references to base-class references. 387 10.4 Abstract Shape base class. 394 10.5 Point2 class inherits from abstract class Shape. 395 10.6 Circle2 class that inherits from class Point2. 397 10.7 Cylinder2 class inherits from class Circle2. 398 10.8 AbstractShapesTest demonstrates polymorphism in Point-Circle-Cylinder hierarchy. 400
  • 17. XXIV Illustrations 10.9 abstract class Employee definition. 404 10.10 Boss class inherits from class Employee. 405 10.11 CommissionWorker class inherits from class Employee. 406 10.12 PieceWorker class inherits from class Employee. 408 10.13 HourlyWorker class inherits from class Employee . 410 10.14 EmployeesTest class tests the Employee class hierarchy. 412 10.15 Interface for returning age of objects of disparate classes. 415 10.16 Person class implements IAge interface. 415 10.17 Tree class implements IAge interface. 416 10.18 Demonstrate polymorphism on objects of disparate classes. 417 10.19 IShape interface provides methods Area and Volume and property Name. 419 10.20 Point3 class implements interface IShape. 420 10.21 Circle3 class inherits from class Point3. 421 10.22 Cylinder3 class inherits from class Circle3. 423 10.23 Interfaces2Test uses interfaces to demonstrate polymorphism in Point-Circle-Cylinder hierarchy. 424 10.24 Bubble sort using delegates. 426 10.25 Bubble-sort Form application. 427 10.26 Overloading operators for complex numbers. 430 10.27 Using operator overloading. 433 11 Exception Handling 11.1 Exception handlers for FormatException and DivideByZeroException. 443 11.2 Demonstrating that finally blocks always execute regardless of whether or not an exception occurs. 452 11.3 Exception properties and stack unwinding. 458 11.4 ApplicationException subclass thrown when a program performs illegal operations on negative numbers. 463 11.5 SquareRootTest class thrown an exception if error occurs when calculating the square root. 464 11.6 Operators checked and unchecked and the handling of arithmetic overflow. 467 12 Graphical User Interface Concepts: Part 1 12.1 Sample Internet Explorer window with GUI components. 476 12.2 Some basic GUI components. 476 12.3 Components and controls for Windows Forms. 477 12.4 Common Form properties and events. 478 12.5 Event-handling model using delegates. 479 12.6 Events section of the Properties window. 480 12.7 Simple event-handling example using visual programming. 481 12.8 List of Form events. 482 12.9 Details of Click event. 483 12.10 Class Control properties and methods. 485 12.11 Anchoring demonstration. 486
  • 18. Illustrations XXV 12.12 Manipulating the Anchor property of a control. 487 12.13 Docking demonstration. 487 12.14 Class Control layout properties. 487 12.15 Label properties. 489 12.16 TextBox properties and events. (Part 1 of 2) 489 12.17 Button properties and events. 490 12.18 Program to display hidden text in a password box. 490 12.19 GroupBox properties. 495 12.20 Panel properties. 495 12.21 Creating a Panel with scrollbars. 496 12.22 Using GroupBoxes and Panels to arrange Buttons. 496 12.23 CheckBox properties and events. 498 12.24 Using CheckBoxes to change font styles. 499 12.25 RadioButton properties and events. 502 12.26 Using RadioButtons to set message-window options. 502 12.27 PictureBox properties and events. 507 12.28 Using a PictureBox to display images. 507 12.29 Mouse events, delegates and event arguments. 509 12.30 Using the mouse to draw on a form. 510 12.31 Keyboard events, delegates and event arguments. 512 12.32 Demonstrating keyboard events . 513 12.33 GUI for Exercise 12.4. 519 12.34 GUI for Exercise 12.5. 519 12.35 GUI for Exercise 12.6. 519 13 Graphical User Interfaces Concepts: Part 2 13.1 Expanded and checked menus. 522 13.2 Visual Studio .NET Menu Designer. 523 13.3 MainMenu and MenuItem properties and events. 524 13.4 Menus for changing text font and color. 525 13.5 LinkLabel control in the design phase and in running program. 531 13.6 LinkLabel properties and events. 531 13.7 LinkLabels used to link to a folder, a Web page and an application. 532 13.8 ListBox and CheckedListBox on a form. 535 13.9 ListBox properties, methods and events. 535 13.10 String Collection Editor. 537 13.11 ListBox used in a program to add, remove and clear items. 537 13.12 CheckedListBox properties, methods and events. 540 13.13 CheckedListBox and ListBox used in a program to display a user selection. 541 13.14 ComboBox demonstration. 543 13.15 ComboBox properties and events. 543 13.16 ComboBox used to draw a selected shape. 544 13.17 TreeView displaying a sample tree. 548 13.18 TreeView properties and events. 548 13.19 TreeNode properties and methods. 549
  • 19. XXVI Illustrations 13.20 TreeNode Editor. 550 13.21 TreeView used to display directories. 550 13.22 ListView properties and events. 554 13.23 Image Collection Editor window for an ImageList component. 555 13.24 ListView displaying files and folders. 555 13.25 Tabbed pages in Visual Studio .NET. 560 13.26 TabControl with TabPages example. 561 13.27 TabPages added to a TabControl. 561 13.28 TabControl properties and events. 561 13.29 TabControl used to display various font settings. 562 13.30 MDI parent window and MDI child windows. 566 13.31 SDI and MDI forms. 566 13.32 MDI parent and MDI child events and properties. 567 13.33 Minimized and maximized child windows. 568 13.34 MenuItem property MdiList example. 569 13.35 LayoutMdi enumeration values. 570 13.36 MDI parent-window class. 571 13.37 Child class for MDI demonstration. 574 13.38 Class FrmInheritance, which inherits from class Form, contains a button (Learn More). 575 13.39 Visual Inheritance through the Form Designer. 577 13.40 Class FrmVisualTest, which inherits from class VisualForm.FrmInheritance, contains an additional button. 577 13.41 Custom control creation. 579 13.42 Programmer-defined control that displays the current time. 580 13.43 Custom-control creation. 582 13.44 Project properties dialog. 582 13.45 Custom control added to the ToolBox. 582 13.46 Custom control added to a Form. 583 14 Multithreading 14.1 Thread life cycle. 593 14.2 Thread-priority scheduling. 596 14.3 Threads sleeping and printing. 596 14.4 Producer and consumer threads accessing a shared object without synchronization. 602 14.5 Producer and consumer threads accessing a shared object with synchronization. 607 14.6 Producer and consumer threads accessing a circular buffer. 617 15 Strings, Characters and Regular Expressions 15.1 String constructors. 635 15.2 String indexer, Length properties and CopyTo method. 636 15.3 String test to determine equality. 639 15.4 StartsWith and EndsWith methods. 641 15.5 GetHashCode method demonstration. 642 15.6 Searching for characters and substrings in strings. 643
  • 20. Illustrations XXVII 15.7 Substrings generated from strings. 646 15.8 Concat static method. 648 15.9 String methods Replace, ToLower, ToUpper, Trim and ToString. 649 15.10 StringBuilder class constructors. 651 15.11 StringBuilder size manipulation. 653 15.12 Append methods of StringBuilder. 655 15.13 StringBuilder’s AppendFormat method. 656 15.14 StringBuilder text insertion and removal. 658 15.15 StringBuilder text replacement. 659 15.16 Char’s static character-testing methods and case-conversion methods. 661 15.17 Card class. 664 15.18 Card dealing and shuffling simulation. 665 15.19 Character classes. 669 15.20 Regular expressions checking birthdays. 669 15.21 Quantifiers used regular expressions. 672 15.22 Validating user information using regular expressions. 672 15.23 Regex methods Replace and Split. 677 16 Graphics and Multimedia 16.1 System.Drawing namespace’s classes and structures. 686 16.2 GDI+ coordinate system. Units are measured in pixels. 687 16.3 Color structure static constants and their RGB values. 689 16.4 Color structure members . 689 16.5 Classes that derive from class Brush. 690 16.6 Color value and alpha demonstration. 690 16.7 ColorDialog used to change background and text color. 693 16.8 Font class read-only properties. 696 16.9 Fonts and FontStyles. 697 16.10 An illustration of font metrics. 699 16.11 FontFamily methods that return font-metric information. 699 16.12 FontFamily class used to obtain font-metric information. 699 16.13 Graphics methods that draw lines, rectangles and ovals. 702 16.14 Demonstration of methods that draw lines, rectangles and ellipses. 702 16.15 Ellipse bounded by a rectangle. 704 16.16 Positive and negative arc angles. 705 16.17 Graphics methods for drawing arcs. 705 16.18 Arc-method demonstration. 705 16.19 Graphics methods for drawing polygons. 708 16.20 Polygon-drawing demonstration. 708 16.21 Shapes drawn on a form. 712 16.22 Paths used to draw stars on a form. 715 16.23 Image resizing. 718 16.24 Animation of a series of images. 720 16.25 Container class for chess pieces. 723 16.26 Chess-game code. 725 16.27 Windows Media Player demonstration. 733
  • 21. XXVIII Illustrations 16.28 Peedy introducing himself when the window opens. 737 16.29 Peedy’s Pleased animation. 738 16.30 Peedy’s reaction when he is clicked. 738 16.31 Peedy flying animation. 739 16.32 Peedy waiting for speech input. 740 16.33 Peedy repeating the user’s request for Seattle-style pizza. 740 16.34 Peedy repeating the user’s request for anchovies as an additional topping. 741 16.35 Peedy recounting the order. 741 16.36 Peedy calculating the total. 742 16.37 Microsoft Agent demonstration. 742 16.38 GUI for Eight Queens exercise. 755 17 Files and Streams 17.1 Data hierarchy. 759 17.2 C#’s view of an n-byte file. 760 17.3 File class methods (partial list). 761 17.4 Directory class methods (partial list). 761 17.5 Testing classes File and Directory. 762 17.6 Regular expression used to determine file types. 766 17.7 Base class for GUIs in our file-processing applications. 772 17.8 Record for sequential-access file-processing applications. 774 17.9 Create and write to a sequential-access file. 777 17.10 Sample data for the program of Fig. 17.9. 783 17.11 Reading sequential-access files. 784 17.12 Credit-inquiry program. 788 17.13 Random-access file with fixed-length records. 795 17.14 Record for random-access file-processing applications. 795 17.15 Creating files for random-access file-processing applications. 799 17.16 Writing records to random-access files. 802 17.17 Reading records from random-access files sequentially. 807 17.18 Record-transaction class for the transaction-processor case study. 812 17.19 TransactionProcessorForm class runs the transaction-processor application. 816 17.20 StartDialogForm class enables users to access dialog boxes associated with various transactions. 817 17.21 UpdateDialogForm class enables users to update records in transaction-processor case study. 822 17.22 NewDialogForm class enables users to create records in transaction-processor case study. 827 17.23 DeleteDialogForm class enables users to remove records from files in transaction-processor case study. 830 17.24 Inventory of a hardware store. 837 18 Extensible Markup Language (XML) 18.1 XML used to mark up an article. 839 18.2 article.xml displayed by Internet Explorer. 842 18.3 XML to mark up a business letter. 842
  • 22. Illustrations XXIX 18.4 XML namespaces demonstration. 844 18.5 Default namespaces demonstration. 846 18.6 Tree structure for Fig. 18.1. 847 18.7 XmlNodeReader used to iterate through an XML document. 848 18.8 DOM structure of an XML document illustrated by a class . 851 18.9 XPathNavigator class used to navigate selected nodes. 858 18.10 XML document that describes various sports . 864 18.11 XPath expressions and descriptions. 865 18.12 Document Type Definition (DTD) for a business letter. 866 18.13 XML document referencing its associated DTD. 867 18.14 XML Validator validates an XML document against a DTD. 869 18.15 XML Validator displaying an error message. 870 18.16 XML document that conforms to a Microsoft Schema document. 870 18.17 Microsoft Schema file that contains structure to which bookxdr.xml conforms. 871 18.18 XML document that conforms to W3C XML Schema. 872 18.19 XSD Schema document to which bookxsd.xml conforms. 872 18.20 Schema-validation example. 874 18.21 XML document that does not conform to the XSD schema of Fig. 18.19. 876 18.22 XML file that does not conform to the Schema in Fig. 18.17. 876 18.23 XML document containing book information. 878 18.24 XSL document that transforms sorting.xml (Fig. 18.23) into XHTML. 879 18.25 XSL style sheet applied to an XML document. 882 18.26 BizTalk terminology. 885 18.27 BizTalk markup using an offer Schema. 885 19 Database, SQL and ADO .NET 19.1 Relational-database structure of an Employee table. 897 19.2 Result set formed by selecting Department and Location data from the Employee table. 898 19.3 Authors table from Books. 898 19.4 Data from the Authors table of Books . 899 19.5 Publishers table from Books. 899 19.6 Data from the Publishers table of Books. 899 19.7 AuthorISBN table from Books. 900 19.8 Data from AuthorISBN table in Books. 900 19.9 Titles table from Books. 901 19.10 Data from the Titles table of Books. 901 19.11 Table relationships in Books. 904 19.12 SQL query keywords. 905 19.13 authorID and lastName from the Authors table. 906 19.14 Titles with copyrights after 1999 from table Titles. 907 19.15 Authors from the Authors table whose last names start with D. 908 19.16 Authors from table Authors whose last names contain i as the second letter. 909 19.17 Authors from table Authors in ascending order by lastName. 909
  • 23. XXX Illustrations 19.18 Authors from table Authors in descending order by lastName. 910 19.19 Authors from table Authors in ascending order by lastName and by firstName. 911 19.20 Books from table Titles whose titles end with How to Program in ascending order by title. 912 19.21 Authors from table Authors and ISBN numbers of the authors’ books, sorted in ascending order by lastName and firstName. 913 19.22 TitleAuthor query of Books database. 914 19.23 Portion of the result set produced by the query in Fig. 19.22. 915 19.24 Authors after an INSERT operation to add a record. 917 19.25 Table Authors after an UPDATE operation to change a record. 919 19.26 Table Authors after a DELETE operation to remove a record. 920 19.27 Accessing and displaying a database’s data. 921 19.28 Execute SQL statements on a database. 928 19.29 Modifying a database. 930 19.30 Application that writes an XML representation of a DataSet to a file. 939 19.31 XML document generated from DataSet in DatabaseXMLWriter. 941 20 ASP .NET, Web Forms and Web Controls 20.1 Web server/client interaction. Step 1: The GET request, GET /books/downloads.htm HTTP/1.1. 951 20.2 Client interacting with Web server. Step 2: The HTTP response, HTTP/1.1 200 OK. 951 20.3 Three-tier architecture. 952 20.4 ASPX page that displays the Web server’s time. 953 20.5 Code-behind file for a page that displays the Web server’s time. 955 20.6 HTML response when the browser requests WebTime.aspx. 958 20.7 Creating an ASP.NET Web Application in Visual Studio. 960 20.8 Visual Studio creating and linking a virtual directory for the WebTime project folder. 961 20.9 Solution Explorer window for project WebTime. 961 20.10 Web Forms menu in the Toolbox. 962 20.11 Design mode of Web Form designer. 962 20.12 HTML mode of Web Form designer. 963 20.13 Code-behind file for WebForm1.aspx generated by Visual Studio .NET. 964 20.14 GridLayout and FlowLayout illustration. 965 20.15 WebForm.aspx after adding two Labels and setting their properties. 966 20.16 Web controls commonly used in ASP.NET applications. 967 20.17 Web controls demonstration. 967 20.18 AdRotator class demonstrated on a Web form . 972 20.19 Code-behind file for page demonstrating the AdRotator class. 973 20.20 AdvertisementFile used in AdRotator example. 974 20.21 Validators used in a Web Form that generates possible letter combinations from a phone number. 977 20.22 Code-behind file for the word-generator page. 979 20.23 HTML and ECMAScript sent to the client browser. 984
  • 24. Illustrations XXXI 20.24 ASPX file that presents a list of programming languages. 989 20.25 Code-behind file that writes cookies to the client. 991 20.26 ASPX page that displays book information. 994 20.27 Cookies being read from a client in an ASP .NET application. 995 20.28 HttpCookie properties. 997 20.29 Options supplied on an ASPX page. 997 20.30 Sessions are created for each user in an ASP .NET Web application. 999 20.31 HttpSessionState properties. 1003 20.32 Session information displayed in a ListBox. 1003 20.33 Session data read by an ASP .NET Web application to provide recommendations for the user. 1004 20.34 Guest-book application GUI. 1007 20.35 ASPX file for the guest book application. 1007 20.36 Code-behind file for the guest book application. 1009 20.37 Log in Web Form. 1013 20.38 ASCX code for the header. 1015 20.39 Code-behind file for the log-in page of authors application. 1016 20.40 ASPX file that allows a user to select an author from a drop-down list. 1021 20.41 Database information input into a DataGrid . 1023 20.42 ASPX page with tracing turned off. 1028 20.43 Tracing enabled on a page. 1029 20.44 Tracing information for a project. 1029 21 ASP .NET and Web Services 21.1 ASMX file rendered in Internet Explorer. 1042 21.2 Service description for a Web service. 1043 21.3 Invoking a method of a Web service from a Web browser. 1044 21.4 Results of invoking a Web-service method from a Web browser. 1044 21.5 SOAP request for the HugeInteger Web service. 1045 21.6 HugeInteger Web service. 1046 21.7 Design view of a Web service. 1054 21.8 Adding a Web service reference to a project. 1055 21.9 Add Web Reference dialog. 1055 21.10 Web services located on localhost. 1056 21.11 Web reference selection and description. 1056 21.12 Solution Explorer after adding a Web reference to a project. 1057 21.13 Using the HugeInteger Web service. 1057 21.14 Blackjack Web service. 1063 21.15 Blackjack game that uses Blackjack Web service. 1067 21.16 Airline reservation Web service. 1076 21.17 Airline Web Service in design view. 1078 21.18 ASPX file that takes reservation information. 1078 21.19 Code-behind file for the reservation page. 1079 21.20 TemperatureServer Web service. 1082 21.21 Class that stores weather information about a city. 1085 21.22 Receiving temperature and weather data from a Web service. 1087
  • 25. XXXII Illustrations 21.23 Class that stores equation information. 1093 21.24 Web service that generates random equations . 1095 21.25 Returning an object from a Web-service method. 1097 21.26 Math tutor application. 1098 22 Networking: Streams-Based Sockets and Datagrams 22.1 Server portion of a client/server stream-socket connection. 1111 22.2 Client portion of a client/server stream-socket connection. 1114 22.3 Server-side portion of connectionless client/server computing. 1120 22.4 Client portion of connectionless client/server computing. 1122 22.5 Server side of client/server Tic-Tac-Toe program. 1126 22.6 Client side of client/server Tic-Tac-Toe program. 1132 22.7 Class Square. 1139 22.8 English letters of the alphabet and decimal digits as expressed in international Morse code. 1144 23 Data Structures and Collections 23.1 Sample self-referential Node class definition. 1147 23.2 Two self-referential class objects linked together. 1148 23.3 A graphical representation of a linked list. 1149 23.4 Definitions of classes ListNode, List and EmptyListException. 1151 23.5 Demonstrating the linked list. 1155 23.6 A graphical representation of the InsertAtFront operation. 1158 23.7 A graphical representation of the InsertAtBack operation. 1158 23.8 A graphical representation of the RemoveFromFront operation. 1159 23.9 A graphical representation of the RemoveFromBack operation. 1160 23.10 StackInheritance extends class List. 1161 23.11 Using class StackInheritance. 1162 23.12 StackComposition class encapsulates functionality of class List. 1164 23.13 QueueInheritance extends class List . 1166 23.14 Using inheritance to create a queue. 1167 23.15 A graphical representation of a binary tree. 1169 23.16 A binary search tree containing 12 values. 1169 23.17 Definitions of TreeNode and Tree for a binary search tree. 1170 23.18 Creating and traversing a binary tree. 1174 23.19 A binary search tree. 1176 23.20 Definitions of class TreeNode and Tree for manipulating IComparable objects. 1178 23.21 Demonstrating class Tree with IComparable objects. 1181 23.22 Program that demonstrates class Array . 1186 23.23 Some methods of class ArrayList. 1189 23.24 Demomstrating the ArrayList class. 1189 23.25 Using the Stack class . 1195 23.26 Using the Hashtable class. 1200
  • 26. Illustrations XXXIII 24 Accessibility 24.1 Acts designed to improve Internet and computer accessibility for people with disabilities. 1214 24.2 We Media’s home page. (Courtesy of WeMedia, Inc.) 1215 24.3 Enlarging icons using the Customize feature. 1219 24.4 Enlarged icons in the development window. 1219 24.5 Text Editor before modifying the font size. 1220 24.6 Enlarging text in the Options window. 1220 24.7 Text Editor after the font size is modified. 1221 24.8 Adding tabs to the Toolbox. 1222 24.9 Shortcut key creation. 1223 24.10 Removing tabs from Visual Studio environment. 1223 24.11 Console windows with tabs and without tabs. 1224 24.12 Properties of class Control related to accessibility. 1225 24.13 Application with accessibility features. 1226 24.14 XHTML table without accessibility modifications. 1231 24.15 Table optimized for screen reading, using attribute headers. 1232 24.16 Home page written in VoiceXML. 1236 24.17 Publication page of Deitel and Associates’ VoiceXML page. 1238 24.18 VoiceXML tags. 1242 24.19 Hello World CallXML example. (Courtesy of Voxeo, © Voxeo Corporation 2000–2001.) 1243 24.20 CallXML example that reads three ISBN values. (Courtesy of Voxeo, © Voxeo Corporation 2000–2001.) 1245 24.21 CallXML elements. 1248 24.22 Display Settings dialog. 1251 24.23 Accessibility Wizard initialization options. 1252 24.24 Scroll Bar and Window Border Size dialog. 1252 24.25 Adjusting window-element sizes. 1253 24.26 Display Color Settings options. 1253 24.27 Accessibility Wizard mouse cursor adjustment tool. 1254 24.28 SoundSentry dialog. 1254 24.29 ShowSounds dialog. 1255 24.30 StickyKeys window. 1255 24.31 BounceKeys dialog. 1256 24.32 ToggleKeys window. 1256 24.33 Extra Keyboard Help dialog. 1257 24.34 MouseKeys window. 1257 24.35 Mouse Button Settings window. 1258 24.36 Mouse Speed dialog. 1259 24.37 Set Automatic Timeouts dialog. 1259 24.38 Saving new accessibility settings. 1260 24.39 Narrator window. 1260 24.40 Voice-settings window. 1261 24.41 Narrator reading Notepad text. 1261 24.42 Microsoft On-Screen Keyboard. 1262
  • 27. XXXIV Illustrations 24.43 Microsoft Internet Explorer 5.5’s accessibility options. 1262 24.44 Advanced accessibility settings in Microsoft Internet Explorer 5.5. 1263 A Operator Precedence Chart A.1 Operator precedence chart. 1273 B Number Systems (on CD) B.1 Digits of the binary, octal, decimal and hexadecimal number systems. 1277 B.2 Comparison of the binary, octal, decimal and hexadecimal number systems. 1278 B.3 Positional values in the decimal number system. 1278 B.4 Positional values in the binary number system. 1278 B.5 Positional values in the octal number system. 1279 B.6 Positional values in the hexadecimal number system. 1279 B.7 Decimal, binary, octal, and hexadecimal equivalents . 1279 B.8 Converting a binary number to decimal. 1281 B.9 Converting an octal number to decimal. 1281 B.10 Converting a hexadecimal number to decimal. 1282 C Career Opportunities (on CD) C.1 Monster.com home page. (Courtesy of Monster.com.] 1292 C.2 FlipDog.com job search. (Courtesy of Flipdog.com.) 1293 C.3 List of a job seeker’s criteria. 1295 C.4 Advantage Hiring, Inc.’s Net-Interview™ service. (Courtesy of Advantage Hiring, Inc.) 1298 C.5 eLance.com request for proposal (RFP) example. (Courtesy of eLance, Inc.] 1301 D Visual Studio .NET Debugger D.1 Syntax error. 1312 D.2 Debug sample program. 1313 D.3 Setting a breakpoint. 1314 D.4 Debug configuration setting. 1315 D.5 Console application suspended for debugging. 1315 D.6 Execution suspended at a breakpoint. 1316 D.7 Watch window. 1316 D.8 Autos, Locals and This windows. 1317 D.9 Immediate window. 1319 D.10 Debug toolbar icons. 1319 D.11 Breakpoints window. 1319 D.12 Disabled breakpoint. 1320 D.13 New Breakpoint dialog. 1321 D.14 Breakpoint Hit Count dialog. 1321 D.15 Breakpoint Condition dialog. 1321 D.16 Debugging methods. 1322 D.17 Call Stack window. 1323
  • 28. Illustrations XXXV D.18 IDE displaying a method’s calling point. 1323 D.19 Debug program control features. 1324 D.20 Using the Immediate window to debug methods. 1324 D.21 Object debugging example. 1325 D.22 Breakpoint location for class debugging. 1326 D.23 Expanded class in Watch window. 1327 D.24 Expanded array in Watch window. 1327 E Generating Documentation in Visual Studio (on CD) E.1 Point marked up with XML comments. 1331 E.2 Circle class marked up with XML comments. 1333 E.3 CircleTest class marked up with XML comments. 1336 E.4 Selecting the Build Comment Web Pages from Tools menu. 1339 E.5 Saving a document to a file. 1340 E.6 XHTML documentation of class Circle. 1340 E.7 XHTML documentation of method Area method of class Circle. 1341 E.8 XML documentation generated by Visual Studio .NET. 1341 F ASCII Character Set F.1 ASCII character set. 1348 G Unicode® (on CD) 1349 G.1 Correlation between the three encoding forms. 1352 G.2 Various glyphs of the character A. 1352 G.3 Unicode values for multiple languages. 1354 G.4 Some character ranges. 1357 H COM Integration (on CD) H.1 ActiveX control registration. 1363 H.2 Customize Toolbox dialog with an ActiveX control selected. 1364 H.3 IDE’s toolbox and LabelScrollbar properties. 1365 H.4 ActiveX COM control integration in C#. 1365 H.5 Add Reference dialog DLL Selection. 1368 H.6 COM DLL component in C#. 1369 I Introduction to HyperText Markup Language 4: Part 1 (on CD) I.1 Basic HTML file. 1377 I.2 Header elements h1 through h6. 1379 I.3 Linking to other Web pages. 1380 I.4 Linking to an email address. 1381 I.5 Placing images in HTML files. 1382 I.6 Using images as link anchors. 1384 I.7 Inserting special characters into HTML. 1386 I.8 Unordered lists in HTML. 1388
  • 29. XXXVI Illustrations I.9 Nested and ordered lists in HTML. 1389 J Introduction to HyperText Markup Language 4: Part 2 (on CD) J.1 HTML table. 1398 J.2 Complex HTML table. 1401 J.3 Simple form with hidden fields and a text box. 1403 J.4 Form including textareas, password boxes and checkboxes. 1406 J.5 Form including radio buttons and pulldown lists. 1409 J.6 Using internal hyperlinks to make your pages more navigable. 1413 J.7 Picture with links anchored to an image map. 1416 J.8 Using meta to provide keywords and a description. 1418 J.9 Web site using two frames—navigation and content. 1420 J.10 Framed Web site with a nested frameset. 1423 K Introduction to XHTML: Part 1 (on CD) K.1 First XHTML example. 1432 K.2 Validating an XHTML document. (Courtesy of World Wide Web Consortium (W3C).) 1434 K.3 XHTML validation results. (Courtesy of World Wide Web Consortium (W3C).) 1436 K.4 Header elements h1 through h6. 1437 K.5 Linking to other Web pages. 1438 K.6 Linking to an e-mail address. 1440 K.7 Placing images in XHTML files. 1441 K.8 Using images as link anchors. 1443 K.9 Inserting special characters into XHTML. 1445 K.10 Nested and ordered lists in XHTML. 1448 L Introduction to XHTML: Part 2 (on CD) L.1 XHTML table. 1457 L.2 Complex XHTML table. 1460 L.3 Simple form with hidden fields and a textbox. 1463 L.4 Form with textareas, password boxes and checkboxes. 1466 L.5 Form including radio buttons and drop-down lists. 1469 L.6 Using internal hyperlinks to make pages more easily navigable. 1473 L.7 Image with links anchored to an image map. 1476 L.8 Using meta to provide keywords and a description. 1478 L.9 Web document containing two frames—navigation and content. 1480 L.10 XHTML document displayed in the left frame of Fig. L.5. 1482 L.11 Framed Web site with a nested frameset. 1484 L.12 XHTML table for Exercise L.7. 1489 L.13 XHTML table for Exercise L.8. 1490 M HTML/XHTML Special Characters M.1 XHTML special characters. 1491
  • 30. Illustrations XXXVII N HTML/XHTML Colors N.1 HTML/XHTML standard colors and hexadecimal RGB values. 1492 N.2 XHTML extended colors and hexadecimal RGB values . 1493 O Bit Manipulation (on CD) O.1 Bitwise operators. 1497 O.2 Results of combining two bits with the bitwise AND operator (&). 1497 O.3 Results of combining two bits with the bitwise inclusive OR operator (|). 1497 O.4 Results of combining two bits with the bitwise exclusive OR operator (^). 1498 O.5 Displaying the bit representation of an integer. 1498 O.6 Demonstrating the bitwise AND, bitwise inclusive OR, bitwise exclusive OR and bitwise complement operators. 1501 O.7 Using the bitshift operators. 1505 O.8 Bitwise assignment operators. 1507 O.9 Sieve of Eratosthenes. 1508 P Crystal Reports® for Visual Studio .NET P.1 Report expert choices. (Courtesy Crystal Decisions) 1514 P.2 Expert formatting menu choices. (Courtesy of Crystal Decisions) 1515 P.3 Crystal Reports designer interface. (Courtesy of Crystal Decisions) 1516
  • 31. Preface Live in fragments no longer. Only connect. Edward Morgan Forster We wove a web in childhood, A web of sunny air. Charlotte Brontë Welcome to C# and the world of Windows, Internet and World-Wide-Web programming with Visual Studio and the .NET platform! This book is the second in our new .NET How to Program series, which presents various leading-edge computing technologies in the con- text of the .NET platform. C# is the next phase in the evolution of C and C++ and was developed expressly for Microsoft’s .NET platform. C# provides the features that are most important to program- mers, such as object-oriented programming, strings, graphics, graphical-user-interface (GUI) components, exception handling, multithreading, multimedia (audio, images, ani- mation and video), file processing, prepackaged data structures, database processing, Internet and World-Wide-Web-based client/server networking and distributed computing. The language is appropriate for implementing Internet- and World-Wide-Web-based appli- cations that seamlessly integrate with PC-based applications. The .NET platform offers powerful capabilities for software development and deploy- ment, including independence from a specific language or platform. Rather than requiring developers to learn a new programming language, programmers can contribute to the same software project, but write code using any (or several) of the .NET languages (such as C#, Visual Basic .NET, Visual C++ .NET and others) with which they are most competent. In addition to providing language independence, .NET extends program portability by enabling .NET applications to reside on, and communicate across, multiple platforms— thus facilitating the delivery of Web services over the Internet. The .NET platform enables Web-based applications to be distributed to consumer-electronic devices, such as cell
  • 32. Preface XXXIX phones and personal digital assistants, as well as to desktop computers. The capabilities that Microsoft has incorporated into the .NET platform create a new software-development par- adigm that will increase programmer productivity and decrease development time. New Features in C# How to Program This edition contains many new features and enhancements, including: • Full-Color Presentation. This book is now in full color. Full color enables readers to see sample outputs as they would appear on a color monitor. Also, we now syn- tax color the C# code, similar to the way Visual Studio .NET colors the code in its editor window. Our syntax-coloring conventions are as follows: comments appear in green keywords appear in dark blue literal values appear in light blue text, class, method and variable names appear in black errors and ASP .NET directives appear in red • “Code Washing.” This is our term for the process we use to format the programs in the book so that they have a carefully commented, open layout. The code ap- pears in full color and is grouped into small, well-documented pieces. This greatly improves code readability—an especially important goal for us, considering that this book contains approximately 23,500 lines of code. • Web Services and ASP .NET. Microsoft’s .NET strategy embraces the Internet and Web as integral to the software development and deployment processes. Web services—a key technology in this strategy—enables information sharing, com- merce and other interactions using standard Internet protocols and technologies, such as Hypertext Transfer Protocol (HTTP), Simple Object Access Protocol (SOAP) and Extensible Markup Language (XML). Web services enable program- mers to package application functionality in a form that turns the Web into a li- brary of reusable software components. In Chapter 21, ASP .NET and Web Services, we present a Web service that allows users to make airline seat reserva- tions. In this example, a user accesses a Web page, chooses a seating option and submits the page to the Web server. The page then calls a Web service that checks seat availability. We also present information related to Web services in Appendix P, Crystal Reports® for Visual Studio® .NET, which discusses popular reporting software for database-intensive applications. Crystal Reports, which is integrated into Visual Studio .NET, provides the ability to expose a report as a Web service. The appendix provides introductory information and directs readers to a walk- through of this process on the Crystal Decisions Web site (www.crystalde- cisions.com/net). • Web Forms, Web Controls and ASP .NET. Application developers must be able to create robust, scalable Web-based applications. The .NET platform architecture supports such applications. Microsoft’s .NET server-side technology, Active Server Pages (ASP) .NET, allows programmers to build Web documents that re- spond to client requests. To enable interactive Web pages, server-side programs process information users input into HTML forms. ASP .NET is a significant de-
  • 33. XL Preface parture from previous versions of ASP, allowing developers to program Web- based applications using the powerful object-oriented languages of .NET. ASP .NET also provides enhanced visual programming capabilities, similar to those used in building Windows forms for desktop programs. Programmers can create Web pages visually, by dragging and dropping Web controls onto Web forms. Chapter 20, ASP .NET, Web Forms and Web Controls, introduces these powerful technologies. • Object-Oriented Programming. Object-oriented programming is the most widely employed technique for developing robust, reusable software, and C# offers en- hanced object-oriented programming features. This text offers a rich presentation of object-oriented programming. Chapter 8, Object-Based Programming, intro- duces how to create classes and objects. These concepts are extended in Chapter 9, Object-Oriented Programming: Inheritance, which discusses how programmers can create new classes that “absorb” the capabilities of existing classes. Chapter 10, Object-Oriented Programming: Polymorphism, familiarizes the reader with the crucial concepts of polymorphism, abstract classes, concrete classes and inter- faces, which facilitate powerful manipulations among objects belonging to an in- heritance hierarchy. • XML. Use of Extensible Markup Language (XML) is exploding in the software- development industry, the e-business and e-commerce communities, and is perva- sive throughout the .NET platform. Because XML is a platform-independent tech- nology for describing data and for creating markup languages, XML’s data portability integrates well with C#’s portable applications and services. Chapter 18, Extensible Markup Language (XML), introduces XML. In this chapter, we in- troduce basic XML markup and discuss the technologies such as DTDs and Sche- ma, which are used to validate XML documents’ contents. We also explain how to programmatically manipulate XML documents using the Document Object Model (DOM™) and how to transform XML documents into other types of doc- uments via Extensible Stylesheet Language Transformations (XSLT). • Multithreading. Computers enable us to perform many tasks in parallel (or con- currently), such as printing documents, downloading files from a network and surfing the Web. Multithreading is the technology through which programmers can develop applications that perform concurrent tasks. Historically, a computer has contained a single, expensive processor, which its operating system would share among all applications. Today, processors are becoming so inexpensive that it is possible to build affordable computers that contain many processors that work in parallel—such computers are called multiprocessors. Multithreading is effec- tive on both single-processor and multiprocessor systems. C#’s multithreading ca- pabilities make the platform and its related technologies better prepared to deal with today’s sophisticated multimedia-intensive, database-intensive, network- based, multiprocessor-based distributed applications. Chapter 14, Multithreading, provides a detailed discussion of multithreading. • ADO .NET. Databases store vast amounts of information that individuals and or- ganizations must access to conduct business. As an evolution of Microsoft's Ac- tiveX Data Objects (ADO), ADO .NET represents a new approach for building
  • 34. Preface XLI applications that interact with databases. ADO .NET uses XML and an enhanced object model to provide developers with the tools they need to access and manip- ulate databases for large-scale, extensible, mission-critical multi-tier applications. Chapter 19, Database, SQL and ADO .NET, details the capabilities of ADO .NET and the Structured Query Language (SQL) to manipulate databases. • Visual Studio .NET Debugger. Debuggers are programs that help programmers find and correct logic errors in program code. Visual Studio .NET contains a pow- erful debugging tool that allows programmers to analyze their programs line-by- line as those programs execute. In Appendix D, Visual Studio .NET Debugger, we explain how to use key debugger features, such as setting breakpoints and “watch- es,” stepping into and out of procedures, and examining the procedure call stack. • COM (Component Object Model) Integration. Prior to the introduction of .NET, many organizations spent tremendous amounts of time and money creating reus- able software components called COM components, which include ActiveX® controls and ActiveX DLLs (dynamic link libraries) for Windows applications. In Appendix H, COM Integration, we discuss some of the tools available in Visual Studio .NET for integrating these legacy components into .NET applications. This integration allows programmers to use existing sets of COM-based controls with .NET components. • XML Documentation. Documenting program code is crucial for software devel- opment, because different programmers often work on an application during the software’s lifecycle, which usually includes multiple versions and can span many years. If programmers document software code and methods, other programmers working on the application can learn and understand the logic underlying the code, thus saving time and avoiding misunderstandings. To automate documenting pro- grams, Visual Studio .NET provides an XML tool for C# programmers. Appendix E, XML Documentation, explains how a programmer can insert comments in the code, which produces a separate file providing the code documentation. • Career Opportunities. Appendix C, Career Opportunities, introduces career ser- vices available on the Internet. We explore online career services from both the employer’s and employee’s perspectives. We list many Web sites at which you can submit applications, search for jobs and review applicants (if you are interest- ed in hiring someone). We also review services that build recruiting pages directly into e-businesses. One of our reviewers told us that he had used the Internet as a primary tool in a recent job search, and that this appendix would have helped him expand his search dramatically. • Unicode. As computer systems evolved worldwide, computer vendors developed numeric representations of character sets and special symbols for the local lan- guages spoken in different countries. In some cases, different representations were developed for the same languages. Such disparate character sets hindered commu- nication among computer systems. C# supports the Unicode Standard (main- tained by a non-profit organization called the Unicode Consortium), which maintains a single character set that specifies unique numeric values for characters and special symbols in most of the world’s languages. Appendix G, Unicode, dis- cusses the standard, overviews the Unicode Consortium Web site (www.uni-
  • 35. XLII Preface code.org) and presents a C# application that displays “Welcome to Unicode!” in several languages. • XHTML. The World Wide Web Consortium (W3C) has declared HTML to be a legacy technology that will undergo no further development. HTML is being re- placed by the Extensible Hypertext Markup Language (XHTML)—an XML- based technology that is rapidly becoming the standard for describing Web con- tent. We use XHTML in Chapter 18, Extensible Markup Language (XML), and offer an introduction to the technology in Appendix K, Introduction to XHTML: Part 1, and Appendix L, Introduction to XHTML: Part 2. These appendices over- view headers, images, lists, image maps and other features of this emerging mark- up language. (We also present a treatment of HTML in Appendices I and J, because ASP .NET, used in Chapters 20 and 21, generates HTML content). • Accessibility. Although the World Wide Web has become an important part of many people’s lives, the medium currently presents many challenges to people with disabilities. Individuals with hearing and visual impairments, in particular, have difficulty accessing multimedia-rich Web sites. In an attempt to improve this situation, the World Wide Web Consortium (W3C) launched the Web Accessibil- ity Initiative (WAI), which provides guidelines for making Web sites accessible to people with disabilities. Chapter 24, Accessibility, describes these guidelines and highlights various products and services designed to improve the Web-brows- ing experiences of individuals with disabilities. For example, the chapter introduc- es VoiceXML and CallXML—two XML-based technologies for increasing the accessibility of Web-based content for people with visual impairments. • Bit Manipulation. Computers work with data in the form of binary digits, or bits, which can assume the values 1 or 0. Computer circuitry performs various simple bit manipulations, such as examining the value of a bit, setting the value of a bit and reversing a bit (from 1 to 0 or from 0 to 1). Operating systems, test-equipment, networking software and many other kinds of software require that programs com- municate “directly with the hardware” by using bit manipulation. Appendix O, Bit Manipulation, overviews the bit manipulation capabilities that the .NET Frame- work provides. Some Notes to Instructors Students Enjoy Learning a Leading-Edge Language Dr. Harvey M. Deitel taught introductory programming courses in universities for 20 years with an emphasis on developing clearly written, well-designed programs. Much of what is taught in such courses represents the basic principles of programming, concentrating on the effective use of data types, control structures, arrays and functions. Our experience has been that students handle the material in this book in about the same way that they handle other introductory and intermediate programming courses. There is one noticeable differ- ence, though: Students are highly motivated by the fact that they are learning a leading- edge language, C#, and a leading-edge programming paradigm (object-oriented program- ming) that will be immediately useful to them as they enter the business world. This in- creases their enthusiasm for the material—which is essential when you consider that there is much more to learn in a C# course now that students must master both the base language
  • 36. Preface XLIII and substantial class libraries as well. Although C# is a new language that may require pro- grammers to revamp their skills, programmers will be motivated to do so because of the powerful range of capabilities that Microsoft is offering in its .NET initiative. A World of Object Orientation In the late 1990s, universities were still emphasizing procedural programming. The lead- ing-edge courses were using object-oriented C++, but these courses generally mixed a sub- stantial amount of procedural programming with object-oriented programming— something that C++ lets programmers do. Many instructors now are emphasizing a pure ob- ject-oriented programming approach. This book—the first edition of C# How to Program and the second text in our .NET series—takes a predominantly object-oriented approach because of the object orientation provided in C#. Focus of the Book Our goal was clear: Produce a C# textbook for introductory university-level courses in computer programming aimed at students with little or no programming experience, yet of- fer the depth and the rigorous treatment of theory and practice demanded by both profes- sionals and students in traditional, upper-level programming courses. To meet these objectives, we produced a comprehensive book that patiently teaches the principles of com- puter programming and of the C# language, including control structures, object-oriented programming, C# class libraries, graphical-user-interface concepts, event-driven program- ming and more. After mastering the material in this book, students will be well-prepared to program in C# and to employ the capabilities of the .NET platform. Multimedia-Intensive Communications People want to communicate. Sure, they have been communicating since the dawn of civili- zation, but the potential for information exchange has increased dramatically with the evolu- tion of various technologies. Until recently, even computer communications were limited mostly to digits, alphabetic characters and special characters. The current wave of communi- cation technology involves the distribution of multimedia—people enjoy using applications that transmit color pictures, animations, voices, audio clips and even full-motion color video over the Internet. At some point, we will insist on three-dimensional, moving-image transmis- sion. There have been predictions that the Internet will eventually replace radio and televi- sion as we know them today. Similarly, it is not hard to imagine newspapers, magazines and books delivered to “the palm of your hand” (or even to special eyeglasses) via wireless communications. Many newspapers and magazines already offer Web-based versions, and some of these services have spread to the wireless world. When cellular phones were first introduced, they were large and cumbersome. Today, they are small devices that fit in our pockets, and many are Internet-enabled. Given the current rate of advancement, wireless technology soon could offer enhanced streaming-video and graphics-packed services, such as video conference calls and high-power, multi-player video games. Teaching Approach C# How to Program contains a rich collection of examples, exercises and projects drawn from many fields and designed to provide students with a chance to solve interesting, real- world problems. The code examples in this text have been tested on Windows 2000 and
  • 37. XLIV Preface Windows XP. The book concentrates on the principles of good software engineering, and stresses program clarity. We are educators who teach edge-of-the-practice topics in indus- try classrooms worldwide. We avoid arcane terminology and syntax specifications in favor of teaching by example. The text emphasizes good pedagogy.1 LIVE-CODE™ Teaching Approach C# How to Program is loaded with numerous LIVE-CODE™ examples. This style exemplifies the way we teach and write about programming and is the focus of our multimedia Cyber Classrooms and Web-based training courses. Each new concept is presented in the context of a complete, working example that is immediately followed by one or more windows showing the program’s input/output dialog. We call this method of teaching and writing the LIVE- CODE™ Approach. We use programming languages to teach programming languages. Reading the examples in the text is much like entering and running them on a computer. World Wide Web Access All of the examples for C# How to Program (and our other publications) are available on the Internet as downloads from the following Web sites: www.deitel.com www.prenhall.com/deitel Registration is quick and easy and these downloads are free. We suggest downloading all the examples, then running each program as you read the corresponding text. Make changes to the examples and immediately see the effects of those changes—a great way to learn pro- gramming. Each set of instructions assumes that the user is running Windows 2000 or Win- dows XP and is using Microsoft’s Internet Information Services (IIS). Additional setup instructions for Web servers and other software can be found at our Web sites along with the examples. [Note: This is copyrighted material. Feel free to use it as you study, but you may not republish any portion of it in any form without explicit permission from Prentice Hall and the authors.] Visual Studio .NET, which includes C#, can be purchased and downloaded from Microsoft. Three different versions of Visual Studio .NET are available—Enterprise, Pro- fessional and Academic. Visit developerstore.com/devstore/ for more details and to order. If you are a member of the Microsoft Developer Network, visit msdn.microsoft.com/default.asp. Objectives Each chapter begins with objectives that inform students of what to expect and give them an opportunity, after reading the chapter, to determine whether they have met the intended goals. The objectives serve as confidence builders and as a source of positive reinforcement. Quotations The chapter objectives are followed by sets of quotations. Some are humorous, some are philosophical and some offer interesting insights. We have found that students enjoy relat- 1. We use fonts to distinguish between Visual Studio .NET’s Integrated Development Environment (IDE) features (such as menu names and menu items) and other elements that appear in the IDE. Our convention is to emphasize IDE features in a sans-serif bold Helvetica font (e.g., Project menu) and to emphasize program text in a serif bold Courier font (e.g., bool x = true;).
  • 38. Preface XLV ing the quotations to the chapter material. Many of the quotations are worth a “second look” after you read each chapter. Outline The chapter outline enables students to approach the material in top-down fashion. Along with the chapter objectives, the outline helps students anticipate future topics and set a com- fortable and effective learning pace. Approximately 23,500 Lines of Code in 204 Example Programs (with Program Outputs) We present C# features in the context of complete, working C# programs. The programs range in size from just a few lines of code to substantial examples containing several hundred lines of code. All examples are available on the CD that accompanies the book or as down- loads from our Web site, www.deitel.com. 607 Illustrations/Figures An abundance of charts, line drawings and program outputs is included. The discussion of control structures, for example, features carefully drawn flowcharts. [Note: We do not teach flowcharting as a program-development tool, but we do use a brief, flowchart-orient- ed presentation to explain the precise operation of each C# control structure.] 509 Programming Tips We have included programming tips to help students focus on important aspects of program development. We highlight hundreds of these tips in the form of Good Programming Prac- tices, Common Programming Errors, Testing and Debugging Tips, Performance Tips, Portability Tips, Software Engineering Observations and Look-and-Feel Observations. These tips and practices represent the best the authors have gleaned from a combined seven decades of programming and teaching experience. One of our students—a mathematics major—told us that she feels this approach is like the highlighting of axioms, theorems and corollaries in mathematics books; it provides a foundation on which to build good software. 91 Good Programming Practices Good Programming Practices are tips that call attention to techniques that will help students produce better programs. When we teach introductory courses to nonprogrammers, we state that the “buzzword” for each course is “clarity,” and we tell the students that we will high- light (in these Good Programming Practices) techniques for writing programs that are clear- er, more understandable and more maintainable. 0.0 165 Common Programming Errors Students learning a language—especially in their first programming course—tend to make certain kinds of errors frequently. Pointing out these Common Programming Errors reduces the likelihood that students will make the same mistakes. It also shortens long lines outside instructors’ offices during office hours! 0.0 44 Testing and Debugging Tips When we first designed this “tip type,” we thought the tips would contain suggestions strictly for exposing bugs and removing them from programs. In fact, many of the tips describe as- pects of C# that prevent “bugs” from getting into programs in the first place, thus simplifying the testing and debugging process. 0.0
  • 39. XLVI Preface 57 Performance Tips In our experience, teaching students to write clear and understandable programs is by far the most important goal for a first programming course. But students want to write programs that run the fastest, use the least memory, require the smallest number of keystrokes or dazzle in other ways. Students really care about performance and they want to know what they can do to “turbo charge” their programs. We have included 57 Performance Tips that highlight opportunities for improving program performance—making programs run faster or minimiz- ing the amount of memory that they occupy. 0.0 16 Portability Tips We include Portability Tips to help students write portable code and to provide insights on how C# achieves its high degree of portability. 0.0 115 Software Engineering Observations 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 engineer- ing. The Software Engineering Observations highlight architectural and design issues that affect the construction of software systems, especially large-scale systems. Much of what the student learns here will be useful in upper-level courses and in industry as the student begins to work with large, complex real-world systems. 0.0 21 Look-and-Feel Observations We provide Look-and-Feel Observations to highlight graphical-user-interface conventions. These observations help students design attractive, user-friendly graphical user interfaces that conform to industry norms. 0.0 Summary (1277 Summary bullets) Each chapter ends with additional pedagogical devices. We present a thorough, bullet-list- style summary of the chapter. On average, there are 39 summary bullets per chapter. This helps the students review and reinforce key concepts. Terminology (2932 Terms) We include an alphabetized list of the important terms defined in the chapter in a Terminol- ogy section. Again, this serves as further reinforcement. On average, there are 89 terms per chapter. Each term also appears in the index, so the student can locate terms and definitions quickly. 693 Self-Review Exercises and Answers (Count Includes Separate Parts) Extensive self-review exercises and answers are included for self-study. These questions and answers give the student a chance to build confidence with the material and prepare for the regular exercises. Students should be encouraged to attempt all the self-review exercis- es and check their answers. 367 Exercises (Solutions in Instructor’s Manual; Count Includes Separate Parts) Each chapter concludes with a substantial set of exercises that involve simple recall of im- portant 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 projects. These exercises cover a wide variety of topics, enabling instructors to tailor their courses to the unique needs of their audiences and to vary course assignments
  • 40. Preface XLVII each semester. Instructors can use the exercises to form homework assignments, short quiz- zes and major examinations. The solutions for the exercises are included in the Instructor’s Manual and on the disks available only to instructors through their Prentice-Hall represen- tatives. [NOTE: Please do not write to us requesting the instructor’s manual. Distri- bution of this publication is strictly limited to college professors teaching from the book. Instructors may obtain the solutions manual from their regular Prentice Hall representatives. We regret that we cannot provide the solutions to professionals.] So- lutions to approximately half the exercises are included on the C# Multimedia Cyber Class- room CD-ROM (available in April 2002 at www.InformIT.com/ cyberclassrooms; also see the last few pages of this book or visit www.dei- tel.com for ordering instructions). Also available in April 2002 is the boxed product, The Complete C# Training Course, which includes both our textbook, C# How to Program and the C# Multimedia Cyber Classroom. All of our Complete Training Course products are available at bookstores and online booksellers, including www.InformIT.com. Approximately 5,420 Index Entries (with approximately 6,450 Page References) We have included an extensive Index at the back of the book. Using this resource, students can search for any term or concept by keyword. The Index is especially useful to practicing programmers who use the book as a reference. Each of the 2932 terms in the Terminology sections appears in the Index (along with many more index items from each chapter). Stu- dents can use the index in conjunction with the Terminology sections to ensure that they have covered the key material in each chapter. “Double Indexing” of All C# LIVE-CODE™ Examples C# How to Program has 204 LIVE-CODE™ examples, which we have “double indexed.” For every C# source-code program in the book, we took the file name with the .cs exten- sion, such as ChessGame.cs, and indexed it both alphabetically (in this case, under “C”) and as a subindex item under “Examples.” This makes it easier to find examples using par- ticular features. C# Multimedia Cyber Classroom and The Complete C# Training Course, We have prepared an interactive, CD-ROM-based, software version of C# How to Pro- gram, called the C# Multimedia Cyber Classroom. This resource is loaded with e-Learning features that are ideal for both learning and reference. The Cyber Classroom is packaged with the textbook at a discount in The Complete C# Training Course. If you already have the book and would like to purchase the C# Multimedia Cyber Classroom separately, please visit www.InformIT.com/cyberclassrooms. The ISBN number for the C# Mul- timedia Cyber Classroom is 0-13-064587-7. All Deitel™ Cyber Classrooms are available in CD-ROM and Web-based training formats. The CD provides an introduction in which the authors overview the Cyber Class- room’s features. The textbook’s 204 LIVE-CODE™ example C# programs truly “come alive” in the Cyber Classroom. If you are viewing a program and want to execute it, you simply click the lightning-bolt icon, and the program will run. You immediately will see— and hear, when working with audio-based multimedia programs—the program’s outputs. If you want to modify a program and see the effects of your changes, simply click the
  • 41. XLVIII Preface floppy-disk icon that causes the source code to be “lifted off” the CD and “dropped into” one of your own directories so you can edit the text, recompile the program and try out your new version. Click the audio icon, and one of the authors will discuss the program and “walk you through” the code. The Cyber Classroom also provides navigational aids, including extensive hyper- linking. The Cyber Classroom is browser based, so it remembers sections that you have vis- ited recently and allows you to move forward or backward among these sections. The thousands of index entries are hyperlinked to their text occurrences. Furthermore, when you key in a term using the “find” feature, the Cyber Classroom will locate occurrences of that term throughout the text. The Table of Contents entries are “hot,” so clicking a chapter name takes you immediately to that chapter. Students like the fact that solutions to approximately half the exercises in the book are included with the Cyber Classroom. Studying and running these extra programs is a great way for students to enhance their learning experience. Students and professional users of our Cyber Classrooms tell us that they like the inter- activity and that the Cyber Classroom is an effective reference due to its extensive hyper- linking and other navigational features. We received an e-mail from a person who said that he lives “in the boonies” and cannot take a live course at a university, so the Cyber Class- room provided an ideal solution to his educational needs. Professors tell us that their students enjoy using the Cyber Classroom and spend more time on the courses and master more of the material than in textbook-only courses. For a complete list of the available and forthcoming Cyber Classrooms and Complete Training Courses, see the Deitel™ Series page at the beginning of this book, the product listing and ordering information at the end of this book or visit www.deitel.com, www.pren- hall.com/deitel and www.InformIT.com/deitel. Deitel e-Learning Initiatives e-Books and Support for Wireless Devices Wireless devices will play an enormous role in the future of the Internet. Given recent band- width enhancements and the emergence of 2.5 and 3G technologies, it is projected that, within two years, more people will access the Internet through wireless devices than through desktop computers. Deitel & Associates, Inc., is committed to wireless accessibil- ity and has recently published Wireless Internet & Mobile Business How to Program. To fulfill the needs of a wide range of customers, we currently are developing our content both in traditional print formats and in newly developed electronic formats, such as e-books so that students and professors can access content virtually anytime, anywhere. Visit www.deitel.com for periodic updates on this initiative. e-Matter Deitel & Associates, Inc., is partnering with Prentice Hall’s parent company, Pearson PLC, and its information technology Web site, InformIT.com, to launch the Deitel e-Matter series at www.InformIT.com/deitel. This series will provide professors, students and professionals with an additional source of information on specific programming topics. e-Matter consists of stand-alone sections taken from published texts, forthcoming texts or pieces written during the Deitel research-and-development process. Developing e-Matter based on pre-publication books allows us to offer significant amounts of the material to ear-
  • 42. Preface XLIX ly adopters for use in courses. Some possible C# e-Matter titles we are considering include Object-Based Programming and Object-Oriented Programming in C#; Graphical User In- terface Programming in C#; Multithreading in C#; ASP .NET and Web Forms: A C# View; and ASP .NET and Web Services: A C# View. Course Management Systems: WebCT, Blackboard, and CourseCompass We are working with Prentice Hall to integrate our How to Program Series courseware into three Course Management Systems: WebCT, Blackboard™ and CourseCompass. These Course Management Systems enable instructors to create, manage and use sophisticated Web-based educational programs. Course Management System features include course cus- tomization (such as posting contact information, policies, syllabi, announcements, assign- ments, grades, performance evaluations and progress tracking), class and student management tools, a gradebook, reporting tools, communication tools (such as chat rooms), a whiteboard, document sharing, bulletin boards and more. Instructors can use these products to communicate with their students, create online quizzes and tests from questions directly linked to the text and automatically grade and track test results. For more information about these upcoming products, visit www.deitel.com/whatsnew.html. For demonstra- tions of existing WebCT, Blackboard and CourseCompass courses, visit cms.pren_hall.com/WebCT, cms.prenhall.com/Blackboard and cms.prenhall.com/CourseCompass, respectively. Deitel and InformIT Newsletters Deitel Column in the InformIT Newsletters Deitel & Associates, Inc., contributes a weekly column to the popular InformIT newsletter, currently subscribed to by more than 800,000 IT professionals worldwide. For opt-in reg- istration, visit www.InformIT.com. Deitel Newsletter Our own free, opt-in newsletter includes commentary on industry trends and developments, links to articles and resources from our published books and upcoming publications, infor- mation on future publications, product-release schedules and more. For opt-in registration, visit www.deitel.com. The Deitel .NET Series Deitel & Associates, Inc., is making a major commitment to .NET programming through the launch of our .NET Series. C# .NET How to Program and Visual Basic .NET How to Program, Second Edition are the first books in this new series. We intend to follow these books with Advanced C# How to Program and Advanced Visual Basic .NET How to Pro- gram, which will be published in December 2002. We also plan to publish Visual C++ .NET How to Program in July 2002, followed by Advanced Visual C++ .NET How to Pro- gram in July 2003. Advanced C# How to Program C# How to Program covers introductory through intermediate-level C# programming top- ics, as well as core programming fundamentals. By contrast, our upcoming textbook Ad-
  • 43. L Preface vanced C# How to Program will be geared toward experienced C# developers. This new book will cover enterprise-level programming topics, including: Creating multi-tier, data- base intensive ASP .NET applications using ADO .NET and XML; constructing custom Windows controls; developing custom Web controls; and building Windows services. The book also will include more in-depth explanations of object-oriented programming (with the UML), ADO .NET, XML Web services, wireless programming and security. Advanced C# How to Program will be published in December 2002. Acknowledgments One of the great pleasures of writing a textbook is acknowledging the efforts of many peo- ple whose names may not appear on the cover, but whose hard work, cooperation, friend- ship and understanding were crucial to the production of the book. Many other people at Deitel & Associates, Inc., devoted long hours to this project. • Sean E. Santry, a graduate of Boston College with degrees in Computer Science and Philosophy, Director of Software Development at Deitel & Associates, Inc., and co-author of Advanced Java 2 Platform How to Program, contributed to Chapters 1–10, 12–13 and 18–23. • Matthew R. Kowalewski, a graduate of Bentley College with a degree in Account- ing Informations Systems, is the Director of Wireless Development at Deitel & Associates, Inc. He contributed to Chapters 19–20, Appendices B, F, I–N, P and edited the Index. • Jonathan Gadzik, a graduate of the Columbia University School of Engineering and Applied Science with a major in Computer Science, co-authored Chapter 17 and contributed to Chapters 9, 22 and Appendices D and E. • Kyle Lomelí, a graduate of Oberlin College with a degree in Computer Science and a minor in East Asian Studies, contributed to Chapters 11, 14–15, 19 and 24. • Lauren Trees, a graduate if Brown University in English, edited the entire manu- script for smoothness, clarity and effectiveness of presentation; she also co-au- thored the Preface, Chapter 1 and Appendix P. • Rashmi Jayaprakash, a graduate of Boston University with a major in Computer Science, co-authored Chapter 24 and Appendix G. • Laura Treibick, a graduate of the University of Colorado at Boulder with a degree in Photography and Multimedia, is Director of Multimedia at Deitel & Associates, Inc. She contributed to Chapter 16 and enhanced many of the graphics throughout the text. • Betsy DuWaldt, a graduate of Metropolitan State College of Denver with a major in Technical Communications (Writing and Editing emphasis) and a minor in Computer Information Systems, is Editorial Director at Deitel & Associates, Inc. She co-authored the Preface, Chapter 1 and Appendix P and managed the permis- sions process for the book. • Barbara Deitel applied the copy edits to the manuscript. She did this in parallel with handling her extensive financial and administrative responsibilities at Deitel
  • 44. Preface LI & Associates, Inc., which include serving as Chief Financial Officer. [Everyone at the company works on book content.] • Abbey Deitel, a graduate of Carnegie Mellon University’s Industrial Management Program and President of Deitel & Associates, Inc., recruited 40 additional full- time employees and interns during 2001. She also leased, equipped and furnished our second building to create the work environment from which C# How to Pro- gram and our other year 2001 publications were produced. She suggested the title for the How to Program series, and edited this preface and several of the book’s chapters. We would also like to thank the participants in the Deitel & Associates, Inc., College Internship Program.2 • Jeffrey Hamm, a sophomore at Northeastern University in Computer Science, co- authored Chapters 16, 18, 20–21 and Appendices D and H. • Kalid Azad, a sophomore at Princeton University in Computer Science, contrib- uted to Chapters 1, 2, 12–13, 16 and Appendix D. He created PowerPoint-slide an- cillaries for Chapters 1–7 and researched Visual Studio .NET and Microsoft's .NET initiative. • Christopher Cassa, a junior at MIT in Computer Science, contributed to Chapters 3–7 and 18. • David Tuttle, a senior at Harvard in Computer Science, contributed to Chapters 8, 18–19 and 24 and coded examples for Chapters 3–6, 7, 11,16–17,19, 23 and 26. • Ori Schwartz, a sophomore at Boston University in Computer Science, produced solutions for all the chapters and contributed to Chapter 16. • Thiago Lucas da Silva, a sophomore at Northeastern University in Computer Sci- ence, tested all the programming examples through the various beta releases and release candidates of Visual Studio .NET. • Matthew Rubino, a sophomore at Northeastern University in Computer Science, created ancillary materials for the entire book. • Elizabeth Rockett, a senior in English at Princeton University, edited 1-3, 7–8, 14, 17 and 19-24. • Barbara Strauss, a senior in English at Brandeis University, edited Chapters 1–6, 9–13 and 18–24. • Christina Carney, a senior in Psychology and Business at Framingham State Col- lege, helped with the Preface. 2. The Deitel & Associates, Inc. College Internship Program offers a limited number of salaried po- sitions to Boston-area college students majoring in Computer Science, Information Technology, Marketing, Management and English. Students work at our corporate headquarters in Sudbury, Massachusetts full-time in the summers and (for those attending college in the Boston area) part- time during the academic year. We also offer full-time internship positions for students interested in taking a semester off from school to gain industry experience. Regular full-time positions are available to college graduates. For more information about this competitive program, please con- tact Abbey Deitel at deitel@deitel.com and visit our Web site, www.deitel.com.