ebook img

Beginning Programming PDF

481 Pages·2005·12.146 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Beginning Programming

01_584065 ffirs.qxd 3/7/05 7:17 PM Page i Beginning Programming TEAM LinG - Live, Informative, Non-cost and Genuine ! 01_584065 ffirs.qxd 3/7/05 7:17 PM Page ii TEAM LinG - Live, Informative, Non-cost and Genuine ! 01_584065 ffirs.qxd 3/7/05 7:17 PM Page iii Beginning Programming Adrian and Kathie Kingsley-Hughes TEAM LinG - Live, Informative, Non-cost and Genuine ! 01_584065 ffirs.qxd 3/7/05 7:17 PM Page iv Beginning Programming Published by Wiley Publishing, Inc. 10475 Crosspoint Boulevard Indianapolis, IN 46256 www.wiley.com Copyright © 2005 by Wiley Publishing, Inc., Indianapolis, Indiana Published simultaneously in Canada ISBN-13: 978-0-7645-8406-0 ISBN-10: 0-7645-8406-5 Manufactured in the United States of America 10 9 8 7 6 5 4 3 2 1 1MA/SU/QT/QV/IN No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sections 107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, 222 Rosewood Drive, Danvers, MA01923, (978) 750-8400, fax (978) 646-8600. Requests to the Publisher for permission should be addressed to the Legal Department, Wiley Publishing, Inc., 10475 Crosspoint Blvd., Indianapolis, IN 46256, (317) 572-3447, fax (317) 572-4355, e-mail: [email protected]. LIMIT OF LIABILITY/DISCLAIMER OF WARRANTY: THE PUBLISHER AND THE AUTHOR MAKE NO REPRESENTATIONS OR WARRANTIES WITH RESPECT TO THE ACCURACY OR COMPLETENESS OF THE CONTENTS OF THIS WORK AND SPECIFICALLY DISCLAIM ALL WARRANTIES, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR APARTIC- ULAR PURPOSE. NO WARRANTY MAY BE CREATED OR EXTENDED BY SALES OR PROMO- TIONAL MATERIALS. THE ADVICE AND STRATEGIES CONTAINED HEREIN MAY NOT BE SUITABLE FOR EVERYSITUATION. THIS WORK IS SOLD WITH THE UNDERSTANDING THAT THE PUBLISHER IS NOT ENGAGED IN RENDERING LEGAL, ACCOUNTING, OR OTHER PRO- FESSIONAL SERVICES. IF PROFESSIONAL ASSISTANCE IS REQUIRED, THE SERVICES OF A COMPETENT PROFESSIONALPERSON SHOULD BE SOUGHT. NEITHER THE PUBLISHER NOR THE AUTHOR SHALLBE LIABLE FOR DAMAGES ARISING HEREFROM. THE FACT THAT AN ORGANIZATION OR WEBSITE IS REFERRED TO IN THIS WORK AS ACITATION AND/OR A POTENTIALSOURCE OF FURTHER INFORMATION DOES NOT MEAN THAT THE AUTHOR OR THE PUBLISHER ENDORSES THE INFORMATION THE ORGANIZATION OR WEBSITE MAY PROVIDE OR RECOMMENDATIONS IT MAYMAKE. FURTHER, READERS SHOULD BE AWARE THAT INTERNET WEBSITES LISTED IN THIS WORK MAYHAVE CHANGED OR DISAPPEARED BETWEEN WHEN THIS WORK WAS WRITTEN AND WHEN IT IS READ. For general information on our other products and services or to obtain technical support, please contact our Customer Care Department within the U.S. at (800) 762-2974, outside the U.S. at (317) 572-3993 or fax (317) 572-4002. Wiley also publishes its books in a variety of electronic formats. Some content that appears in print may not be available in electronic books. Trademarks:Wiley, the Wiley Publishing logo, Wrox, the Wrox logo, Programmer to Programmer, and related trade dress are trademarks or registered trademarks of John Wiley & Sons, Inc. and/or its affil- iates, in the United States and other countries, and may not be used without written permission. All other trademarks are the property of their respective owners. Wiley Publishing, Inc., is not associated with any product or vendor mentioned in this book. TEAM LinG - Live, Informative, Non-cost and Genuine ! 01_584065 ffirs.qxd 3/7/05 7:17 PM Page v About the Authors Adrian and Kathie Kingsley-Hughes have worked in the PC and programming arena for over 10 years, first using their skills to solve real-world problems for industry before later moving on to teaching others to become programmers. In recent years they have had opportunities to teach programming to thousands of aspiring programmers through online classes. There they discovered the joys of teaching programming to people from all walks of life that had no previous background or experience in programming. Adrian and Kathie live in beautiful North Wales, UK, and divide their time between the hi-tech world and outdoor leisure activities. TEAM LinG - Live, Informative, Non-cost and Genuine ! 01_584065 ffirs.qxd 3/7/05 7:17 PM Page vi Credits Acquisitions Editor Project Coordinator Katie Mohr Erin Smith Senior Development Editor Graphics and Production Specialists Kevin Kent April Farling Lauren Goddard Development Editor Denny Hager Howard A. Jones Clint Lahnen Lynsey Osborn Production Editor Rashell Smith Felicia Robinson Ron Terry Technical Editor Quality Control Technicians Wiley-Dreamtech India Pvt Ltd Amanda Briggs John Greenough Copy Editor Joe Niesen Foxxe Editorial Services Carl William Pierce Brian H. Walls Editorial Manager Mary Beth Wakefield Proofreading and Indexing TECHBOOKS Production Services Vice President & Executive Group Publisher Richard Swadley Vice President and Publisher Joseph B. Wikert TEAM LinG - Live, Informative, Non-cost and Genuine ! 02_584065 ftoc.qxd 3/7/05 7:23 PM Page vii Contents Introduction xvii Chapter 1: What Is Programming? 1 The History of Programming 1 What Is Programming? 4 Why So Many Programming Languages? 4 Different Code,Same Results 6 BASIC 7 Atari BASIC 7 C 7 C++ 7 COBOL 8 FORTRAN 8 Java 8 JavaScript 9 Mathematica 9 Pascal 9 Perl 9 Python 9 QBASIC 9 Smalltalk 9 Visual Basic 9 VRML 10 Programs Needed to Create Programs 11 Development Environment 11 Compilers 11 Summary 12 Chapter 2: Why Learn to Program? 13 Why Program? 13 The “Career” Programmer 14 Problem Solving 16 How Big Is the Project? 17 Is the Project Time Critical? 17 Work or Hobby? 17 TEAM LinG - Live, Informative, Non-cost and Genuine ! 02_584065 ftoc.qxd 3/7/05 7:23 PM Page viii Contents Because You Want to Contribute 18 Just for Fun 18 Fame 18 What to Learn? 19 Programming Avenues 19 Traditional Programming 19 Web Programming 21 Programming Myths and Facts 23 Myth 1 — Programming Tools Cost a Lot of Money 23 Myth 2 — You Need a Degree in Computer Science to be a Programmer 24 Myth 3 — Learning to Program Takes Years 24 Myth 4 — Programming Is Just for Young People 24 Myth 5 — I’ll Need a Top-of-the-Range Super-Duper Computer to Program On 24 Myth 6 — Programming Is Addictive! 24 Myth 7 — Programming Languages Change All the Time 25 Myth 8 — Once You’ve Learned One Programming Language,Learning Others Is Easier 25 Summary 25 Chapter 3: How Computers “Read” Code 27 Reading Code 27 Top Down 28 Breaking Up Code 31 The Statement 35 Functions/Procedures 36 The Sentences and Paragraphs of Programming 37 Lines of Code 37 Paragraphs of Code 38 Data Storage 39 Data 40 Summary 42 Chapter 4: From Concepts to Code — The Language of Code 43 Binary 44 Interpreting Binary 44 Large Numbers 46 Bit Grouping 47 Bit 47 Nybble 47 Byte 48 Halfword 48 Word 49 Doubleword 50 viii TEAM LinG - Live, Informative, Non-cost and Genuine ! 02_584065 ftoc.qxd 3/7/05 7:23 PM Page ix Contents Binary Math 50 Using Windows Calculator 51 Why Binary? 54 Hexadecimal 54 Interpreting Hexadecimal 55 Hexadecimal and Windows Calculator 57 Representing Characters 57 Operators 65 Arithmetic Operators 65 Assignment Operators 66 Comparison Operators 66 Logical Operators 67 String Operators 68 Summary 69 Chapter 5: The Tools for Programming 71 Make Your Workspace Your Own 71 The Keyboard 71 Workspace 73 Desk 73 Monitor 73 Fonts 73 Choose Your Language 75 Learning to Program 76 School/College 77 Tips 77 Work-Based Training 77 Tips 78 Hobby Programmer 78 Tip 79 The Languages 79 How I Will Teach You to Program 79 Why Not Buy a Book Covering a Specific Language? 80 The Tools 80 General Tools and Utilities 80 Text Editor 80 Utilities 83 Programming Tools 87 Java 89 C++ 91 Scripting Languages 94 Summary 95 TEAM LinG - Live, Informative, Non-cost and Genuine ! ix

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.