Java Software Solutions Foundations of Program Design 8th

所需积分/C币:20 2017-10-16 11:44:38 19.15MB PDF
收藏 收藏

Java Software Solutions Foundations of Program Design 8th
This page intentionally left blank Eighth edition SOFTWARE SOLUTIONS FOUNDATIONS OF PROGRAM DESIGN JOHN LEWIS Virginia Tech WILLIAM LOFTUS Accenture PEARSON Boston Columbus Indianapolis New York San Francisco Upper Saddle River Amsterdam Cape Town Dubai London Madrid Milan Munich Paris Montreal Toronto Delhi Mexico City Sao Paulo Sydney Hong Kong Seoul Singapore Taipei Tokyo Editorial Director. ecs Marcia horton Manager, Text Permissions Tim nicholls Acquisitions Editor Matt goldstein Text Permission Project Manager: Jenell Forschler Program Manager Kayla Smith-Tarbox Cover Image Corbis Director of Marketing Christy Lesko Media Project Manager Renata butera Marketing Assistant: Jon Bryant Full-Service Project Management: Harleen Chopra/ Director of production Erin gregg Cenveo Publisher Senior Managing editor Scott disanno Services Senior Production Project Composition: Cenveo publisher Services Manager: Marilyn Lloyd Printer/Binder R. R. Donnelley anufacturing buyer Linda sager Crawfordsvill Cover designer Susan Raymond s Joyce Cosentino Well Cover Printer Lehigh-Phoenix Color Text Designer Credits and acknowledgments borrowed from other sources and reproduced, with permission, appear on the credits page at the end of the front matter of this textbook Copyright O 2015, 2012, 2009 Pearson Education, Inc, publishing as Addison-Wesley. All rights reserved. Printed 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 writ ten request to Pearson Education, Inc, Permissions Department, 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 The programs and applications presented in this book have been included for their instructional value. They have been tested with care, but are not guaranteed for any particular purpose. The publisher does not offer any warranties or representations, nor does it accept any liabilities with respect to the programs or applications Library of Congress Cataloging-in-Publication Data Lewis, John, author Java software solutions: foundations of program design John Lewis, Virginia Tech, William Loftus, Eight pages cm Includes bibliographical references and index ISBN978-0-13-359495-9(ak. paper) 1. Java( Computer program language) 2. Object-oriented programming( Computer science) I. Loftus, William, author. IL. Title QA76.73.J38L492014 005.117-dc23 2013047763 10987654321—DOC-1514131211 PEARSON ISBN10:0-13-359495-5 ISBN13:978-0-13-359495-9 This book is dedicated to our families Sharon, Justin, Kayla, Nathan, and Samantha lewis Veena, Isaac, and Devi Loftus This page intentionally left blank Preface Welcome to the Eighth Edition of Java Software Solutions: Foundations of Program Design. We are pleased that this book has served the needs of so many students and faculty over the years. This edition has been tailored further to improve the coverage of topics key to introductory computing. New to This edition The biggest updates to this edition include the following Updated all graphical screen shots Added additional screen shots to show interface options Revised end-of-chapter exercises and programming projects Revised all code for consistent spacing issues Improved discussions of Java translation, text file I/O, and other topics Feedback from both instructors and students continues to make it clear that we have hit the mark with the overall vision of the book. The emphasis remains on presenting underlying core concepts in a clear and gradual manner. The graphics Track sections in each chapter still segregate the coverage of graphics and graphi cal user interfaces, giving extreme flexibility in how that material gets covered The casual writing style and entertaining examples still rule the day The displays of screen shots for graphics-based programs, including programs with graphical user interfaces, have all been updated. The previous versions were dated in terms of the look-and-feel. We also updated some as needed to improve pedagogy On some graphics programs, we added additional screen shots in situations where it was beneficial to see how the program window looks under different situations or window sizes We also focused on the end-of-chapter exercises and programming projects in this revision. We added, subtracted, and modified these to provide an appropriate and updated set Throughout the book the examples had become inconsistent in some issues related to the use of white space. We carefully went through each example and ode fragment to ensure that a consistent and appropriate style was applied Finally as always, we improved discussions throughout the book, sometimes in minor ways, and a few include significant improvements. In particular, the discussion of java translation was updated in Chapter 1 and throughout to focus PREFACE on term JVM rather than the less helpful term interpreter. The figure related to the translation process was also updated. The text file I/o discussion was also updated along with its example. Cornerstones of the Text This text is based on the following basic ideas that we believe make for a sound Introductory text: True object-orientation. a text that really teaches a solid object-oriented approach must use what we call object-speak. That is, all processing should be discussed in object-oriented terms. That does not mean, however, that the first program a student sees must discuss the writing of multiple classes and methods. a student should learn to use objects before learning to write them. This text uses a natural progression that culminates in the ability to design real object-oriented solutions Sound programming practices. Students should not be taught how to program; they should be taught how to write good software. There's a difference. Writing software is not a set of cookbook actions, and a good program is more than a collection of statements. This text integrates practices that serve as the foundation of good programming skills. These practices are used in all examples and are reinforced in the discussions Students learn how to solve problems as well as how to implement solu- tions. We introduce and integrate basic software engineering techniques throughout the text. The Software Failure vignettes reiterate these lessons by demonstrating the perils of not following these sound practices Examples. Students learn by example. This text is filled with full implemented examples that demonstrate specific concepts. We have intertwined small, readily understandable examples with larger, more realistic ones. There is a balance between graphics and nongraphic programs The videonotes provide additional examples in a live presentation format Graphics and GUIs. Graphics can be a great motivator for students, and their use can serve as excellent examples of object-orientation. As such, we use them throughout the text in a well-defined set of sections that we call the graphics Track. This coverage includes the use of event processing and GUls. Students learn to build guis in the appropriate way by using a natural progression of topics. The graphics Track can be avoided entirely for those who do not choose to use graphics Chapter Breakdown Chapter 1(Introduction) introduces computer systems in general, including basic architecture and hardware, networking, programming, and language translation Java is introduced in this chapter, and the basics of general program development PREFACE as well as object-oriented programming, are discussed. This chapter contains broad introductory material that can be covered while students become familiar with their development environment Chapter 2(Data and Expressions)explores some of the basic types of data used in a Java program and the use of expressions to perform calculations. It discusses the conversion of data from one type to another and how to read input interac tively from the user with the help of the standard Scanner class Chapter 3(Using Classes and objects) explores the use of predefined classes and the objects that can be created from them. Classes and objects are used to manipulate character strings, produce random numbers, perform complex calcu- lations, and format output Enumerated types are also discussed Chapter 4 (Writing Classes)explores the basic issues related to writing classes and methods. Topics include instance data, visibility, scope, method parameters, and return types. Encapsulation and constructors are covered as well. Some of the more involved topics are deferred to or revisited in Chapter 6 Chapter 5(Conditionals and Loops) covers the use of boolean expressions to make decisions. Then the if statement and while loop are explored in detail Once loops are established, the concept of an iterator is introduced and the Scanner class is revisited for additional input parsing and the reading of text files Finally, the ArrayList class introduced, which provides the option for managing a large number of objects. Chapter 6(More Conditionals and Loops) examines the rest of Java's condi- tional (switch)and loop(do, for) statements. All related statements for condi tionals and loops are discussed, including the enhanced version of the for loop The for-each loop is also used to process iterators and arrayList objects Chapter 7(Object-Oriented Design) reinforces and extends the coverage of issues related to the design of classes. Techniques for identifying the classes and objects needed for a problem and the relationships among them are discussed. This chap ter also covers static class members, interfaces, and the design of enumerated type classes. Method design issues and method overloading are also discussed Chapter 8(Arrays) contains extensive coverage of arrays and array processing The nature of an array as a low-level programming structure is contrasted to the higher-level object management approach. additional topics include command line arguments, variable length parameter lists, and multidimensional arrays Chapter 9(Inheritance) covers class derivations and associated concepts such as class hierarchies, overriding, and visibility. Strong emphasis is put on the proper use of inheritance and Its role in software design Chapter 10 (Polymorphism) explores the concept of binding and how it relates to polymorphism The en we examine how polymorphic references can be accom- plished using either inheritance or interfaces. Sorting is used as an example of polymorphism Design issues related to polymorphism are examined as well.

试读 127P Java Software Solutions Foundations of Program Design 8th
立即下载 低至0.43元/次 身份认证VIP会员低至7折
关注 私信 TA的资源
Java Software Solutions Foundations of Program Design 8th 20积分/C币 立即下载
Java Software Solutions Foundations of Program Design 8th第1页
Java Software Solutions Foundations of Program Design 8th第2页
Java Software Solutions Foundations of Program Design 8th第3页
Java Software Solutions Foundations of Program Design 8th第4页
Java Software Solutions Foundations of Program Design 8th第5页
Java Software Solutions Foundations of Program Design 8th第6页
Java Software Solutions Foundations of Program Design 8th第7页
Java Software Solutions Foundations of Program Design 8th第8页
Java Software Solutions Foundations of Program Design 8th第9页
Java Software Solutions Foundations of Program Design 8th第10页
Java Software Solutions Foundations of Program Design 8th第11页
Java Software Solutions Foundations of Program Design 8th第12页
Java Software Solutions Foundations of Program Design 8th第13页
Java Software Solutions Foundations of Program Design 8th第14页
Java Software Solutions Foundations of Program Design 8th第15页
Java Software Solutions Foundations of Program Design 8th第16页
Java Software Solutions Foundations of Program Design 8th第17页
Java Software Solutions Foundations of Program Design 8th第18页
Java Software Solutions Foundations of Program Design 8th第19页
Java Software Solutions Foundations of Program Design 8th第20页

试读结束, 可继续阅读

20积分/C币 立即下载 >