Example: barber

AP Computer Science A, 7th Edition - Moore Public Schools

MOST UP-TO-DATE REVIEWAND PRACTICE TESTSCURRENTLY AVAILABLE7TH EDITIONR oselyn Teukolsky, n 4 full-length practice tests with explained answers, including one onlinen Expert advice on the best way to approach the test n Review covers all relevant topics, including the new AP Computer Science A labs and changes to the Java subsetBARRON SThe Leader in Test Preparation*AP and Advanced Placement Program are registered trademarks of the College Board, which was not involved in the production of, and does not endorse, this BARRON SSCORE HIGHER ISBN: 978-1-4380-0594-2 EAN$ Canada $ www. THEUSABARRON STeukolskyAPCOMPUTERSCIENCE A* on partially recycled paperFully recyclableCOMPUTER Science A*BARRON S GIVES YOU THE ANSWERS!

This book is aimed at students reviewing for the AP Computer Science A exam. It would normally be used at the completion of an AP course. However, it contains a complete summary of all topics for the exam, and it can be used for self-study if accompaniedby a suitable textbook.

Tags:

  Computer, School, Exams, Public, Sciences, Romeo, Ap computer science, Moore public schools, Ap computer science a exam

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Transcription of AP Computer Science A, 7th Edition - Moore Public Schools

1 MOST UP-TO-DATE REVIEWAND PRACTICE TESTSCURRENTLY AVAILABLE7TH EDITIONR oselyn Teukolsky, n 4 full-length practice tests with explained answers, including one onlinen Expert advice on the best way to approach the test n Review covers all relevant topics, including the new AP Computer Science A labs and changes to the Java subsetBARRON SThe Leader in Test Preparation*AP and Advanced Placement Program are registered trademarks of the College Board, which was not involved in the production of, and does not endorse, this BARRON SSCORE HIGHER ISBN: 978-1-4380-0594-2 EAN$ Canada $ www. THEUSABARRON STeukolskyAPCOMPUTERSCIENCE A* on partially recycled paperFully recyclableCOMPUTER Science A*BARRON S GIVES YOU THE ANSWERS!

2 Every question in this book comes with a comprehensive answer explanation. New chapter on the Computer Science A labsBOOKONLINEONLINE7TH EDITIONE verything you need to get a 55 For 70 years, BARRON S experts have been helping students surpass their expectations on standardized tests. This is the only book you will need to get the score you want on the AP Computer Science A Proven test-taking strategies that make the difference between a good score and a great score4 One full-length diagnostic test to help you pinpoint your strengths and weaknesses 4 Two additional full-length practice tests to boost your confidence 4 The most up-to-date subject review that covers the specific material you need to know for the test4 Access to a full-length sample AP Computer Science A exam with answer explanations and automatic scoringBOOKONLINESee inside front cover for All Pages11/7/14 12:41 PMNow Available!

3 Go to to take a free sample AP Computer Science A test, complete with answer explanations and automated S OnlineAP exams *This online test was created for devices that support Adobe Flash Player. To access the test on an Apple iPad or iPhone you will need to install a web browser that supports Flash (check the iTunes App Store for free options). All Pages11/5/14 12:54 PMRoselyn Teukolsky, , Ithaca High SchoolIthaca, New YorkBARRON S*AP and Advanced Placement Program are registered trademarks of the College Board, which was not involved in the production of, and does not endorse, this EDITIONCOMPUTERSCIENCE AAP* 110/7/14 9:09 AM ap 2014/11/4 11:10 page ii #2 About the Author:Roselyn Teukolsky has an degree from Cornell University, and has been teaching programming and com-puter Science since 1980.

4 She has published articles inThe Mathematics Teacherand in the National Councilof Teachers of Mathematics Yearbook. She is the author of Barron sACT Math and Science Workbookand co-author of Barron sSAT 2400: Aiming for the Perfect has received the Edyth May Sliffe Award forDistinguished Mathematics Teaching and the Alfred Kalfus Distinguished Coach Award from the New YorkState Math League (NYSML).c Copyright 2015, 2013, 2010 by Barron s Educational Series, editionsc copyright 2007 under the titleAP Computer Science Levels A and AB, 2003 under the titleHow to Prepare for the AP Computer Science AdvancedPlacement Examination, JAVA Version, and 2001under the titleHow to Prepare for the AP ComputerScience Advanced Placement Examinationby Barron s Educational Series, rights part of this publication may be reproduced ordistributed in any form or by any means without the writtenpermission of the copyright inquiries should be addressed to:Barron s Educational Series, Wireless BoulevardHauppauge, New York : 978-1-4380-0594-2 ISBN (with CD-ROM): 978-1-4380-7553-2 ISSN (Print).

5 2169-5571 ISSN (Print with CD-ROM): 2169-558 XPRINTED IN THE UNITED STATES OF AMERICA9 8 7 6 5 4 3 2 1 ap 2014/11/4 11:10 page iii #3 ContentsPrefaceixIntroductionxiGeneral Information About the Exam .. xiHints for Taking the Exam .. xiiThe Multiple-Choice Section .. xiiThe Free-Response Section .. xiiHow to Use This Book .. xiiiPractice Exam One / Diagnostic Test1 Computer Science Section I .. 5 Computer Science Section II .. 33 Answer Key (Section I) .. 45 Diagnostic Chart for Practice Exam .. 45 Answers Explained .. 47 Chapter 1. Introductory Java Language Features57 Packages and Classes .. 57 Javadoc Comments .. 59 Types and Identifiers .. 60 Identifiers .. 60 Built-in Types.

6 60 Storage of Numbers .. 61 Hexadecimal and Octal Numbers .. 62 Final Variables .. 63 Operators .. 63 Arithmetic Operators .. 63 Relational Operators .. 64 Logical Operators .. 65 Assignment Operators .. 66 Increment and Decrement Operators .. 66 Operator Precedence .. 67 Input/Output .. 67 Input .. 67 Output .. 67 Escape Sequences .. 68 Control Structures .. 69 Decision-Making Control Structures .. 69 Iteration .. 71 Errors and Exceptions .. 74 Multiple-Choice Questions on Introductory Java Language Concepts .. 77 Answer Key .. 88 Answers Explained .. 88iii ap 2014/11/4 11:10 page iv #4 ivContentsChapter 2. Classes and Objects92 Objects .. 92 Classes .. 93 Public , Private, and Static.

7 94 Methods .. 95 Headers .. 95 Types of Methods .. 95 Method Overloading .. 99 Scope .. 100 ThethisKeyword .. 100 References .. 101 Reference vs. Primitive Data Types .. 101 The Null Reference .. 103 Method Parameters .. 103 Multiple-Choice Questions on Classes and Objects .. 111 Answer Key .. 126 Answers Explained .. 126 Chapter 3. Inheritance and Polymorphism131 Inheritance .. 131 Superclass and Subclass .. 131 Inheritance Hierarchy .. 131 Implementing Subclasses .. 132 Declaring Subclass Objects .. 137 Polymorphism .. 138 Dynamic Binding (Late Binding) .. 138 Usingsuperin a Subclass .. 139 Type Compatibility .. 140 Downcasting .. 140 TheClassCastException.. 142 Abstract Classes .. 142 Abstract Class.

8 142 TheabstractKeyword .. 142 Interfaces .. 144 Interface .. 144 Defining an Interface .. 145 TheimplementsKeyword .. 145 TheComparableInterface .. 145 Multiple-Choice Questions on Inheritance and Polymorphism .. 150 Answer Key .. 169 Answers Explained .. 169 Chapter 4. Some Standard Classes174 TheObjectClass .. 174 The Universal Superclass .. 174 Methods inObject.. 174 TheStringClass .. 177 StringObjects .. 177 ConstructingStringObjects .. 177 The Concatenation Operator .. 178 ap 2014/11/4 11:10 page v #5 ContentsvComparison ofStringObjects .. 178 OtherStringMethods .. 179 Wrapper Classes .. 180 TheIntegerClass .. 181 TheDoubleClass .. 182 TheMathClass .. 183 Random Numbers .. 184 Multiple-Choice Questions on Standard Classes.

9 187 Answer Key .. 200 Answers Explained .. 200 Chapter 5. Program Design and Analysis207 The Software Development Life Cycle .. 207 The Waterfall Model .. 207 Program Specification .. 208 Program Design .. 208 Program Implementation .. 208 Testing and Debugging .. 208 Program Maintenance .. 210 Object-Oriented Program Design .. 210 Identifying Classes .. 210 Identifying Behaviors .. 211 Determining Relationships Between Classes .. 211 UML Diagrams .. 212 Implementing Classes .. 212 Implementing Methods .. 213 Vocabulary Summary .. 219 Program Analysis .. 219 Program Correctness .. 219 Assertions .. 219 Efficiency .. 220 Multiple-Choice Questions on Program Design and Analysis .. 221 Answer Key.

10 230 Answers Explained .. 230 Chapter 6. Arrays and Array Lists233 One-Dimensional Arrays .. 233 Initialization .. 233 Length of Array .. 234 Traversing an Array .. 235 Arrays as Parameters .. 235 Array Variables in a Class .. 238 Array of Class Objects .. 239 Analyzing Array Algorithms .. 240 Array Lists .. 241 The Collections API .. 241 The Collections Hierarchy .. 242 Collections and Generics .. 242 Auto-Boxing and -Unboxing .. 242 TheList<E>Interface .. 243 ap 2014/11/4 11:10 page vi #6 viContentsThe Methods ofList<E>.. 243 TheArrayList<E>Class .. 244 UsingArrayList<E>.. 245 Collections and Iterators .. 247 Definition of an Iterator .. 247 TheIterator<E>Interface .. 247 Using a Generic Iterator.


Related search queries