p. 1
contents contents illustrations preface 1 introduction to computers the internet the web and c 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 1.10 1.11 1.12 1.13 1.14 1.15 1.16 1.17 1.18 1.19 introduction what is a computer computer organization evolution of operating systems personal computing distributed computing and client/server computing machine languages assembly languages and high-level languages c c visual basic .net and javatm c other high-level languages structured programming key software trend object technology hardware trends history of the internet and world wide web world wide web consortium w3c extensible markup language xml introduction to microsoft .net .net framework and the common language runtime tour of the book internet and world wide web resources viii xix xxxviii 1 2 3 3 4 5 6 7 9 10 10 11 13 13 15 15 16 18 20 29
[close]
p. 2
contents ix 2 2.1 2.2 2.3 2.4 introduction to the visual studio .net ide introduction visual studio .net integrated development environment ide overview menu bar and toolbar visual studio .net windows 2.4.1 solution explorer 2.4.2 toolbox 2.4.3 properties window using help simple program displaying text and an image 33 34 34 37 39 39 40 42 42 44 2.5 2.6 3 3.1 3.2 3.3 3.4 3.5 3.6 introduction to c programming introduction simple program printing a line of text another simple program adding integers memory concepts arithmetic decision making equality and relational operators 59 60 60 71 75 76 80 4 4.1 4.2 4.3 4.4 4.5 4.6 4.7 4.8 4.9 4.10 4.11 4.12 4.13 control structures part 1 introduction algorithms pseudocode control structures if selection structure if/else selection structure while repetition structure formulating algorithms case study 1 counter-controlled repetition formulating algorithms with top-down stepwise refinement case study 2 sentinel-controlled repetition formulating algorithms with top-down stepwise refinement case study 3 nested control structures assignment operators increment and decrement operators introduction to windows application programming 94 95 95 96 96 99 100 105 106 109 116 120 121 124 5 5.1 5.2 5.3 5.4 5.5 5.6 5.7 5.8 5.9 control structures part 2 introduction essentials of counter-controlled repetition for repetition structure examples using the for structure switch multiple-selection structure do/while repetition structure statements break and continue logical and conditional operators structured-programming summary 139 140 140 142 146 152 156 158 160 166
[close]
p. 3
x contents 6 6.1 6.2 6.3 6.4 6.5 6.6 6.7 6.8 6.9 6.10 6.11 6.12 6.13 6.14 6.15 6.16 6.17 methods introduction program modules in c math class methods methods method definitions argument promotion c namespaces value types and reference types passing arguments pass-by-value vs pass-by-reference random-number generation example game of chance duration of variables scope rules recursion example using recursion the fibonacci series recursion vs iteration method overloading 178 179 179 181 181 183 193 195 196 197 200 207 212 212 215 219 222 223 7 7.1 7.2 7.3 7.4 arrays introduction arrays declaring and allocating arrays examples using arrays 7.4.1 allocating an array and initializing its elements 7.4.2 totaling the elements of an array 7.4.3 using histograms to display array data graphically 7.4.4 using the elements of an array as counters 7.4.5 using arrays to analyze survey results passing arrays to methods passing arrays by value and by reference sorting arrays searching arrays linear search and binary search 7.8.1 searching an array with linear search 7.8.2 searching a sorted array with binary search multiple-subscripted arrays foreach repetition structure 236 237 237 239 240 240 242 243 244 247 250 253 257 260 260 261 265 272 7.5 7.6 7.7 7.8 7.9 7.10 8 8.1 8.2 8.3 8.4 8.5 8.6 8.7 object-based programming introduction implementing a time abstract data type with a class class scope controlling access to members initializing class objects constructors using overloaded constructors properties 280 281 282 290 290 292 293 297
[close]
p. 4
contents xi 8.8 8.9 8.10 8.11 8.12 8.13 8.14 8.15 8.16 8.17 composition objects references as instance variables of other classes using the this reference garbage collection static class members const and readonly members indexers data abstraction and information hiding software reusability namespaces and assemblies class view and object browser 306 309 311 312 317 319 326 327 328 333 9 9.1 9.2 9.3 9.4 9.5 9.6 9.7 object-oriented programming inheritance introduction base classes and derived classes protected and internal members relationship between base classes and derived classes case study three-level inheritance hierarchy constructors and destructors in derived classes software engineering with inheritance 342 343 344 347 347 368 371 377 10 10.1 10.2 10.3 10.4 10.5 10.6 10.7 10.8 10.9 10.10 10.11 object-oriented programming polymorphism introduction derived-class-object to base-class-object conversion type fields and switch statements polymorphism examples abstract classes and methods case study inheriting interface and implementation sealed classes and methods case study payroll system using polymorphism case study creating and using interfaces delegates operator overloading 382 383 383 390 391 392 394 402 403 413 425 430 11 11.1 11.2 11.3 11.4 11.5 11.6 11.7 11.8 exception handling introduction exception handling overview example dividebyzeroexception .net exception hierarchy finally block exception properties programmer-defined exception classes handling overflows with operators checked and unchecked 438 439 440 443 448 449 457 462 466 12 12.1 12.2 graphical user interface concepts part 1 introduction windows forms 474 475 476
[close]
p. 5
xii contents event-handling model 12.3.1 basic event handling 12.4 control properties and layout 12.5 labels textboxes and buttons 12.6 groupboxes and panels 12.7 checkboxes and radiobuttons 12.8 pictureboxes 12.9 mouse event handling 12.10 keyboard event handling 12.3 479 480 484 488 495 498 507 509 511 13 graphical user interfaces concepts part 2 introduction menus linklabels listboxes and checkedlistboxes 13.4.1 listboxes 13.4.2 checkedlistboxes 13.5 comboboxes 13.6 treeviews 13.7 listviews 13.8 tab control 13.9 multiple-document-interface mdi windows 13.10 visual inheritance 13.11 user-defined controls 13.1 13.2 13.3 13.4 520 521 521 530 534 537 539 542 547 553 560 565 574 578 14 14.1 14.2 14.3 14.4 14.5 14.6 14.7 multithreading introduction thread states life cycle of a thread thread priorities and thread scheduling thread synchronization and class monitor producer/consumer relationship without thread synchronization producer/consumer relationship with thread synchronization producer/consumer relationship circular buffer 590 591 592 594 599 601 607 616 15 15.1 15.2 15.3 15.4 15.5 15.6 15.7 15.8 15.9 15.10 strings characters and regular expressions introduction fundamentals of characters and strings string constructors string indexer length property and copyto method comparing strings string method gethashcode locating characters and substrings in strings extracting substrings from strings concatenating strings miscellaneous string methods 632 633 633 635 636 638 642 643 646 647 648
[close]
p. 6
contents xiii 15.11 class stringbuilder 15.12 stringbuilder indexer length and capacity properties and ensurecapacity method 15.13 stringbuilder append and appendformat methods 15.14 stringbuilder insert remove and replace methods 15.15 char methods 15.16 card shuffling and dealing simulation 15.17 regular expressions and class regex 650 652 654 658 661 664 668 16 16.1 16.2 16.3 16.4 16.5 16.6 16.7 16.8 16.9 16.10 16.11 16.12 16.13 graphics and multimedia introduction graphics contexts and graphics objects color control font control drawing lines rectangles and ovals drawing arcs drawing polygons and polyli]nes advanced graphics capabilities introduction to multimedia loading displaying and scaling images animating a series of images windows media player microsoft agent 684 685 687 688 696 701 704 707 711 717 718 720 733 736 17 17.1 17.2 17.3 17.4 17.5 17.6 17.7 17.8 17.9 17.10 17.11 files and streams introduction data hierarchy files and streams classes file and directory creating a sequential-access file reading data from a sequential-access file random-access files creating a random-access file writing data randomly to a random-access file reading data sequentially from a random-access file case study a transaction-processing program 757 6 757 757 759 761 771 783 794 798 802 807 812 18 18.1 18.2 18.3 18.4 18.5 extensible markup language xml introduction xml documents xml namespaces document object model dom document type definitions dtds schemas and validation 18.5.1 document type definitions 18.5.2 microsoft xml schemas 18.5.3 w3c xml schema 838 839 839 844 847 865 866 869 872
[close]
p. 7
xiv contents 18.6 18.7 18.8 18.5.4 schema validation in c extensible stylesheet language and xsltransform microsoft biztalktm internet and world wide web resources 873 877 884 887 19 database sql and ado .net 19.1 19.2 19.3 19.4 introduction relational database model relational database overview books database structured query language sql 19.4.1 basic select query 19.4.2 where clause 19.4.3 order by clause 19.4.4 merging data from multiple tables inner join 19.4.5 joining data from tables authors authorisbn titles and publishers 19.4.6 insert statement 19.4.7 update statement 19.4.8 delete statement ado .net object model programming with ado .net extracting information from a dbms 19.6.1 connecting to and querying an access data source 19.6.2 querying the books database programming with ado.net modifying a dbms reading and writing xml files 895 896 897 898 905 905 906 909 912 914 917 918 919 920 921 921 928 930 938 19.5 19.6 19.7 19.8 20 20.1 20.2 20.3 20.4 20.5 asp .net web forms and web controls 948 949 950 952 953 966 967 971 976 987 988 997 1006 1013 1027 1030 introduction simple http transaction system architecture creating and running a simple web form example web controls 20.5.1 text and graphics controls 20.5.2 adrotator control 20.5.3 validation controls 20.6 session tracking 20.6.1 cookies 20.6.2 session tracking with httpsessionstate 20.7 case study online guest book 20.8 case study connecting to a database in asp .net 20.9 tracing 20.10 internet and world wide web resources 21 21.1 asp .net and web services introduction 1039 1040
[close]
p. 8
contents xv 21.2 21.3 21.4 21.5 21.6 21.7 21.8 web services simple object access protocol soap and web services publishing and consuming web services session tracking in web services using web forms and web services case study temperature information application user-defined types in web services 1041 1044 1046 1062 1075 1081 1091 22 22.1 22.2 22.3 22.4 22.5 22.6 networking streams-based sockets and datagrams 1106 introduction establishing a simple server using stream sockets establishing a simple client using stream sockets client/server interaction with stream-socket connections connectionless client/server interaction with datagrams client/server tic-tac-toe using a multithreaded server 1107 1108 1110 1111 1120 1125 23 23.1 23.2 23.3 23.4 23.5 23.6 data structures and collections introduction self-referential classes linked lists stacks queues trees 23.6.1 binary search tree of integer values 23.6.2 binary search tree of icomparable objects collection classes 23.7.1 class array 23.7.2 class arraylist 23.7.3 class stack 23.7.4 class hashtable 1145 1146 1146 1148 1160 1165 1168 1170 1177 1185 1185 1188 1194 1198 23.7 24 24.1 24.2 24.3 24.4 24.5 24.6 accessibility introduction regulations and resources web accessibility initiative providing alternatives for images maximizing readability by focusing on structure accessibility in visual studio .net 24.6.1 enlarging toolbar icons 24.6.2 enlarging the text 24.6.3 modifying the toolbox 24.6.4 modifying the keyboard 24.6.5 rearranging windows accessibility in c accessibility in xhtml tables accessibility in xhtml frames 1212 1213 1214 1216 1216 1218 1218 1219 1220 1221 1221 1222 1224 1230 1234 24.7 24.8 24.9
[close]
p. 9
xvi contents accessibility in xml using voice synthesis and recognition with voicexmltm callxmltm jaws® for windows other accessibility tools accessibility in microsoft® windows® 2000 24.15.1 tools for people with visual impairments 24.15.2 tools for people with hearing impairments 24.15.3 tools for users who have difficulty using the keyboard 24.15.4 microsoft narrator 24.15.5 microsoft on-screen keyboard 24.15.6 accessibility features in microsoft internet explorer 5.5 24.16 internet and world wide web resources 24.10 24.11 24.12 24.13 24.14 24.15 1235 1235 1243 1248 1249 1251 1252 1254 1255 1258 1261 1262 1264 a b b.1 b.2 b.3 b.4 b.5 b.6 operator precedence chart number systems on cd introduction abbreviating binary numbers as octal numbers and hexadecimal numbers converting octal numbers and hexadecimal numbers to binary numbers converting from binary octal or hexadecimal to decimal converting from decimal to binary octal or hexadecimal negative binary numbers two s complement notation 1273 1275 1276 1279 1281 1281 1282 1283 c c.1 c.2 c.3 c.4 c.5 c.6 career opportunities on cd introduction resources for the job seeker online opportunities for employers recruiting services career sites internet and world wide web resources 1289 1290 1291 1292 1297 1298 1303 d d.1 d.2 d.3 d.4 d.5 d.6 visual studio .net debugger introduction breakpoints examining data program control additional method debugging capabilities additional class debugging capabilities 1311 1312 1313 1315 1318 1322 1324 e e.1 e.2 e.3 generating documentation in visual studio on cd 1329 introduction documentation comments documenting c source code 1330 1330 1331
[close]
p. 10
contents xvii e.4 e.5 creating comment web pages creating xml documentation files 1339 1341 f g g.1 g.2 g.3 g.4 g.5 g.6 g.7 ascii character set unicode® on cd introduction unicode transformation formats characters and glyphs advantages and disadvantages of unicode unicode consortium s web site using unicode character ranges 1348 1349 1350 1351 1352 1353 1353 1355 1357 h h.1 h.2 h.3 h.4 com integration on cd introduction activex integration dll integration internet and world wide web resources 1362 1362 1364 1367 1371 i introduction to hypertext markup language 4 part 1 on cd i.1 i.2 i.3 i.4 i.5 i.6 i.7 i.8 i.9 i.10 i.11 introduction markup languages editing html common elements headers linking images special characters and more line breaks unordered lists nested and ordered lists internet and world wide web resources 1374 1375 1375 1376 1376 1379 1380 1382 1386 1388 1389 1392 j introduction to hypertext markup language 4 part 2 on cd j.1 j.2 j.3 j.4 j.5 j.6 j.7 j.8 j.9 introduction basic html tables intermediate html tables and formatting basic html forms more complex html forms internal linking creating and using image maps
[close]
p. 11
xviii contents j.10 j.11 nested framesets internet and world wide web resources 1422 1424 k k.1 k.2 k.3 k.4 k.5 k.6 k.7 k.8 k.9 k.10 k.11 introduction to xhtml part 1 on cd introduction editing xhtml first xhtml example w3c xhtml validation service headers linking images special characters and more line breaks unordered lists nested and ordered lists internet and world wide web resources 1430 1431 1431 1432 1435 1436 1438 1441 1445 1447 1448 1451 l l.1 l.2 l.3 l.4 l.5 l.6 l.7 l.8 l.9 l.10 l.11 introduction to xhtml part 2 on cd introduction basic xhtml tables intermediate xhtml tables and formatting basic xhtml forms more complex xhtml forms internal linking creating and using image maps meta elements frameset element nested framesets internet and world wide web resources 1456 1457 1457 1460 1462 1465 1473 1476 1478 1479 1483 1485 mnoo.1 o.2 o.3 html/xhtml special characters html/xhtml colors bit manipulation on cd introduction bit manipulation and the bitwise operators class bitarray 1491 1492 1495 1496 1496 1508 p p.1 p.2 p.3 crystal reports® for visual studio .net introduction crystal reports web site resources crystal reports and visual studio .net 1513 1513 1513 1514 bibliography index 1518 1522
[close]
p. 12
illustrations 1 1.1 introduction to computers the internet the web and c .net languages 19 2 2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 2.9 2.10 2.11 2.12 2.13 2.14 2.15 2.16 2.17 2.18 2.19 2.20 2.21 2.22 2.23 2.24 introduction to the visual studio .net ide start page in visual studio .net new project dialog visual studio .net environment after a new project has been created visual studio .net menu bar visual studio .net menu summary visual studio .net toolbar tool tip demonstration toolbar icons for various visual studio .net windows solution explorer window toolbox window demonstrating window auto-hide properties window dynamic help window simple program as it executes creating a new windows application setting the project location setting the form s text property form with sizing handles changing property backcolor adding a new label to the form label in position with its text property set properties window displaying the label s properties font window for selecting fonts styles and sizes centering the text in the label 35 36 37 38 38 38 39 39 40 41 41 43 44 45 45 46 46 47 47 48 48 49 49 50
[close]
p. 13
xx illustrations 2.25 2.26 2.27 2.28 2.29 inserting and aligning the picture box image property of the picture box selecting an image for the picture box picture box after the image has been inserted ide in run mode with the running application in the foreground 50 51 51 51 52 3 3.1 3.2 3.3 3.4 3.5 3.6 3.7 3.8 3.9 3.10 3.11 3.12 3.13 3.14 3.15 3.16 3.17 3.18 3.19 3.20 introduction to c programming our first program in c visual studio .net-generated console application execution of the welcome1 program printing on one line with separate statements printing on multiple lines with a single statement some common escape sequences displaying multiple lines in a dialog adding a reference to an assembly in visual studio .net internet explorer s gui dialog displayed by calling messagebox.show addition program that adds two values entered by the user memory location showing name and value of variable number1 memory locations after values for variables number1 and number2 have been input memory locations after a calculation arithmetic operators precedence of arithmetic operators order in which a second-degree polynomial is evaluated equality and relational operators using equality and relational operators precedence and associativity of operators discussed in this chapter 60 65 66 67 67 68 68 70 71 71 72 75 76 76 77 78 80 81 81 85 4 4.1 4.2 4.3 4.4 4.5 4.6 4.7 4.8 4.9 4.10 4.11 4.12 4.13 4.14 4.15 control structures part 1 flowcharting c s sequence structure c keywords flowcharting a single-selection if structure flowcharting a double-selection if/else structure flowcharting the while repetition structure pseudocode algorithm that uses counter-controlled repetition to solve the class-average problem class average program with counter-controlled repetition pseudocode algorithm that uses sentinel-controlled repetition to solve the class-average problem class-average program with sentinel-controlled repetition pseudocode for examination-results problem c program for examination-results problem arithmetic assignment operators the increment and decrement operators the difference between preincrementing and postincrementing precedence and associativity of the operators discussed so far in this book 97 98 100 101 106 107 107 111 112 118 118 120 121 122 123
[close]
p. 14
illustrations xxi 4.16 4.17 4.18 4.19 4.20 4.21 4.22 4.23 4.24 ide showing program code for fig 2.15 windows form designer generated code when expanded code generated by the ide for welcomelabel using the properties window to set a property value windows form designer generated code reflecting new property values changing a property in the code view editor new text property value reflected in design mode method frmasimpleprogram_load changing a property value at runtime 125 126 127 127 128 128 129 129 130 5 5.1 5.2 5.3 5.4 5.5 5.6 5.7 5.8 5.9 5.10 5.11 5.12 5.13 5.14 5.15 5.16 5.17 5.18 5.19 5.20 5.21 5.22 5.23 5.24 5.25 5.26 5.27 5.28 control structures part 2 counter-controlled repetition with while structure counter-controlled repetition with the for structure components of a typical for header flowcharting a typical for repetition structure summation using for icons for message dialogs buttons for message dialogs calculating compound interest with for string formatting codes switch multiple-selection structure flowcharting the switch multiple-selection structure do/while repetition structure flowcharting the do/while repetition structure break statement in a for structure continue statement in a for structure truth table for the conditional and operator truth table for the conditional or operator truth table for the logical exclusive or operator truth table for operator logical not conditional and logical operators precedence and associativity of the operators discussed so far c s single-entry/single-exit sequence selection and repetition structures rules for forming structured programs simplest flowchart repeatedly applying rule 2 of fig 5.23 to the simplest flowchart applying rule 3 of fig 5.23 to the simplest flowchart stacked nested and overlapped building blocks unstructured flowchart 141 142 143 146 147 148 148 149 151 152 155 156 157 158 159 161 162 163 163 164 166 167 168 168 169 169 170 170 6 6.1 6.2 6.3 6.4 6.5 6.6 methods hierarchical boss method/worker method relationship commonly used math class methods using programmer-defined method square programmer-defined maximum method allowed implicit conversions namespaces in the framework class library 180 182 183 188 194 195
[close]
p. 15
xxii illustrations 6.7 6.8 6.9 6.10 6.11 6.12 6.13 6.14 6.15 6.16 6.17 6.18 6.19 6.20 c built-in data types demonstrating ref and out parameters random integers in the range 16 rolling dice in a windows application simulating rolling 12 six-sided dice program to simulate the game of craps scoping recursive evaluation of 5 calculating factorials with a recursive method recursively generating fibonacci numbers set of recursive calls to method fibonacci using overloaded methods syntax error generated from overloaded methods with identical parameter lists and different return types the towers of hanoi for the case with four disks 196 198 201 203 205 208 213 217 217 219 221 223 225 234 7 7.1 7.2 7.3 7.4 7.5 7.6 7.7 7.8 7.9 7.10 7.11 7.12 7.13 7.14 7.15 7.16 arrays a 12-element array precedence and associativity of the operators discussed so far initializing element arrays in three different ways computing the sum of the elements of an array program that prints histograms using arrays to eliminate a switch structure simple student-poll analysis program passing arrays and individual array elements to methods passing an array reference by value and by reference sorting an array with bubble sort linear search of an array binary search of a sorted array double-subscripted array with three rows and four columns initializing multidimensional arrays example using double-subscripted arrays using for each/next with an array 238 239 240 242 243 245 248 251 254 257 260 262 266 267 270 272 8 8.1 8.2 8.3 8.4 8.5 8.6 8.7 8.8 8.9 8.10 object-based programming time1 abstract data type represents the time in 24-hour format using an abstract data type accessing private class members from client code generates syntax errors overloaded constructors provide flexible object-initialization options overloaded constructor demonstration properties provide controlled access to an object s data properties demonstration for class time3 date class encapsulates day month and year information employee class encapsulates employee name birthday and hire date composition demonstration 283 287 291 293 295 298 301 306 308 309
[close]