Transcription of Deitel® Series Page
1 D e i tel Se r ies Page How To Program Series C How to Program, 6/E. C++ How to Program, 7/E. Java How to Program, 8/E, Early Objects Version Java How to Program, 8/E, Late Objects Version Internet & World Wide Web How to Program, 4/E. visual Basic 2008 How to Program visual C# 2008 How to Program, 3/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 Application-Driven Simply C#: An Application-Driven Tutorial Approach Tutorial Approach Simply Java programming : An Simply visual Basic 2008, 3/E: An Application-Driven Tutorial Application-Driven Tutorial Approach Approach CourseSmart Web Books C++ How to Program, 5/E, 6/E & 7/E Small C++ How to Program, 5/E. Java How to Program, 6/E, 7/E & 8/E Small Java How to Program, 6/E. Simply C++: An Application-Driven visual Basic 2008 How to Program Tutorial Approach visual C# 2008 How to Program, 3/E.
2 Simply visual Basic 2008: An Application-Driven Tutorial Approach, 3/E. Deitel Developer Series AJAX, Rich Internet Applications and iPhone for Programmers: Web Development for Programmers An App-Driven Approach C++ for Programmers Java for Programmers C# 2008 for Programmers, 3/E Javascript for Programmers LiveLessons Video Learning Products Java Fundamentals Parts 1 and 2 C++ Fundamentals Parts 1 and 2. C# Fundamentals Parts 1 and 2 JavaScript Fundamentals Parts 1 and 2. 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: follow us on Twitter . @deitel and Facebook . To communicate with the authors, send e-mail to: For information on government and corporate Dive-Into Series on-site seminars offered by Deitel & Associates, Inc.
3 Worldwide, visit: or write to For continuing updates on Prentice Hall/Deitel publications visit: Check out our Resource Centers for valuable web resources that will help you master Java, other important programming languages, software and Internet- and web-related topics: Library of Congress Cataloging-in-Publication Data On file Vice President and Editorial Director, ECS: Marcia J. Horton Editor-in-Chief, Computer Science: Michael Hirsch Associate Editor: Carole Snyder Supervisor/Editorial Assistant: Dolores Mars Director of Team-Based Project Management: Vince O'Brien Senior Managing Editor: Scott Disanno Managing Editor: Robert Engelhardt A/V Production Editor: Greg Dulles Art Director: Kristine Carney Cover Design: Abbey S. Deitel, Harvey M. Deitel, Francesco Santalucia, Kristine Carney Interior Design: Harvey M. Deitel, Kristine Carney Manufacturing Manager: Alexis Heydt-Long Manufacturing Buyer: Lisa McDowell Director of Marketing: Margaret Waples Marketing Manager: Erin Davis 2010 by Pearson Education, Inc.
4 Upper Saddle River, New Jersey 07458. 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 pub- lisher 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 dam- ages in connection with, or arising out of, the furnishing, performance, or use of these programs. Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks and registered trademarks. Where those designations appear in this book, and Prentice Hall and the authors were aware of a trademark claim, the designations have been printed in initial caps or all caps.
5 All product names mentioned remain trademarks or registered trademarks of their respective owners. All rights reserved. No part of this book may be reproduced, in any form or by any means, without permission in writing from the publisher. Printed in the United States of America 10 9 8 7 6 5 4 3 2 1. ISBN-10: 0-13-612356-2. ISBN-13: 978-0-13-612356-9. Pearson Education Ltd., London Pearson Education Australia Pty. Ltd., Sydney Pearson Education Singapore, Pte. Ltd. Pearson Education North Asia Ltd., Hong Kong Pearson Education Canada, Inc., Toronto Pearson Educaci n de Mexico, de Pearson Education Japan, Tokyo Pearson Education Malaysia, Pte. Ltd. Pearson Education, Inc., Upper Saddle River, New Jersey P. J. Deitel Deitel & Associates, Inc. H. M. Deitel Deitel & Associates, Inc. Upper Saddle River, New Jersey 07458. Trademarks DEITEL, the double-thumbs-up bug and DIVE INTO are registered trademarks of Deitel and Associates, Inc.
6 Microsoft, visual C++, Internet Explorer and the Windows logo are either registered trademarks or trade- marks of Microsoft Corporation in the United States and/or other countries. In Memory of Clifford Stephens: Your friendship, bright smile and infectious laugh will be truly missed. Paul and Harvey Deitel Deitel Resource Centers Our Resource Centers focus on the vast amounts of free content available online. Find resources, downloads, tutorials, documentation, books, e-books, journals, articles, blogs, RSS feeds and more on many of today's hottest programming and technology topics. For the most up-to-date list of our Resource Centers, visit: Let us know what other Resource Centers you'd like to see! Also, please register for the free Deitel . Buzz Online e-mail newsletter at: Computer Science UML Java Design Patterns Open Source Functional programming visual Basic Java EE 5 Search Engines Regular Expressions visual C++ Java SE 6 SharePoint visual Studio Team Sys- Java SE 7 (Dolphin) Skype programming tem Resource Center Web Servers Web 3D Technologies JavaFX Wikis Adobe Flex Web Services Windows Vista Ajax Windows Presentation Microsoft Apex Foundation Web Ajax XHTML Alert Services XML Ajax Attention Economy C C# Blogging Apple DotNetNuke (DNN) Building Web C++.
7 C++ Boost Libraries iPhone Internet Explorer 7 (IE7) Communities C++ Game programming Objective-C Microsoft LINQ Community Generated C# Cocoa .NET Content Code Search Engines and .NET Facebook Developer Games and Game .NET Platform Code Sites programming Computer Game SharePoint Facebook Social Ads Computer Game Pro- Silverlight Google Base programming gramming CSS visual Basic Google Video Computer Games visual C++ Google Web Toolkit Dojo Mobile Gaming Facebook Developer Plat- visual Studio Team (GWT). Sudoku System Internet Video form Flash 9 Internet Business Windows Presentation Joost Functional programming Foundation Location-Based Services Affiliate Programs Windows Vista Mashups Java Competitive Analysis Java Certification and Microsoft Popfly Microformats Facebook Social Ads Recommender Systems Assessment Testing Google AdSense Java Design Patterns Open Source & RSS.
8 Google Analytics LAMP Stack Social Graph Java EE 5 Google Services Java SE 6 Apache Social Media Internet Advertising DotNetNuke (DNN) Social Networking Java SE 7 (Dolphin) Internet Business Resource Center Eclipse Software as a Service Initiative Firefox (SaaS). JavaFX Internet Public Relations JavaScript Linux Virtual Worlds Link Building MySQL Web JSON Location-Based Services Microsoft LINQ Open Source Web Online Lead Generation Perl Widgets Microsoft Popfly Podcasting .NET PHP. Search Engine Optimiza- Python Dive Into Web .NET tion .NET Ruby eBook Selling Digital Content OpenGL Web 2 eBook Sitemaps Software Perl Web Analytics PHP Apache Other Topics Website Monetization DotNetNuke (DNN). programming Projects Computer Games YouTube and AdSense Eclipse Python Computing Jobs Regular Expressions Java Firefox Gadgets and Gizmos Ruby Internet Explorer 7 (IE7) Ring Tones Java Ruby on Rails Linux Sudoku Java Certification and Silverlight MySQL.
9 Assessment Testing Contents Appendices E through I are PDF documents posted online at the book's Companion Website (located at ). Preface xxi 1 Introduction to Computers, the Internet and the Web 1. Introduction 2. Computers: Hardware and Software 3. Computer Organization 4. Personal, Distributed and Client/Server Computing 5. The Internet and the World Wide Web 5. Machine Languages, Assembly Languages and High-Level Languages 6. History of C 7. C Standard Library 8. C++ 9. Java 9. Fortran, COBOL, Pascal and Ada 10. BASIC, visual Basic, visual C++, C# and .NET 10. Key Software Trend: Object Technology 11. Typical C Program Development Environment 12. Hardware Trends 14. Notes About C and This Book 15. Web Resources 16. 2 Introduction to c programming 23. Introduction 24. A Simple C Program: Printing a Line of Text 24. Another Simple C Program: Adding Two Integers 28.
10 Memory Concepts 33. Arithmetic in C 34. Decision Making: Equality and Relational Operators 38. 3 Structured Program Development in C 54. Introduction 55. Algorithms 55. x Contents Pseudocode 55. Control Structures 56. The if Selection Statement 58. The if else Selection Statement 59. The while Repetition Statement 63. Formulating Algorithms Case Study 1: Counter-Controlled Repetition 64. Formulating Algorithms with Top-Down, Stepwise Refinement Case Study 2: Sentinel-Controlled Repetition 66. Formulating Algorithms with Top-Down, Stepwise Refinement Case Study 3: Nested Control Structures 73. Assignment Operators 77. Increment and Decrement Operators 78. 4 C Program Control 97. Introduction 98. Repetition Essentials 98. Counter-Controlled Repetition 99. for Repetition Statement 100. for Statement: Notes and Observations 103. Examples Using the for Statement 103.