

Programming with Objects 1.1 Modeling with Objects 1.1.1 Using Models 1.1.2 Using Software Objects to Create Models 1.1.3 Modeling Robots 1.2 Understanding Karel’s World 1.2.1 Avenues, Streets, and Intersections 1.2.2 Walls and (other) Things 1.2.3 Robots 1.3 Modeling Robots with Software Objects 1.3.1 Attributes 1.3.2 Constructors 1.3.3 Services 1.4 Two Example Programs 1.4.1 Situations 1.4.2 Program Listing 1.4.3 Setting up the Initial Situation 1.4.4 Sending Messages 1.4.5 Tracing a Program 1.4.6 Another Example Program 1.4.7 The Form of a Java Program 1.4.8 Reading Documentation to Learn More 1.5 Compiling and Executing Programs 1.5.1 Compile-Time Errors 1.5.2 Run-Time Errors 1.5.3 Intent Errors 1.5.4 A Brief History of Bugs and Debugging 1.6 GUI: Creating a Window 1.6.1 Displaying a Frame 1.6.2 Adding User Interface Components 1.7 Patterns 1.7.1 The Java Program Pattern 1.7.2 The Object Instantiation Pattern 1.7.3 The Command Invocation Pattern 1.7.4 The Sequential Execution Pattern 1.7.5 The Display a Frame Patternġ 2 2 4 7 9 9 10 10 12 13 13 14 15 15 17 19 20 20 23 25 26 29 30 32 33 34 34 35 37 39 40 41 42 43 44ġ.8 Summary and Concept Map 1.8.1 Concept Maps 1.9 Problem SetĢ.1 Understanding Programs: An Experiment 2.2 Extending the Robot Class 2.2.1 The Vocabulary of Extending Classes 2.2.2 The Form of an Extended Class 2.2.3 Implementing the Constructor 2.2.4 Adding a Service 2.2.5 Implementing move3 2.2.6 Implementing turnRight 2.2.7 RobotSE 2.2.8 Extension vs. Used with permission of John Wiley & Sons, Inc. Copyright © 1997 by John Wiley & Sons, Inc. Some portions of this work are based on Karel++: A Gentle Introduction to the Art of Object-Oriented Programming by Joseph Bergin, Mark Stehlik, Jim Roberts, and Richard Pattis.

Cover: Drawing © 2001 by Joel Weber Becker. ISBN 4-3 Photo Credits Figure 1-5: Courtesy of NASA/JPL-Caltech Figure 1-22: Courtesy of the U.S. This copy, including the credits listed above, is identical except for information related to the original publisher. The rights to this work have subsequently reverted back to the author's company, Thumbody's Thinking Inc. Any additional questions about permissions can be submitted by e-mail to The Web addresses in this book are subject to change from time to time as necessary without notice.įor more information, contact Thumbody's Thinking, 211 Simeon Street, Kitchener, ON N2H 1S9 Canada or email This work was originally published by Thomson Course Technology, a division of Thomson Learning. They are permitted to make copies at cost, including printed copies, for their own use. An exception to the above is made for instructors and students. No part of this work may be reproduced, transcribed, or used in any form or by any means-graphic, electronic, or mechanical, including photocopying, recording, taping, Web distribution, or information storage and retrieval systems-without prior written permission of the publisher. Marketing Coordinator: Suelaine FrongelloĪssociate Product Manager: Jennifer Smithĭisclaimer Thumbody's Thinking reserves the right to revise this publication and make changes from time to time in its content without notice.ĪLL RIGHTS RESERVED. Senior Manufacturing Coordinator: Justin Palmeiro Java: Learning to Program with Robots by Byron Weber Becker Java Learning to Program with Robots Byron Weber Becker,University of Waterloo
