Visual C 2012 How to Program _ www.bit.ly/taiho123

1K 3K 0
Visual C 2012 How to Program _ www.bit.ly/taiho123

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

Deitel® Series Page How To Program Series Android How to Program C How to Program, 7/E C++ How to Program, 9/E C++ How to Program, Late Objects Version, 7/E Java™ How to Program, 9/E Java™ How to Program, Late Objects Version, 8/E Internet & World Wide Web How to Program, 5/E Visual Basic® 2012 How to Program Visual C#® 2012 How to Program, 5/E Visual C++® 2008 How to Program, 2/E Small Java™ How to Program, 6/E Small C++ How to Program, 5/E Simply Series Simply C++: An App-Driven Tutorial Approach Simply Java™ Programming: An App-Driven Tutorial Approach Simply Visual Basic® 2010, 4/E: An App-Driven Tutorial Approach CourseSmart Web Books www.deitel.com/books/CourseSmart/ C++ How to Program, 7/E, 8/E & 9/E Simply C++: An App-Driven Tutorial Approach Java™ How to Program, 7/E, 8/E & 9/E Simply Visual Basic 2010: An App-Driven Approach, 4/E Visual Basic® 2012 How to Program Visual Basic® 2010 How to Program Visual C#® 2012 How to Program, 5/E Visual C#® 2010 How to Program, 4/E Deitel® Developer Series C++ for Programmers, 2/E Android for Programmers: An App-Driven Approach C# 2010 for Programmers, 3/E Dive Into® iOS 6: An App-Driven Approach iOS for Programmers: An App-Driven Approach Java™ for Programmers, 2/E JavaScript for Programmers LiveLessons Video Learning Products www.deitel.com/books/LiveLessons/ Android® App Development Fundamentals C++ Fundamentals C# Fundamentals iOS App Development Fundamentals Java™ Fundamentals JavaScript Fundamentals Visual Basic® Fundamentals To receive updates on Deitel publications, Resource Centers, training courses, partner offers and more, please register for the free Deitel ® Buzz Online e-mail newsletter at: www.deitel.com/newsletter/subscribe.html and join the Deitel communities on Twitter® @deitel Facebook® facebook.com/DeitelFan and Google+ gplus.to/deitel To communicate with the authors, send e-mail to: deitel@deitel.com For information on government and corporate Dive-Into® Series on-site seminars offered by Deitel & Associates, Inc worldwide, visit: www.deitel.com/training/ or write to deitel@deitel.com For continuing updates on Prentice Hall/Deitel publications visit: www.deitel.com www.pearsonhighered.com/deitel/ Visit the Deitel Resource Centers that will help you master programming languages, software development, Android and iPhone/iPad app development, and Internet- and web-related topics: www.deitel.com/ResourceCenters.html Paul Deitel Deitel & Associates, Inc Harvey Deitel Deitel & Associates, Inc Vice President and Editorial Director: Marcia J Horton Executive Editor: Tracy Johnson Associate Editor: Carole Snyder Director of Marketing: Christy Lesko Marketing Manager: Yezan Alayan Marketing Assistant: Jon Bryant Director of Production: Erin Gregg Managing Editor: Scott Disanno Associate Managing Editor: Robert Engelhardt Operations Specialist: Lisa McDowell Art Director: Anthony Gemmellaro Cover Design: Abbey S Deitel, Harvey M Deitel, Anthony Gemmellaro Cover Photo Credit: © Shutterstock/Excellent backgrounds Media Project Manager: Renata Butera Credits and acknowledgments borrowed from other sources and reproduced, with permission, in this textbook appear on page vi The authors and publisher of this book have used their best efforts in preparing this book These efforts include the development, research, and testing of the theories and programs to determine their effectiveness The authors and publisher make no warranty of any kind, expressed or implied, with regard to these programs or to the documentation contained in this book The authors and publisher shall not be liable in any event for incidental or consequential damages in connection with, or arising out of, the furnishing, performance, or use of these programs Copyright © 2014, 2011, 2009 Pearson Education, Inc., publishing as Prentice Hall All rights reserved Manufactured in the United States of America This publication is protected by Copyright, and permission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise To obtain permission(s) to use material from this work, please submit a written request to Pearson Education, Inc., One Lake Street, Upper Saddle River, New Jersey 07458, or you may fax your request to 201-236-3290 Many of the designations by manufacturers and sellers to distinguish their products are claimed as trademarks Where those designations appear in this book, and the publisher was aware of a trademark claim, the designations have been printed in initial caps or all caps Microsoft and/or its respective suppliers make no representations about the suitability of the information contained in the documents and related graphics published as part of the services for any purpose All such documents and related graphics are provided “as is” without warranty of any kind Microsoft and/or its respective suppliers hereby disclaim all warranties and conditions with regard to this information, including all warranties and conditions of merchantability, whether express, implied or statutory, fitness for a particular purpose, title and non-infringement In no event shall Microsoft and/or its respective suppliers be liable for any special, indirect or consequential damages or any damages whatsoever resulting from loss of use, data or profits, whether in an action of contract, negligence or other tortious action, arising out of or in connection with the use or performance of information available from the services The documents and related graphics contained herein could include technical inaccuracies or typographical errors Changes are periodically added to the information herein Microsoft and/or its respective suppliers may make improvements and/or changes in the product(s) and/or the program(s) described herein at any time Partial screen shots may be viewed in full within the software version specified Library of Congress Cataloging-in-Publication Data on file 10 ISBN-10: 0-13-337933-7 ISBN-13: 978-0-13-337933-4 To our review team Shay Friedman Octavio Hernandez Stephen Hustedde José Antonio González Seco Shawn Weisfeld We are grateful for your guidance and expertise Paul and Harvey Deitel Trademarks DEITEL, the double-thumbs-up bug and DIVE INTO are registered trademarks of Deitel and Associates, Inc Microsoft® and Windows® are registered trademarks of the Microsoft Corporation in the U.S.A and other countries This book is not sponsored or endorsed by or affiliated with the Microsoft Corporation UNIX is a registered trademark of The Open Group Throughout this book, trademarks are used Rather than put a trademark symbol in every occurrence of a trademarked name, we state that we are using the names in an editorial fashion only and to the benefit of the trademark owner, with no intention of infringement of the trademark Contents Chapters 24–35 and Appendices D–G are PDF documents posted online at the book’s Companion Website (located at www.pearsonhighered.com/deitel/) Preface Before You Begin Introduction to Computers, the Internet and Visual C# 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 Introduction Hardware and Moore’s Law Data Hierarchy Computer Organization Machine Languages, Assembly Languages and High-Level Languages Object Technology Internet and World Wide Web C# 1.8.1 Object-Oriented Programming 1.8.2 Event-Driven Programming 1.8.3 Visual Programming 1.8.4 An International Standard; Other C# Implementations 1.8.5 Internet and Web Programming 1.8.6 Introducing async/await 1.8.7 Other Key Contemporary Programming Languages Microsoft’s NET 1.9.1 NET Framework 1.9.2 Common Language Runtime 1.9.3 Platform Independence 1.9.4 Language Interoperability Microsoft’s Windows® Operating System Windows Phone for Smartphones 1.11.1 Selling Your Apps in the Windows Phone Marketplace 1.11.2 Free vs Paid Apps 1.11.3 Testing Your Windows Phone Apps Windows Azure™ and Cloud Computing Visual Studio Express 2012 Integrated Development Environment 1.9 1.10 1.11 1.12 1.13 xix xxxv 2 10 12 12 12 12 12 13 13 13 14 14 15 15 15 16 17 18 18 18 19 19 Index flow of control 153, 163 in the if statement 147 in the if else statement 148 in the while statement 153 focus 521 Focused property of class Control 530 Font class 541 Style property 541 Font dialog 51 Font property of a Label 51 Font property of class Control 530 Font property of class Form 522 font size 51 font style 51, 540 Font window 52 FontStyle enumeration 541 for keyword 191 for repetition statement 146, 191, 192, 194, 195, 196, 198, 221 activity diagram 195 header 193 foreach statement 303, 821, 823, 828 on rectangular arrays 325 ForeColor property of class Control 530 foreign key 854, 856 form 38 form background color 49 Form class 521 AcceptButton property 522 ActiveMdiChild property 615 AutoScroll property 522 CancelButton property 522 Close method 522 Font property 522 FormBorderStyle property 522 Hide method 522 IsMdiChild property 615 IsMdiContainer property 614, 615 LayoutMdi method 615, 616 Load event 522 MaximumSize property 532 MdiChildActivate event 615 MdiChildren property 615 MdiParent property 614 MinimumSize property 532 Padding property 532 Show method 522 Text property 522 Form properties, methods and events 522 Form1.cs 56 formal parameter 238 format item 81 FORMAT menu 40 Format method of String 374 Format property of class DateTimePicker 580, 581 format specifier 132 F for floating-point numbers 165 format specifier D 294 format specifier table 132 format string 81 FormatException class 490, 492, 493 FormatString 657 formatted output field width 198 left justify 198 right justify 198 formatting display formatted data 80 FormBorderStyle property of class Form 522 formulating algorithms 154 forward reference 761 fragile software 427 Framework Class Library 796 from clause of a LINQ query 355 FullName property of class DirectoryInfo 608 FullName property of class FileInfo 608 FullName property of class Type 435 FullPath property of class TreeNode 599 FullStackException indicates a stack is full 801 fully qualified class name 116, 243, 522, 523, 623 function 233 function key 559 G G formatting code 132 Game of Craps exercise 338 game playing 245 garbage collection 498 garbage collector 389, 390 Gas Mileage exercise 183 Gates, Bill 14 general catch clause 493 general class average problem 158 generic class 362, 790, 799 Generic classes Dictionary 817 LinkedList 817, 836 LinkedListNode 836 List 817 Queue 817 SortedDictionary 817, 834, 835 SortedList 817 SortedSet 842 Stack 817 generic interface 790 Generic List collection demonstration 363 generic method 790, 793 creating 806 implementation 793 generics 790 class 790 class constraint 797 compile-time type safety 790 constructor constraint (new()) 798 default type constraint (object) of a type parameter 802 interface 790 interface constraint 797 method 793 overloading 798 reference type constraint class 798 reusability 799 scope of a type parameter 802 specifying type constraints 796 Stack class 799 type argument 795, 802 type checking 790 965 generics (cont.) type constraint of a type parameter 796, 797 type parameter 794 type parameter list 794 value type constraint struct 798 where clause 797 get accessor of a property 108, 118, 121 get keyword 119 GetCreationTime method of class Directory 674 GetCreationTime method of class File 674 GetDirectories method of class Directory 603, 674 GetDirectories method of class DirectoryInfo 608 GetEnumerator method of interface IEnumerable 820 GetExtension method of class Path 681 GetFiles method of class Directory 674, 681 GetFiles method of class DirectoryInfo 608 GetHashCode method of class Object 830 GetItemChecked method of class CheckedListBox 592 GetLastAccessTime method of class Directory 674 GetLastAccessTime method of class File 674 GetLastWriteTime method of class Directory 674 GetLastWriteTime method of class File 674 GetLength method of an array 320 GetNodeCount method of class TreeNode 600 GetObject method of class ResourceManager 549 GetSelected method of class ListBox 588 GetType method of class object 435, 464 GIF (Graphic Interchange Format) 54 gigabyte global namespace 116 Global Warming Facts Quiz 230 Good Programming Practices overview xxxiv goto elimination 144 goto statement 144 GPS device graph 228 graph information 294 Graphic Interchange Format (GIF) 54 graphical user interface (GUI) 14, 36, 244, 519 Graphics class 556, 597 Clear method 597 DrawEllipse method 597 DrawPie method 598 DrawRectangle method 598 FillEllipse method 556, 598 FillPie method 598 FillRectangle method 598 966 Index Graphics property of class PaintEventArgs 626, 627 Greatest Common Divisor exercise 281 GridView ASP.NET data control 934 GridView class DataBind method 941 gross pay 184 GroupBox class 20 GroupBox control 63, 536 Controls property 537 properties 536 Text property 536 guard condition 147, 149 Guess the Number exercise 281 enhanced 281 Guestbook Application Modification exercise 948 guestbook on a website 933 GUI (graphical user interface) 14, 36, 519 GUI control 520 GUI control, basic examples 520 H half word 349 handle an event 526 handle an exception 491 hard drive 2, 7, 28 hardware 2, has-a relationship 386, 406 hash function 830 hash table 829 hashing 829 Hashtable class 817, 817, 829 ContainsKey method 832 Count property 833 method Add 832 property Values 833 head of a queue 747, 766 Height property of structure Size 532 HELP menu 40, 46 helper method 207, 775 HelpLink property of Exception 506 heuristic 341 hexadecimal (base 16) number system 282, 349 “hidden” fields 256 hide implementation details 233, 376, 394, 396 Hide method of class Control 530 Hide method of class Form 522 hiding implementation details 830 hierarchical boss method/worker method relationship 233 high-level language horizontal tab 79 host 899 hostname 899 hot key 570 HourlyEmployee class that extends Employee 455 HTML (HyperText Markup Language) 11, 899 HTTP (HyperText Transfer Protocol) 11, 899, 925 HttpSessionState class 927, 931, 932, 933 Add method 932 HttpSessionState diagram (cont.) Count property 931 IsNewSession property 931 Keys property 931, 933 SessionID property 931 Timeout property 931 HugeInteger Class 404 exercise 404 HyperLink ASP.NET web control 918 HyperText Markup Language (HTML) 11, 899 HyperText Transfer Protocol (HTTP) 11, 899, 925 Hypotenuse of a Right Triangle exercise 279 I IBM DB2 850 ICollection interface 816 IComparable interface 476, 777 IComparable interface 796, 842 CompareTo method 796 IComparer interface 842 IComponent interface 476, 520 icon 40 IDE (Integrated Development Environment) 19, 34 identifier 69, 82 identity column in a database table 853 IDictionary interface 816 IDisposable interface 477, 504 Dispose method 477 IE10 (Internet Explorer 10) 17 IEC 60559 952 IEEE 754 952 IEnumerable interface method GetEnumerator 820 IEnumerable interface 357, 816, 820, 857 Any extension method 361 Count extension method 361 Distinct extension method 361 First extension method 361 IEnumerator interface 477, 820 if single-selection statement 90, 146, 147, 201, 220, 221 activity diagram 147 if else double-selection statement 146, 148, 163, 201, 220 activity diagram 148 ignoring array element zero 298 IIS Express 904, 912 IList interface 816 Image ASP.NET web control 915 Image Collection Editor 604 Image property of class PictureBox 53, 547 image resource 549 ImageIndex property of class ListViewItem 604 ImageIndex property of class TreeNode 599 ImageList class 599, 603 Images property 604 ImageList property of class TabControl 611 ImageList property of class TreeView 599 Images property of class ImageList 604 ImageUrl property of an Image web control 915 imaginary part of a complex number 403 immutable (strings) 392 immutable string 642 imperative programming 353 implement an interface 443, 467, 474 multiple interfaces 471 implementation-dependent code 376 implementation of a function 453 implementing a dispose method (link to MSDN article) 477 Implementing a queue by inheriting from class List 767 Implementing a stack by inheriting from class List 762 implicit conversion 165 implicit conversions between simple types 242 implicitly typed local variable 355, 356, 362 improve performance of bubble sort 744 In property of class Console 672 increment 190, 196 a control variable 191 expression 210 of a for statement 194 increment and decrement operators 172 increment operator, ++ 172 Increment property of class NumericUpDown 551 indefinite repetition 159 indentation 71, 148, 150 indent size 70 independent software vendor (ISV) 434 index 286, 296 Index property of class ItemCheckEventArgs 592 index zero 286 indexer 642 of a Hashtable 832 of an ArrayList 825 IndexOf method of class Array 821 IndexOf method of class ArrayList 822, 825 IndexOf method of class List 362 IndexOf method of class string 646 IndexOfAny method of class string 646 IndexOutOfRangeException class 296, 298, 496 indirect base class 406, 408 infer a local variable’s type 355 infinite loop 153, 164, 194, 265 infinite recursion 265 infinite series 229 Infinite Series: ex exercise 187 Infinite Series: Mathematical Contant e exercise 187 infinity symbol 856 information hiding 10, 118, 394, 466 information tier 901 inherit from class Control 627 inherit from Windows Form control 627 Index inherit interface 484 inheritance 10, 406, 410, 434 examples 407 hierarchy 407 hierarchy for university CommunityMembers 408 single 406 Inheritance hierarchy for class Shape 408 inheritance with exceptions 496 Init event of a Web Form 911 Init event of an ASP.NET web page 913 initial state 145 initial state in the UML 218 initial value of control variable 190 InitialDelay property of class ToolTip 550 initialization phase 159 initializer list 290 Initializing jagged and rectangular arrays 319 initializing readonly arrays 823 Initializing the elements of an array with an array initializer 290 initializing two-dimensional arrays in declarations 319 inlining method calls 466 InnerException property of Exception 505, 509 innermost set of brackets 297 inorder traversal of a binary tree 770 input data from the keyboard 95 input device input/output operation 345 input–output operations 145 input unit Insert method of class ArrayList 822 Insert method of class List 363 Insert Separator option 573 Insert Snippet window 123 inserting separators in a menu 573 insertion point 750, 751 insertion sort algorithm 730, 734 instance instance of a class 117 instance variable 108, 116, 117, 129, 235 instance variables 10 instantiate an object of a class 108 instruction execution cycle 347 int simple type 83, 162, 171, 952 Int16 struct 747 Int32 796 Int32 struct 747 Int64 struct 747 integer 81 division 86, 158 mathematics 395 value 83 integer array 290 Integer Division exercise 182 integer division without exception handling 488 integer division yields an integer result 164 IntegerPower method 279 Integrated Development Environment (IDE) 19, 34 IntelliSense 74, 355, 851, 856 interactions among objects 395 interest rate 197 interface 357, 443, 468, 474 declaration 467 interface constraint 797 interface keyword 467, 475 Interfaces ICollection 816 IComparable 476, 777, 796 IComparable 842 IComparer 842 IComponent 476, 520 IDictionary 816 IDisposable 477, 504 IEnumerable 816, 820, 857 IEnumerable 357, 857 IEnumerator 477, 820 IList 816 IQueryable 857 ISerializable 702 internal data representation 396 Internet 11 Internet Explorer 10 (IE10) 17 Internet Information Services (IIS) 899 interpreter intersection of two sets 403 Interval property of class Timer 628 InvalidCastException 464, 748 InvalidCastException class 816, 833 InvalidOperationException class 821, 828, 839 Invoice class implements IPayable 470 invoke a method 124, 233 iOS 16 IP address 899 IPayable interface declaration 469 IPayable interface hierarchy UML class diagram 469 IQueryable interface 857 is-a relationship 406, 444 is operator 463 IsDigit method of struct Char 662 ISerializable interface 702 IsLetter method of struct Char 662 IsLetterOrDigit method of struct Char 662 IsLower method of struct Char 662 IsMdiChild property of class Form 615 IsMdiContainer property of class Form 614, 615 IsNewSession property of class HttpSessionState 931 IsPostBack property of class Page 924 IsPunctuation method of struct Char 662 IsSymbol method of struct Char 662 IsUpper method of struct Char 662 IsValid property of class Page 924 IsWhiteSpace method of struct Char 662 ItemActivate event of class ListView 604 ItemCheck event of class CheckedListBox 591, 592 ItemCheckEventArgs class 592 CurrentValue property 592 Index property 592 NewValue property 592 Items property of class ComboBox 594, 595 967 Items property of class ListBox 587, 588 Items property of class ListView 604 ItemSize property of class TabControl 611 iterating (looping) 157 iteration of a loop 190, 210 iteration (looping) of a for loop 297 iteration statement 146 iteration variable 303 iterative 265 J jagged array 316, 317, 319 Jagged Arrays exercise 337 Java programming language 14 JavaScript 918 JIT (just-in-time) compiler 15 joining database tables 855, 876 LINQ to Entities 875 Joint Photographic Experts Group (JPEG) 54 JPEG (Joint Photographic Experts Group) 54 just-in-time (JIT) compiler 15 K key code 559 key data 559 key event 556, 557 key value 559, 776 key–value pair 931 keyboard 2, 28, 81, 520 keyboard shortcuts 570 KeyChar property of class KeyPressEventArgs 556 KeyCode property of class KeyEventArgs 557 KeyData property of class KeyEventArgs 557 KeyDown event of class Control 556, 557 KeyEventArgs class 556 Alt property 557, 559 Control property 557, 559 KeyCode property 557 KeyData property 557 KeyValue property 557 Modifiers property 557 Shift property 557, 559 KeyEventArgs properties 557 KeyNotFoundException class 836 KeyPress event of class Control 556, 557 KeyPressEventArgs class 556 KeyChar property 556, 557 KeyPressEventArgs properties 557 keys function 559 modifier 556 Keys enumeration 556 Keys property of class Dictionary 682 Keys property of Hashtable 832 Keys property of HttpSessionState class 931, 933 968 Index KeyUp event of class Control 556, 557 KeyValue property of class KeyEventArgs 557 Keywords 68, 146 abstract 423, 449 as 464 base 409, 422, 431, 433 bool 149 break 205 case 205 char 83 class 68, 109 const 208, 235, 291, 393 continue 209 decimal 83, 128 default 205 delegate 526 199 double 128 else 148 enum 253 false 149 float 83 for 191 get 119 if 90, 147, 148 interface 467 is 463 namespace 623 new 111, 125, 288, 289, 318 null 120, 124, 175, 288 operator 478 out 266 override 299, 414, 422, 423 params 327 partial 524, 913 private 118, 376, 409 protected 376, 409 public 70, 109, 118, 238, 376, 409 readonly 394 ref 266, 305 return 119, 233, 241 sealed 466 set 119 static 198 struct 660 switch 205 this 377, 393 true 149 value (contextual) 119 var 355 virtual 423 void 71, 109 while 152, 199 Knight’s Tour exercise 340 Brute Force Approach 341 Closed Tour Test 342 Koenig, Andrew 487 L Label 51 label 533 Label class 38, 47, 50 Label control 520, 533 label in a switch 205, 206 lambda expression 868, 873, 874 lambda operator 868 lambda operator 868 language independence 15 Language Integrated Query (LINQ) 352 language interoperability 15 LargeImageList property of class ListView 604 last-in first-out (LIFO) order 805 Last property of class LinkedList 840 last-in, first-out (LIFO) data structure 762 LastIndexOf method of class Array 821 LastIndexOf method of class string 646, 648 LastIndexOfAny method of class string 646 last-in-first-out (LIFO) 241 last-in-first-out (LIFO) data structure 395 LastNode property of class TreeNode 599 late binding 463 layout, control 529 LayoutMdi method of class Form 615, 616 leading 294 leaf node in a binary search tree 769, 775 left brace, { 70, 71, 82 left child 769 left justify output 198 left subtree 769, 775 left-to-right evaluation 89 Length property of an array 287 Length property of class string 642, 643 Length property of class StringBuilder 653 let clause of a LINQ query 366 letter 3, 670 level of indentation 148 level-order binary tree traversal 777 LIFO (last-in-first-out) order 241, 395, 805 line numbers xlii linear collection 749 linear data structure 769 linear run time 720 linear search algorithm 717, 726 link 750, 769 link for a self-referential class 748 LinkArea property of class LinkLabel 584 LinkBehavior property of class LinkLabel 584 LinkClicked event of class LinkLabel 583, 584 LinkColor property of class LinkLabel 584 linked list 747, 749, 758 linked list data structure 747 linked list in sorted order 750 LinkedList generic class 817, 836 AddFirst method 839 AddLast method 839 method Find 840 method Remove 840 property First 840 property Last 840 LinkedListNode class property Next 836 LinkedListNode diagram (cont.) property Previous 836 property Value 836 LinkedListNode generic class 836 LinkLabel class 570, 583 ActiveLinkColor property 584 LinkArea property 584 LinkBehavior property 584 LinkClicked event 583, 584 LinkColor property 584 LinkVisited property 584 Text property 584 UseMnemonic property 584 VisitedLinkColor property 584 LinkLabel properties and an event 584 LinkVisited property of class LinkLabel 584 LINQ (Language Integrated Query) 352, 677 anonymous type 361 ascending modifier 356 Count method 681 deferred execution 366 descending modifier 356 Distinct query operator 681 from clause 355 let clause 366 LINQ to Entities 353, 851 LINQ to Objects 352, 851 LINQ to XML 353 orderby clause 356 provider 353 query expression 352 range variable 355 Resource Center 889 select clause 356 where clause 356 LINQ provider 353 LINQ query syntax 857 LINQ to Entities 353, 851, 852, 868 data binding 857 DbContext class 857, 862 Object data source 864 primary keys 851 saving changes back to a database 869 Linq to Entities extension methods 868 LINQ to Objects 352, 678, 851, 857 using a List 365 using an array of Employee objects 358 using an int array 353 LINQ to SQL 851 LINQ to XML 353 LINQ usage throughout the book 352 LINQPad (www.linqpad.net) 889 Linux 16 list, editable 595 List generic class 362, 817 Add method 363 Capacity property 362, 365 Clear method 362 Contains method 362, 365 Count property 364 IndexOf method 362 Insert method 363 Remove method 362, 364 RemoveAt method 363, 364 RemoveRange method 363 Index List generic class (cont.) Sort method 363 TrimExcess method 363 List methods 362 ListBox control 520, 570, 587 ClearSelected method 588 GetSelected method 588 Items property 588 MultiColumn property 587 SelectedIndex property 588 SelectedIndexChanged event 587 SelectedIndices property 588 SelectedItem property 588 SelectedItems property 588 SelectionMode property 587 Sorted property 588 ListBox properties, method and event 587 ListBox.ObjectCollection class 588 ListNode, List and EmptyListException class declarations 751 ListView control 603 Activation property 603 CheckBoxes property 603 ItemActivate event 604 Items property 604 LargeImageList property 604 MultiSelect property 603 SelectedItems property 604 SmallImageList property 604 View property 603 ListView displaying files and folders 605 ListView properties and events 604 ListViewItem class 604 ImageIndex property 604 literal 71 literals decimal 128 floating point 128 int 128 live-code approach xxxiii Load event 923 Load event of an ASP.NET web page 923 Load event of class Form 522 Load extension method of class DBExtensions 869, 871 load factor 829 load/store operations 345 local variable 116, 156, 255, 256, 257, 379 local variable “goes out of scope” 670 location in computer’s memory 85 Location property of class Control 532 Log method of Math 235 logarithm 235 logarithmic run time 726 logic error 84, 152, 192 logical decision logical negation, ! 213, 214 operator truth table 214 logical operators 211, 213, 214 logical output operation 673 logical unit logical XOR, ^ 213 login (ASP.NET) 942 Logo language 339 long simple type 952 long-term retention of data 670 Long value of enumeration DateTimePickerFormat 580 loop 146, 153, 157 body 199 continuation condition 146 counter 190 infinite 153, 164 nested within a loop 167 loop-continuation condition 190, 191, 192, 194, 196, 199, 200, 210 lower camel casing 83 lowercase letter 4, 68 M m-by-n array 317 Mac OS X 16 machine language machine language programming exercise 344 magic numbers 292 magnetic disk 670 magnetic tape 670 Main method 70, 72, 82, 111 maintainability 747 make your point (game of craps) 250 making decisions 95 managed code 15 “manufacturing” section of the computer many-to-many relationship 856, 861 mask the user input 533 master pages 942 master/detail view 879 Match class 639, 662 Math class 234, 235 Abs method 235 Ceiling method 235 Cos method 235 E constant 235 Exp method 235 Floor method 235 Log method 235 Max method 235 Min method 235 PI constant 235, 275 Pow method 198, 199, 234, 235, 275 Sin method 235 Sqrt method 234, 235, 242, 511 Tan method 235 Math.PI constant 103 Max method of Math 235 MaxDate property of class DateTimePicker 581, 583 MaxDate property of class MonthCalendar 580 MaxDropDownItems property of class ComboBox 594 maximum 184 Maximum method 236 Maximum property of class NumericUpDown 551 MaximumSize property of class Control 532 MaximumSize property of class Form 532 969 MaxSelectionCount property of class MonthCalendar 580 mdf file extension 852 MDI (Multiple Document Interface) 614 MDI (Multiple Document Interface) window 520 MDI child 621 MDI parent and MDI child properties, method and event 615 MDI parent window class 618 MDI title bar 616 MdiChildActivate event of class Form 615 MdiChildren property of class Form 615 MdiLayout enumeration 616 ArrangeIcons value 616 Cascade value 616 TileHorizontal value 616 TileVertical value 616 MdiParent property of class Form 614 MdiWindowListItem property of class MenuStrip 616 mean 88 member access (.) operator 198, 234, 391 member access operator 112 MemberwiseClone method of class object 435 memory 3, memory consumption 815 memory dump 348 memory leak 390, 497 memory location 85 memory unit MemoryStream class 673 menu 39, 519, 570 BUILD 39 DEBUG 40 EDIT 39 FILE 39 FORMAT 40 HELP 40, 46 PROJECT 39 TEAM 40 TEST menu 40 TOOLS 40 VIEW 39, 41 WINDOW 40 menu access shortcut 570 menu access shortcut, create 571 menu bar 39, 519 in Visual Studio IDE 39 menu item 39, 570 menu, ellipsis convention 573 menu, expanded and checked 571 MenuItem property MdiWindowListItem example 617 MenuStrip class 61, 571 MdiWindowListItem property 616 RightToLeft property 574 MenuStrip properties and events 574 merge sort algorithm 734, 740 merge symbol in the UML 153 merge two arrays 735 message 71 message (sent to an object) 108 Message property of an exception object 299 Message property of Exception 502, 505 970 Index method 8, 70, 113 call 108 header 110 in the UML 10 parameter 115 parameter list 114 return type 109 static 198 method call 9, 233, 238 method call stack 241, 505, 762 method declaration 238 method overloading 232, 258 method parameter list 327 methods implicitly sealed 466 methods of class List 362 Metro 17 Microsoft SQL Server 850 SQL Server Express 850 Microsoft Developer Network (MSDN) 35 Microsoft Intermediate Language (MSIL) 15, 76 middle tier 901 mileage obtained by automobiles 183 Min method of Math 235 MinDate property of class DateTimePicker 581, 583 MinDate property of class MonthCalendar 580 minimized and maximized child window 616 Minimum property of class NumericUpDown 551 MinimumSize property of class Control 532 MinimumSize property of class Form 532 modal dialog 690 model 858 model designer 861 Modified Compound Interest Program exercise 228 Modified Diamond Program exercise 229 Modified Triangle Program exercise 229 modifier key 556 Modifiers property of class KeyEventArgs 557 Modifying the Internal Data Representation of a Class (exercise) 402 modularizing a program with methods 233 modulus operator (%) 86 monetary calculations 199 MonthCalendar class 62, 579 DateChanged event 579 FirstDayOfWeek property 580 MaxDate property 580 MaxSelectionCount property 580 MinDate property 580 MonthlyBoldedDates property 580 SelectionEnd property 580 SelectionRange property 580 SelectionStart property 580 MonthlyBoldedDates property of class MonthCalendar 580 Moore’s Law name conflict 523, 623 More Windows option in Visual Studio Name property of class DirectoryInfo NET 616 motion information mouse 2, 28, 520 pointer 41 mouse click 553 mouse event 553, 554 mouse move 553 MouseDown event of class Control 554 MouseEnter event of class Control 554 MouseEventArgs class 554 Button property 554 Clicks property 554 X property 554 Y property 554 MouseEventArgs properties 554 MouseEventHandler delegate 554 MouseHover event of class Control 554 MouseLeave event of class Control 554 MouseMove event of class Control 554 MouseUp event of class Control 554 MouseWheel event of class Control 554 Move method of class Directory 674 Move method of class File 674 MoveFirst method of class BindingSource 873 MoveNext method of IEnumerator 820 MSDN (Microsoft Developer Network) 68, 233 MSDN (Microsoft Developers Network) 35 MSIL (Microsoft Intermediate Language) 15 multi-core processor multicast delegate 527 multicast event 527 MulticastDelegate class 527 MultiColumn property of class ListBox 587 multidimensional array 316 MultiExtended value of enumeration SelectionMode 587 Multiline property of class TabControl 611 Multiline property of class TextBox 534 multiple document interface (MDI) 520, 614 multiple-selection statement 146 Multiples exercise 279 Multiples of exercise 187 multiplication, * 86 multiplicative operators: *, / and % 165 MultiSelect property of class ListView 603 MultiSimple value of enumeration SelectionMode 587 multitier app 900 mutual exclusion 542 mutually exclusive options 542 MySQL 850 N N format specifier 132 n-tier app 900 name 85 name collision 523, 623 608 Name property of class FileInfo 608 named constant 292 named parameter 262 namespace 67, 232, 243 System.Web.UI 913 System.Web.UI.WebControls 913 namespace 623 declaration 622 keyword 623 namespace declaration 522 Namespaces of the FCL 244 System 245 System.Collections 244, 762, 796, 815 System.Collections.Concurrent 815 System.Collections.Generic 244, 362, 681, 815, 835 System.Collections.Specialized 815 System.Data.Entity 244, 857 System.Data.Linq 244 System.Diagnostics 586 System.Drawing 541 System.IO 244, 673 System.Linq 244, 353, 857 System.Runtime.Serialization.Formatters.Binary 701 System.Text 244, 639 System.Text.RegularExpressions 639 System.Web 244 System.Windows.Controls 244 System.Windows.Forms 244, 521 System.Windows.Input 244 System.Windows.Media 244 System.Windows.Shapes 244 System.Xml 244 System.Xml.Linq 244 NaN constant of structure Double 490, 511 natural logarithm 235 NavigateUrl property of a HyperLink control 918 navigation property 856, 857, 864, 865 NegativeInfinity constant of structure Double 490 NegativeNumberException represents exceptions caused by illegal operations performed on negative numbers 510 nested array initializer 317 nested building block 221 nested control statements 166, 218, 221, 249 nested for statement 294, 319, 320, 321 nested foreach statement 321 nested if else selection statement 149, 150, 151 nested parentheses 87 nesting 147, 148 nesting rule 218 Index NET Framework 14, 790 Framework Class Library 67, 232, 243, 476 Framework Class Library (FCL) 12, 14, 16 Framework documentation 68 initiative 14 NET for Windows Store Apps 16 New keyword 877 new keyword 288, 289, 318 new operator 111, 125, 749 New Project dialog 36, 38, 48 new project in Visual Studio 39 new() (constructor constraint) 798 newline character 79 newline escape sequence, \n 79, 83, 349 NewValue property of class ItemCheckEventArgs 592 Next method of class Random 245, 246, 249 Next property of class LinkedListNode 836 NextNode property of class TreeNode 599 Nginx web server 899 node 598 child 598 expand and collapse 598 parent 598 root 598 sibling 598 nodes in a linked list 749 Nodes property of a TreeView 598 Nodes property of class TreeNode 599 Nodes property of class TreeView 599 non-static class member 393 None value of enumeration SelectionMode 587 nonfatal logic error 152 nonlinear data structures 750 not selected state 542 note (in the UML) 145 Notepad 584 Notepad GUI exercise 61 Now property of structure DateTime 629 null keyword 120, 124, 175, 288 null reference 749, 760 NullReferenceException class 496 NumericUpDown control 520, 551 DecimalPlaces property 551 Increment property 551 Maximum property 551 Minimum property 551 ReadOnly property 553 UpDownAlign property 552 Value property 552 ValueChanged event 552 NumericUpDown properties and events 551 O O(1) time 720 O(log n) time 726 O(n log n) time 740 O(n) time 720 O(n2) time 720 object 2, 8, 29 send a message 124 object (or instance) 10 Object Browser (Visual Studio NET) 396 object class 406, 410, 434 Equals method 435 Finalize method 435 GetHashCode method 435 GetType method 435, 464 MemberwiseClone method 435 ReferenceEquals method 435 ToString method 413, 435 object creation expression 111, 126 Object data source 864 object initializer 398 object initializer list 398 object methods that are inherited directly or indirectly by all classes 435 object of a class 108 object of a derived class 445 object of a derived class is instantiated 433 object-oriented analysis and design (OOAD) 10 object-oriented language 10 object-oriented programming (OOP) 2, 10, 406 object serialization 701 ObjectCollection collection Add method 589 Clear method 591 RemoveAt method 591 ObservableCollection class 869, 873 octal number system (base 8) 282 off-by-one error 192 one statement per line 94 one-to-many relationship 855, 856 One value of enumeration SelectionMode 587 OnPaint method of class Control 626 OOAD (object-oriented analysis and design) 10 OOP (object-oriented programming) 10, 406 Open method of class File 674 OpenFileDialog class 695, 700 opening a project 39 OpenRead method of class File 674 OpenText method of class File 674 OpenWrite method of class File 674 operand 165, 344 operands of a binary operator 85 operating system 16 operation code 344 operation in the UML 112 operation parameter in the UML 115 operations of an abstract data type 395 operator 86 operator keyword 478 operator overloading 477 operator precedence 87 operator precedence chart 165 rules 87 Operators 868 ^, boolean logical exclusive OR 211, 213 , prefix decrement/postfix decrement 172 971 Operators diagram (cont.) -, subtraction 87, 88 !, logical negation 211, 213 !=, not equals 90, 93 ?:, ternary conditional operator 149, 174 *, multiplication 87, 88 *=, multiplication compound assignment 171 /, division 87, 88 \=, division compound assignment 171 &, boolean logical AND 211, 213 &&, conditional AND 211, 212 %, remainder 87, 88 %=, remainder compound assignment 171 +, addition 87, 88 ++, prefix increment/postfix increment 172 +=, addition assignment operator 171 =, greater than or equal to 90 |, boolean logical inclusive OR 211, 213 ||, conditional OR 211, 212 arithmetic 86 as 464 binary 84, 86 boolean logical AND, & 211, 213 boolean logical exclusive OR, ^ 211, 213 boolean logical inclusive OR, | 213 cast 164, 254 compound assignment operators 171, 173 conditional AND, && 211, 212, 213, 360 conditional operator, ?: 149, 174 conditional OR, || 211, 212, 213 decrement operator, 171, 172 increment and decrement 172 increment operator, ++ 172 is 463 logical negation, ! 214 logical operators 211, 213 logical XOR, ^ 213 member access (.) 198, 391 multiplicative: *, / and % 165 new 111, 125 postfix decrement 172 postfix increment 172 precedence chart 950 prefix decrement 172 prefix increment 172 remainder operator 186 remainder, % 86 optical disk 670 optimizing compiler 199 optional parameter 260, 262 default value 260, 261 Oracle Corporation 850 972 Index order in which actions should execute 143 orderby clause of a LINQ query 356 ascending modifier 356 descending modifier 356 OrderBy extension method of class Queryable 868, 873 orientation information out keyword 266 out-of-range array index 496 Out property of class Console 672 outer set of brackets 297 OutOfMemoryException class 496, 749 output 79 output device output parameter 266 output unit overflow error 349 overloaded constructors 379 overloaded generic methods 798 overloaded methods 75, 258, 791 with identical signatures 260 overloaded operators for complex numbers 479 override a base class method 409, 413 override keyword 299, 414, 422, 423 P π calculation exercise 229 Padding property of class Control 532 Padding property of class Form 532 Page class 913, 924, 929 Session property 929 Page Hit Counter exercise 948 page layout software 639 Page_Init event handler 911, 913 Page_Load event handler 923 PaintEventArgs class 626 ClipRectangle property 626 Graphics property 626 PaintEventArgs properties 627 palette 50 palindrome 186 Palindromes exercise 186 Panel class 20, 63 Panel control 520, 536 AutoScroll property 536 BorderStyle property 536 Controls property 536 Panel properties 536 Panel with scrollbars 537 parameter 113, 115 output 266 parameter in the UML 115 Parameter Info window 75 parameter list 114, 126 parameterless constructor 382, 385, 798 params keyword 327 parent menu 570 parent node 598, 770 Parent property of class DirectoryInfo 609 parent window 614 parentheses 70, 87 nested 87 redundant 90 unnecessary 90 Parking Charges exercise 278 partial class 913 partial class 521 partial keyword 524 partial modifier 913 partition step in quicksort 745 pass an array element to a method 305 pass an array to a method 305 pass-by-reference 266 pass-by-value 266, 305 Passing an array reference by value and by reference 308 Passing arrays and individual array elements to methods 305 passing options to a program with command-line arguments 329 password TextBox 533 Path class 603, 681 GetExtension method 681 pattern of 0s and 1s 671 pattern of 1s and 0s payroll file 672 payroll system 671 Payroll System Modification exercise 484 Peek method of class Stack 828 Perfect Numbers exercise 281 perform a calculation 95 perform a task 110 perform an action 71 permission setting 604 persistent persistent data 670 personalization 925 phases of an application 159 Phishing Scanner 714 physical output operation 673 “pick off” each digit 104 PictureBox class 38, 47, 53 PictureBox control 547, 617 Click event 547 Image property 547 SizeMode property 547 PictureBox properties and event 547 Pig Latin 667 pin icon 42 platform 17, 31 platform independence 15, 28 PNG (Portable Network Graphics) 54 poker 344 Poll analysis application 296 Polymorphic banking program exercise using Account hierarchy 485 polymorphic screen manager 444 polymorphically process Invoices and Employees 474 polymorphism 209, 436, 442 polynomial 89 pop data off a stack 241 Pop method of class Stack 827, 828 pop stack operation 762 portability 15 Portability Tips overview xxxiv Portable Network Graphics (PNG) 54 porting 15 position number 286 PositiveInfinity constant of structure Double 490 postback event of an ASP.NET page 924 postfix decrement operator 172 postfix increment operator 172, 194 PostgreSQL 850 postorder traversal of a binary tree 770 Pow method of Math 198, 199, 234, 235, 275 power (exponent) 235 Power method 282 power of larger than 100 152 precedence 94, 174 arithmetic operators 88 chart 88 precedence chart 165 precedence chart appendix 950 precision formatting a floating-point number 165 of double values 953 of float values 953 precision of a floating-point value 128 predicate 356 predicate method 755 prefix decrement operator 172 prefix increment operator 172 Prefix vs Postfix Increment Operators exercise 182 preorder traversal of a binary tree 770 prepackaged data structures 815 presentation logic 901 Previous property of class LinkedListNode 836 PrevNode property of class TreeNode 599 primary key 851, 856 in LINQ to Entities 851 primary memory prime 281 prime number 342, 848 Prime Numbers exercise 281 principal 197 principle of least privilege 393 print spooling 766 privacy protection 925 private access modifier 377 static class member 391 private access modifier 118, 409 probability 245 procedure 143, 233 Process class 586 Start method 586 processing phase 159 processing unit 2, 28 Product of Odd Integers exercise 227 program program control 144 program execution stack 241 program in the general 442, 484 program in the specific 442 programming languages BASIC 14 C# 12 Visual Basic 14 project 36 PROJECT menu 39 projection 361 promotion 165, 197, 925 promotion rules 242 prompt 84 properties 116 Properties window 44, 45, 48, 52, 908 property 108 Index property declaration 118 property for a form or control 44 proprietary class 434 protected access modifier 376 protected access modifier 409 pseudocode 144, 148, 154, 166, 168 first refinement 159, 167 second refinement 160, 168 pseudocode algorithm 161 pseudorandom number 245, 250 public access modifier 109, 118, 238 class 70 interface 372 keyword 70, 118 member of a derived class 409 method 373, 376 method encapsulated in an object 376 service 372 static class members 391 static method 391 public access modifier 409 public default constructor 125 push data onto a stack 241 Push method of class Stack 827 push stack operation 762 Pythagorean Triples exercise 229 Q quad-core processor 7, 28 quadratic run time 720 query 352, 850, 852 query expression (LINQ) 352 Queryable class 857 OrderBy extension method 868, 873 ThenBy extension method 868 Where extension method 873 Querying an Array of Invoice Objects exercise 370 queue 396, 747, 766 Queue class 817 queue data structure 747 Queue generic class 817 quicksort algorithm 745 R radians 235 radio button 534, 542 radio button group 542 radio buttons, using with TabPage 613 Radio GUI exercise 64 RadioButton control 20, 24, 25, 63, 539, 542 Checked property 542 CheckedChanged event 542 Text property 542 RadioButton properties and events 542 RadioButtonList ASP.NET web control 918 radius of a circle 280 Random class 245, 338 Next method 245, 246, 249 random number generation 299, 666 random numbers 250 in a range 250 random numbers (cont.) scaling factor 246, 249, 250 seed value 245, 250 shifting value 249, 250 range variable of a LINQ query 355 Rational class 403 Rational Numbers (exercise) 403 Read method of class Console 673 readability 66, 168 Reading sequential-access files 691 ReadLine method of class Console 84, 114, 205, 673 readonly keyword 394 ReadOnly property of class NumericUpDown 553 ReadOnly property of class TextBox 534 real number 162 real part of a complex number 403 realization in the UML 469 “receiving” section of the computer reclaim memory 393 recognizing clients 925 record 4, 671, 851 Record for sequential-access fileprocessing applications 684 record key 672 rectangle 402 Rectangle Class (exercise) 402 rectangular array 316, 318 with three rows and four columns 317, 318 recursion 603 recursion exercises binary search 744 linear search 744 recursion step 263 recursive binary search algorithm 744 recursive call 263 recursive evaluation 264 of 5! 264 recursive factorial 263 recursive linear search algorithm 744 recursive method 263 Recursive Power Calculation exercise 282 recursive Power method 282 recursive step 745 redundant parentheses 90 ref keyword 266, 305 refer to an object 124 reference 124 reference manipulation 747 reference type 123, 286 reference type constraint class 798 Reference, output and value parameters 267 ReferenceEquals method of object 435 refinement process 159 Regex class 639 registration (ASP.NET) 942 regular expression 662 RegularExpressionValidator ASP.NET validation control 922 reinventing the wheel 67 relational database 850, 851 relational database management system (RDBMS) 901 relational database table 851 relational operators 90 973 relative positioning 908 release resource 498 release unmanaged resources 477 remainder 86 remainder operator, % 86, 87, 186 Remove method of class ArrayList 823, 825 Remove method of class Dictionary 682 Remove method of class LinkedList 840 Remove method of class List 362, 364 Remove method of class StringBuilder 657 RemoveAt method of class ArrayList 823 RemoveAt method of class List 363, 364 RemoveAt method of class ObjectCollection 591 RemoveRange method of class ArrayList 823 RemoveRange method of class List 363 repetition 219, 221 counter controlled 154, 163, 166, 167 definite 154 sentinel controlled 158, 160, 161, 163, 164 repetition statement 144, 146, 152, 160 while 146, 199, 201, 221, 201, 221 for 146, 195, 221 foreach 146 while 146, 152, 153, 157, 163, 221 repetition terminates 153 Replace method of class string 651, 652 Replace method of class StringBuilder 659 RequiredFieldValidator ASP.NET validation control 921, 922 requirements 10 reservations system 338 reserved word 68, 146 Reset method of interface IEnumerator 820 ReshowDelay property of class ToolTip 550 Resize method of class Array 352, 362 resource 549 resource leak 389, 497 ResourceManager class 549 GetObject method 549 Resources class 549 responses to a survey 296, 298 result of an uncaught exception 494 resumption model of exception handling 495 rethrow an exception 503 return keyword 119, 233, 241 return statement 119, 263 return type of a method 109 reusability 747, 799 reusable component 407 reusable software components 244 reuse 67 974 Index Reverse method of class Array 821 Reversing Digits exercise 281 RichTextBox control 61 right brace, } 71, 82, 156, 164 right child 769 right justify output 198 right subtree 769, 775 RightToLeft property of class MenuStrip 574 rise-and-shine algorithm 143 Ritchie, Dennis 13 robust 84 robust application 487 Roll a six-sided die 6,000,000 times 295 Roll a six-sided die 6000 times 247 rolling two dice 253 root node 598, 769 root node, create 600 round a floating-point number for display purposes 165 rounding a number 86, 158, 199, 235, 278 Rounding to a Specific Decimal Place exercise 278 Rounding to Nearest Integer exercise 278 row objects 856 row of a database table 851 rows of a two-dimensional array 316 rules for forming structured applications 218 rules of operator precedence 87 Run command in Windows 586 run mode 56 run-time logic error 84 running an app 586 running total 160 runtime system 799 S SalariedEmployee class that extends Employee 454, 473 Salary Calculator exercise 184 Sales Commission Calculator exercise 183 Sales Commissions exercise 337 SaveChanges method of a LINQ to Entities DbContext 857, 869 SaveFileDialog class 689 saving changes back to a database in LINQ to Entities 869 savings account 197 SavingsAccount Class (exercise) 402 sbyte simple type 952 SByte struct 747 scaling factor (random numbers) 246, 249, 250 scanning images schema (database) 852 scope 193 static variable 391 Scope class demonstrates instance and local variable scopes 256 scope of a declaration 255 scope of a type parameter 802 screen 2, 6, 28, 30 screen cursor 71, 78, 79 screen-manager program 444 scrollbar 45 ScrollBars property of class TextBox 534 scrollbox 45 SDI (Single Document Interface) 614 sealed class 466 keyword 466 method 466 Search Algorithms binary search 721 linear search 717 recursive binary search 744 recursive linear search 744 search key 716 searching 747 Searching Algorithms binary search 721 linear search 717 recursive binary search 744 recursive linear search 744 searching data 716 Searching for characters and substrings in strings 647 second-degree polynomial 89 second refinement 160, 168 secondary storage secondary storage device 670 secondary storage unit seed value (random numbers) 245, 250 Seek method of class FileStream 701 SeekOrigin enumeration 701 select clause of a LINQ query 356 Select method of class Control 530 Select Resource dialog 54 selected state 542 SelectedImageIndex property of class TreeNode 599 SelectedIndex property of class ComboBox 595 SelectedIndex property of class ListBox 588 SelectedIndex property of class TabControl 611 SelectedIndexChanged event handler ComboBox class 873 SelectedIndexChanged event of class ComboBox 595 SelectedIndexChanged event of class ListBox 587 SelectedIndexChanged event of class TabControl 611 SelectedIndices property of class ListBox 588 SelectedItem property of class ComboBox 595 SelectedItem property of class ListBox 588 SelectedItems property of class ListBox 588 SelectedItems property of class ListView 604 SelectedNode property of class TreeView 599 SelectedTab property of class TabControl 611 selecting an item from a menu 522 selecting data from a table 852 selection 146, 218, 219 selection sort algorithm 726, 727, 730 selection statement 144, 146 if 146, 147, 201, 220, 221 if else 146, 148, 163, 201, 220 switch 146, 201, 207, 220 SelectionEnd property of class MonthCalendar 580 SelectionMode enumeration 587 MultiExtended value 587 MultiSimple value 587 None value 587 One value 587 SelectionMode property of class CheckedListBox 592 SelectionMode property of class ListBox 587, 588 SelectionRange property of class MonthCalendar 580 SelectionStart property of class MonthCalendar 580 self-documenting code 83 self-referential class 748, 749 Self-referential Node class declaration 748 self-referential object 749 semicolon (;) 71, 82, 93 send a message to an object 124 sentinel-controlled repetition 158, 160, 161, 228, 163, 164, 346 sentinel value 159, 160, 164 Separating Digits exercise 280 separator bar 573 sequence 218, 219, 769 sequence of items 749 sequence statement 144 sequence structure 145 sequence-structure activity diagram 145 sequential-access file 685 sequential execution 144 sequential file 672 created using serialization 703 read using deserialzation 707 [Serializable] attribute 702 SerializationException class 703 Serialize method of class BinaryFormatter 701, 703 serialized object 701, 702 service of a class 376 session 926 session item 931 Session property of Page class 929 session tracking 926, 927 SessionID property of HttpSessionState class 931 set accessor of a property 108, 118, 121 Set as Startup Project 863 set keyword 119 Set of Integers (exercise) 403 set-theoretic intersection 403 set-theoretic union 403 shallow copy 435 Shape class hierarchy 408, 439 Shape Hierarchy exercise 484 shift 246 Shift key 556 Shift property of class KeyEventArgs 557, 559 Shifted and scaled random integers 246 shifting value (random numbers) 246, 249, 250 “shipping” section of the computer shopping list 152 Index short-circuit evaluation 212 short simple type 952 Short value of enumeration DateTimePickerFormat 580 shortcut key 570 ShortcutKeyDisplayString property of class ToolStripMenuItem 571, 574 ShortcutKeys property of class ToolStripMenuItem 571, 574 shortcuts with the & symbol 573 Show All Files icon 43 Show method of class Control 530 Show method of class Form 522, 614, 620 ShowCheckBox property of class DateTimePicker 581 ShowDialog method of class OpenFileDialog 695, 701 ShowDialog method of class SaveFileDialog 690 ShowShortcutKeys property of class ToolStripMenuItem 571, 574 ShowUpDown property of class DateTimePicker 581 shuffling 299 Fisher-Yates 302 sibling 769 sibling node 598 side effect 213, 266 Sides of a Right Triangle exercise 187 Sides of a Triangle exercise 187 Sieve of Eratosthenes 342 Sieve of Eratosthenes exercise 342 signal value 159 signature of a method 259 simple condition 211 simple name 522, 623 simple type 83, 174, 242 Simple Types bool 952 byte 952 char 83, 952 decimal 83, 128, 953 double 83, 128, 162, 953 float 83, 128, 952 int 82, 83, 162, 171, 952 long 952 names are keywords 83 sbyte 952 short 952 table of 952 uint 952 ulong 952 ushort 952 Simple value of enumeration ComboBoxStyle 595 simplest activity diagram 218 Simpletron Machine Language (SML) 344 Simpletron simulator 347, 349 Simpletron Simulator Modifications exercise 349 simulation coin tossing 281 Simulation: Tortoise and the Hare exercise 343 simulator 344 terminate a running app 22, 27 Sin method of Math 235 sine 235 Single Document Interface (SDI) 614 single entry point 216 single-entry/single-exit control statements 146, 218 single exit point 216 single inheritance 406 single-precision floating-point number 128 single-selection statement 146, 147, 220 Single struct 747 single-line comment 66 single-selection statement if 147 singly linked list 760 size 85 Size property of class Control 532 Size structure 532 Height property 532 Width property 532 SizeMode property of class PictureBox 54, 547 sizing handle 48 sizing handle, enabled 48 sln file extension 54 smallest of several integers 227 SmallImageList property of class ListView 604 smart tag menu 871, 917 SMS Language 668 snap lines 533 software software engineering encapsulation 122 Software Engineering Observations overview xxxiv software model 346 software reuse 233, 406, 623 software simulation 344 solid circle 145 solid circle surrounded by a hollow circle 145 SolidBrush class 556 solution 20, 23, 36 Solution Explorer window 43 Some methods of class ArrayList 822 Sort Algorithms bubble sort 743, 744 bucket sort 744 insertion sort 730 merge sort 734 quicksort 745 selection sort 726 sort key 716 Sort method of Array 722 Sort method of class Array 820 Sort method of class ArrayList 823 Sort method of class List 363 sorted array 751 Sorted property of class ComboBox 595 Sorted property of class ListBox 588 SortedDictionary generic class 817, 834, 835 SortedList generic class 817 SortedSet class 842 sorting 747 Sorting Algorithms bubble sort 743, 744 bucket sort 744 975 Sorting Algorithms (cont.) insertion sort 730 merge sort 734 quicksort 745 selection sort 726 sorting data 716, 726 Sorting Letters and Removing Duplicates exercise 370 source code 434 Source property of Exception 506 space character 68 space/time trade-off 829 spacing convention 70 Spam Scanner 668 speaking to a computer special character 83, 640 Special Section: Building Your Own Computer 344 special symbol 3, 670 sphere 275 Split method of class Regex 832 Split method of class String 370, 695 split the array in merge sort 734 spooler 766 spooling 766 SQL 352, 850 SQL Server 850 SQL Server Express 859 SQL Server Express 2012 LocalDB 850 Sqrt method of class Math 511 Sqrt method of Math 234, 235, 242 square brackets, [] 286 Square of Asterisks exercise 186 square root 235 stack 241, 282, 394, 762, 799 Stack class 817, 826 stack data structure 747 stack frame 241 Stack generic class 799, 817 Stack< double> 808 Stack 808 stack overflow 242 stack trace 490 stack unwinding 506 Stack unwinding and Exception class properties 506 StackComposition class encapsulates functionality of class List 765 stacked building block 221 stacking control statements 147, 221 stacking rule 218 StackOverflowException class 496 StackTrace property of Exception 505, 506, 509 standard error stream object 673 standard input stream object 672 standard input/output object 71 standard output stream object 673 standard reusable component 407 standard time format 374 “warehouse” section of the computer Start method of class Process 586 Start Page 34 start page for a web application 911, 914, 919, 928, 935 StartsWith and EndsWith methods 646 StartsWith method of class string 366, 645 976 Index startup project 43 state button 539 stateless protocol 925 statement 71, 110 empty 93 if 90 statements 160 break 205, 209, 229 continue 209, 229, 230 control statements 144, 146 control-statement nesting 146 control-statement stacking 146 while 146, 199, 201, 221 double selection 146, 167 empty statement 152 for 146, 191, 192, 194, 195, 196, 198, 221 if 146, 147, 201, 220, 221 if else 146, 148, 163, 201, 220 iteration 146 multiple selection 146 nested 166 nested if else 149, 150, 151 repetition 144, 146, 152 return 233, 241 selection 144, 146 single selection 146 switch 146, 201, 207, 220 switch multiple-selection statement 249 throw 373, 502 try 298, 495 using 504 while 146, 152, 153, 157, 163, 221 static class member 390 method 111, 198 variable 390, 391 static binding 466 Static member demonstration 392 static method cannot access nonstatic class members 393 static method Concat 650 static variable scope 391 Static variable used to maintain a count of the number of Employee objects in memory 391 stereotype in the UML 121 straight-line form 87 stream standard error 673 standard input 672 standard output 673 Stream class 673 stream of bytes 672 StreamReader class 673 StreamWriter class 673 StretchImage value 54 string 71, 244 literal 71 of characters 71 verbatim 640 string verbatim 586 string array 288 String class Split method 370, 695 string class 639 Concat method 650 constructors 641 string class (cont.) CopyTo method 642 EndsWith method 645, 646 Equals method 643 Format method 374 immutable 642 IndexOf method 646 IndexOfAny method 646 LastIndexOf method 646, 648 LastIndexOfAny method 646, 649 Length property 642, 643 method ToCharArray 404 method ToLower 832 method ToUpper 840 Replace method 651, 652 StartsWith method 366, 645 Substring method 649 ToLower method 651, 652 ToUpper method 366, 651, 652 Trim method 651, 652 verbatim string literal 240 String Collection Editor in Visual Studio NET 589 string concatenation 239, 392 string constant 640 string constructors 641 string format specifiers 132 string indexer 643 string indexer, Length property and CopyTo method 642 string literal 640 string.Empty 124 StringBuilder class 639, 652 Append method 655 AppendFormat method 656 Capacity property 653 constructors 653 EnsureCapacity method 653 Length property 653 Remove method 657 Replace method 659 ToString method 653 StringBuilder constructors 652 StringBuilder size manipulation 653 StringBuilder text replacement 659 strongly typed languages 174 Stroustrup, Bjarne 487 struct 748 struct 747 Boolean 747 Byte 747 Character 747 DateTime 629 Decimal 747 Double 747 Int16 747 Int32 747 Int64 747 Single 747 UInt16 747 UInt64 747 struct keyword 660 Structs UInt32 747 Structured Equivalent of break Statement exercise 229 Structured Equivalent of continue Statement exercise 230 structured programming 143, 144, 210, 218 summary 216 Structured Query Language (SQL) 850 Structures BigInteger 404 Student Poll exercise 714 Style property of class Font 541 subarray 721 submenu 570 Substring method of class string 649 substrings generated from strings 649 subtraction 6, 87 summarizing responses to a survey 296 summing integers with the for statement 196 suspended app 27, 29 swapping values 726, 730 switch code snippet (IDE) 255 switch expression 205 switch keyword 205 switch logic 209 switch multiple-selection statement 146, 201, 207, 220, 249 activity diagram with break statements 208 case label 205, 206 controlling expression 205 default label 205, 249 Sybase 850 synchronous programming 13 syntax 67 syntax error 67, 71, 76 syntax error underlining 77 syntax-color highlighting 73 System namespace 68, 245, 639 System.Collections namespace 244, 762, 796, 815 System.Collections.Concurrent namespace 815 System.Collections.Generic namespace 244, 362, 681, 815, 835 System.Collections.Specialized namespace 815 System.Data.Entity namespace 244, 857 System.Diagnostics namespace 586 System.Drawing namespace 541 System.IO namespace 244, 673 System.Linq namespace 244, 353, 857 System.Runtime.Serialization.F ormatters.Binary namespace 701 System.Text namespace 244, 639 System.Text.RegularExpressions namespace 639 System.Web namespace 244 System.Web.UI namespace 913 System.Web.UI.WebControls namespace 913 System.Windows.Controls namespace 244 System.Windows.Forms namespace 244, 521 System.Windows.Input namespace 244 System.Windows.Media namespace 244 System.Windows.Shapes namespace 244 Index System.Xml namespace 244 System.Xml.Linq namespace 244 SystemException class 496, 511 T tab 520 tab character, \t 68, 79 Tab key 70 tab stops 70, 79 Tabbed pages in Visual Studio NET 610 tabbed window 38 TabControl class 609 ImageList property 611 ItemSize property 611 Multiline property 611 SelectedIndex property 611 SelectedIndexChanged event 611 SelectedTab property 611 TabCount property 611 TabPages property 610, 611 TabControl with TabPages example 610 TabControl, adding a TabPage 611 TabCount property of class TabControl 611 TabIndex property of class Control 530 table 316, 851 table element 316 table of simple types 952 table of values 316 TabPage class 609 Text property 610 TabPage, add to TabControl 610 TabPage, using radio buttons 613 TabPages added to a TabControl 611 TabPages property of class TabControl 610, 611 TabStop property of class Control 530 tabular format 290 Tabular Output exercise 184 tail of a queue 747, 766 Tan method of Math 235 tangent 235 Target property of a HyperLink control 918 Target-Heart-Rate Calculator 141 TargetSite property of Exception 506 Tax Plan Alternatives 230 TCP (Transmission Control Protocol) 11 TCP/IP 11 TEAM menu 40 Telephone-Number Word Generator exercise 713 template 36 temporary 164 temporary data storage 670 terabyte terminate a loop 160 terminate an app running in the simulator 22, 27 termination housekeeping 390 termination model of exception handling 495 termination phase 159 ternary operator 149 test harness 316 Testing class BasePlusCommissionEmployee 419, 426, 432 Testing class CommissionEmployee 414 Testing class List 755 Testing class QueueInheritance 768 Testing class StackInheritance 763 Testing class Tree with a binary tree 773 Testing class Tree with IComparable objects 780 Testing generic class Stack 802, 806 Testing the insertion sort class 733 Testing the merge sort class 738 Testing the selection sort class 729 Tests interface IPayable with disparate classes 475 text editor 71, 639 Text property 48, 52 Text property of class Button 534 Text property of class CheckBox 539 Text property of class Control 530 Text property of class Form 522 Text property of class GroupBox 536 Text property of class LinkLabel 584 Text property of class RadioButton 542 Text property of class TabPage 610 Text property of class TextBox 534 Text property of class ToolStripMenuItem 574 Text property of class TreeNode 599 TextAlign property of a Label 53 TextBlock control 24 textbox 533 TextBox ASP.NET web control 916 TextBox control 63, 520, 533 AcceptsReturn property 534 Multiline property 534 ReadOnly property 534 ScrollBars property 534 Text property 534 TextChanged event 534 UseSystemPasswordChar property 533 TextChanged event of class TextBox 534 Text-displaying application 67 TextReader class 673 TextWriter class 673 ThenBy extension method of class Queryable 868 this keyword 377, 393 reference 377 to call another constructor of the same class 382 this used implicitly and explicitly to refer to members of an object 378 ThreeDimensionalShape 439 ThreeState property of class CheckBox 539 throw an exception 298, 298, 373, 382, 488, 493 throw point 490, 495 throw statement 502 throws an exception 373 Tick event of class Timer 628 TicTacToe 404 exercise 404 977 tier in a multitier application 900 tightly packed binary tree 776 tile 17 tiled window 616 TileHorizontal value of enumeration MdiLayout 616 TileVertical value of enumeration MdiLayout 616 time and date 629 Time value of enumeration DateTimePickerFormat 580 Time1 class declaration maintains the time in 24-hour format 372 Time1 object used in an app 375 Time2 class declaration with overloaded constructors 380 TimeOfDay property of DateTime 580 Timeout property of HttpSessionState class 931 Timer class 628 Interval property 628 Tick event 628 title bar 48 title bar, MDI parent and child 616 Title property of a Web Form 908 Titles table of Books database 852, 853 ToCharArray method of class string 404 ToDecimal method of class Convert 133 ToInt32 method of class Convert 84, 91, 330 tokenize a string 695 ToLongDateString method of structure DateTime 583 ToLongTimeString method of structure DateTime 629 ToLower method of class string 651, 652, 832 ToLower method of struct Char 662 tool bar 519 tool tip 41 toolbar 40 toolbar icon 40 Toolbox 44, 908 TOOLS menu 40 ToolStripMenuItem class 571 Checked property 574, 578 CheckOnClick property 574 Click event 573, 574 ShortcutKeyDisplayString property 571, 574 ShortcutKeys property 571, 574 ShowShortcutKeys property 571, 574 Text property 574 ToolStripMenuItem properties and an event 574 ToolTip class 549 AutoPopDelay property 550 Draw event 550 InitialDelay property 550 ReshowDelay property 550 ToolTip properties and events 550 top 159 top-down, stepwise refinement 159, 160, 161, 167, 168 top of a stack 747 top tier 901 978 Index Tortoise and the Hare exercise 343 Tortoise and the Hare simulation 343 ToString method of an anonymous type 877 ToString method of class Exception 509 ToString method of class object 413, 435 ToString method of class StringBuilder 653, 655 total 154, 160 Total Sales exercise 338 ToUpper method of class string 366, 651, 652, 840 ToUpper method of struct Char 662 Towers of Hanoi exercise 282 trace 805 TrackBar control 64 tracking customers 925 transfer of control 144, 346, 347, 348 transition 145 transition arrow 145, 147, 153 translation translator program Transmission Control Protocol (TCP) 11 traversals forwards and backwards 761 traverse a tree 775 traverse an array 319 tree 598, 769 TreeNode class 598, 599 Checked property 599 Collapse method 599 Expand method 600 ExpandAll method 600 FirstNode property 599 FullPath property 599 GetNodeCount method 600 ImageIndex property 599 LastNode property 599 NextNode property 599 Nodes property 599 PrevNode property 599 SelectedImageIndex property 599 Text property 599 TreeNode Editor 600 TreeNode properties and methods 599 TreeNodeCollection class 598 TreeView class 570, 598 AfterSelected event 599 CheckBoxes property 599 ImageList property 599 Nodes property 599 SelectedNode property 599 TreeView displaying a sample tree 598 TreeView properties and an event 599 TreeView used to display directories 601 TreeViewEventArgs class 599 trigger an event 520 trigonometric cosine 235 trigonometric sine 235 trigonometric tangent 235 Trim method of class string 651 TrimExcess method of class List 363 TrimToSize method of class ArrayList 822, 823 true 90, 148, 149 truncate 86, 158 truth table 211 truth tables for operator ^ 213 for operator ! 214 for operator && 211 for operator || 212 try block 298, 493 try statement 298, 495 TryParse method of structure Int32 493 Turing Machine 144 Turtle Graphics exercise 339 24-hour clock format 372 two-dimensional array 316 two-dimensional data structure 769 two largest values 184 TwoDimensionalShape class 439 type 82, 83, 85 type argument 794, 795, 802 type checking 790 Type class 435, 464 FullName property 435 type constraint 796 specifying 796 type inference 795 type parameter 794, 799, 808 scope 802 type parameter list 794, 799 typesetting system 639 typing in a TextBox 522 Typing Tutor: Tuning a Crucial Skill in the Computer Age exercise 568 Uniform Resource Locator (URL) 899 union of two sets 403 unique session ID of an ASP.NET client 931 universal-time format 372, 373, 374 unmanaged resource 477 unnecessary parentheses 90 unobtrusive validation 924 unqualified name 243, 255, 522, 623 unwind a method from the call stack 508 UpDownAlign property of class NumericUpDown 552 upper camel casing 69 uppercase letter 69, 83 URI (Uniform Resource Identifier) 899 URL (Uniform Resource Locator) 899 UseMnemonic property of class LinkLabel 584 user-defined classes 68 user interface 901 UserControl control 627 UserControl defined clock 628 user-defined exception class 509 user-defined method 233 user-defined method Maximum 237 UseSystemPasswordChar property of class TextBox 533 ushort simple type 952 using directive 67, 116, 243 utility method 207 U valid identifier 82 Validate property of Page class 924 Validating User Input exercise 184 validation 130 validation control 918 ValidationExpression property of a uint simple type 952 UInt16 struct 747 UInt32 struct 747 UInt64 struct 747 ulong simple type 952 UML activity diagram 145, 147, 153, 200 arrow 145 class diagram 112 diamond 147 dotted line 145 final state 145 guard condition 147 merge symbol 153 modeling properties 121 note 145 solid circle 145 solid circle surrounded by a hollow circle 145 stereotype 121 UML (Unified Modeling Language) 10 UML class diagram 407 unary cast operator 164 unary operator 165, 213 UnauthorizedAccessException class 603 unboxing conversion 748 uncaught exception 494 uneditable text or icons 520 unhandled exception 490, 494 Unicode® character set 4, 175, 208, 640, 671 Unified Modeling Language (UML) 10 Uniform Resource Identifier (URI) 899 V RegularExpressionValidator control 922 validator 918 validity checking 130 value 85 value contextual keyword 119 Value property of class DateTimePicker 580, 581, 583 Value property of class LinkedListNode 836 Value property of class NumericUpDown 552 value to the nearest integer 278 value type 123, 286 value type constraint struct 798 ValueChanged event of class DateTimePicker 581 ValueChanged event of class NumericUpDown 552 Values property of class Hashtable 833 ValueType class 660, 748 var keyword 355 variable 81, 82 declaration statement 82 name 82, 85 variable is not modifiable 394 variable-length argument list 327 Variable-Length Argument List exercise 337 Index variable scope 193 verbatim string 586 verbatim string 640 verbatim string literal 240 verbatim string syntax(@) 640 VIEW menu 39, 41 View property of class ListView 603, 604 virtual keyword 423 virtual directory 900 virtual goods 18 virtual machine (VM) 15, 30 visibility symbols in the UML 112, 121 Visible property of an ASP.NET web control 921 Visible property of class Control 530 VisitedLinkColor property of class LinkLabel 584 visual app development 34 Visual Basic 14 visual programming 521 Visual Studio 19 component tray 550 IDE (integrated development environment) 19 Visual Studio NET Class View 396 Visual Studio NET Object Browser 396 Visual Studio Express 2012 for Web 898 Visual Studio® 2012 34 void keyword 71, 109 volatile information volume of a sphere 275, 277 W W3C (World Wide Web Consortium) 11 waiting line 747 walk the list 760 Web app development 898 web control 898 Web Form 898, 905, 926, 932 Init event 911 Load event 923 web server 899 Web.config ASP.NET configuration file 912 WebTime Modification exercise 947 What Does This Code Do? exercise 227, 230, 283 What Does This Program Do? exercise 182, 184, 185 What’s Wrong with This Code? exercise 187 where clause 797 where clause of a LINQ query 356 Where extension method of class Queryable 873 while keyword 199 while repetition statement 146, 152, 153, 157, 163, 221 activity diagram in the UML 153 whitespace 68, 71, 93 characters 68 whitespace character (regular expressions) 652 widget 520 Width property of structure Size 532 window auto hide 42 window gadget 520 WINDOW menu 40 window tab 38 Windows Font 52 Properties 44, 45, 48, 52 Solution Explorer 43 Windows 17 Windows UI 16, 17, 23 Windows Azure 19, 30 Windows bitmap (BMP) 54 Windows Explorer 586 Windows Form 520 Windows Forms app 36 979 Windows operating system 16 Windows Phone 16 Windows Phone operating system 17, 29 Windows Phone Dev Center 18 Windows Phone Emulator 18, 28 Windows Phone Marketplace 18 Windows Phone operating system 17, 28 Windows Store 17 Windows Store developer 17 word processor 639, 646 workflow 145 World Population Growth 187 World Wide Web 11 World Wide Web Consortium (W3C) 11 worst-case run time for an algorithm 720 Write method of class Console 78, 673 WriteLine method of class Console 71, 78, 673 WriteLine method of class StreamWriter 690 www.deitel.com/LINQ/ 367 www.unicode.org 671 X X format specifier 132 X property of class MouseEventArgs 554 XOR bitwise operator 579 Y Y property of class MouseEventArgs 554 Z zero-based counting 192 zeroth element 287 [...]... available to qualified instructors only through Pearson Education’s Instructor Resource Center (www.pearsonhighered.com/irc): • Solutions Manual contains solutions to most of the end-of-chapter exercises We’ve added many Making a Difference exercises, most with solutions Please do not write to us requesting access to the Pearson Instructor’s Resource Center Access is restricted to college instructors teaching... Sorting • Chapter 19, Data Structures • Chapter 20, Generics • Chapter 21, Collections introduce searching, sorting and data structures Most C# programmers should use NET’s built-in searching, sorting and collections (prepackaged data structures) capabilities, which are discussed in Chapter 21 For instructors who wish to present how to implement customized searching, sorting and data structures capabilities,... with async and await in Chapter 28 Object-Oriented Programming • Early-objects approach The book introduces the basic concepts and terminology of object technology in Chapter 1 In Chapter 2, Dive Into Visual Studio 2012 Express for Windows Desktop, you’ll visually manipulate objects, such as labels and images In Chapter 3, Introduction to C# Apps, you’ll write Visual C# program code Complete Code Examples... italics for emphasis Objectives The chapter objectives preview the topics covered in the chapter Programming Tips We include programming tips to help you focus on important aspects of program development These tips and practices represent the best we’ve gleaned from a combined seven decades of programming and teaching experience Good Programming Practice The Good Programming Practices call attention to. .. Visual C# 2012 How to Program, 5/e contains a rich collection of examples We concentrate on building good software and stress program clarity Live-Code Approach The book is loaded with “live-code” examples Most new concepts are presented in the context of complete working Visual C# apps, followed by one or more executions showing program inputs and outputs In the few cases where we show a code snippet, to. .. www.pearsonhighered.com/deitel/ 2 Scroll to Visual C# 2012 How to Program, 5/e and click Companion Website 3 Click the Register button 4 On the registration page, enter your student access code found beneath the scratch-off panel on the inside front cover of this book Do not type the dashes You can use lower- or uppercase The access code can be used only once This subscription is valid for twelve months upon activation and is... Introduction Collections Overview Class Array and Enumerators Nongeneric Collections 21.4.1 Class ArrayList 21.4.2 Class Stack 21.4.3 Class Hashtable Generic Collections 21.5.1 Generic Class SortedDictionary 21.5.2 Generic Class LinkedList Covariance and Contravariance for Generic Types Wrap-Up 22 Databases and LINQ 21.5 22.1 22.2 22.3 22.4 22.5 Introduction Relational Databases A Books Database LINQ to. .. sequential-access files Recursive Factorial method REST Web services with JSON and XML SalariedEmployee class Searching directories with LINQ Sequential search Sorting an array Stack unwinding TabControl NumericUpDown class Text -to- speech and speech-totext Time class Toolbars TreeView control TV GUI showing GUI customization Poll analysis Polymorphism demonstration Querying a database with LINQ to Entities... Azure™ Cloud Computing App Windows Azure is a cloud computing platform that allows you to develop, manage and distribute your apps in the cloud Chapter 31 shows you how to build a Windows Azure app that can store data in the cloud • Asynchronous programming with async and await Asynchronous programming is simplified in Visual C# 2012 with the new async and await capabilities We introduce asynchronous programming... Index We’ve included an extensive index for reference Defining occurrences of key terms in the index are highlighted with a bold page number Obtaining the Software Used in Visual C# How to Program, 5/e We wrote the code examples in Visual C# 2012 How to Program, 5/e using Microsoft’s free Visual Studio Express 2012 products, including: • Visual Studio Express 2012 for Windows Desktop (Chapters 1–24,

Ngày đăng: 30/10/2015, 17:52

Từ khóa liên quan

Mục lục

  • Cover

  • Title Page

  • Copyright Page

  • Contents

  • Preface

  • Before You Begin

  • 1 Introduction to Computers, the Internet and Visual C#

    • 1.1 Introduction

    • 1.2 Hardware and Moore’s Law

    • 1.3 Data Hierarchy

    • 1.4 Computer Organization

    • 1.5 Machine Languages, Assembly Languages and High-Level Languages

    • 1.6 Object Technology

    • 1.7 Internet and World Wide Web

    • 1.8 C#

      • 1.8.1 Object-Oriented Programming

      • 1.8.2 Event-Driven Programming

      • 1.8.3 Visual Programming

      • 1.8.4 An International Standard; Other C# Implementations

      • 1.8.5 Internet and Web Programming

      • 1.8.6 Introducing async/await

      • 1.8.7 Other Key Contemporary Programming Languages

Tài liệu cùng người dùng

Tài liệu liên quan