The words you are searching are inside this book. To get more targeted content, please make full-text search by clicking here.
Discover the best professional documents and content resources in AnyFlip Document Base.
Search
Published by INTERTU℠ EDUCATION, 2022-08-19 15:41:08

AP Computer Science A, 7th Edition

AP Computer Science A, 7th Edition

Index

Symbols API library, 482 chaining
! operator, 65 applet, 59, 482 of assignment statements, 66
!= operator, 64 application, 59, 482
*= operator, 66 argument, 103 chatbot, see Magpie lab
+ operator arithmetic operators, 63 class, 92–110
ArithmeticException, 75
concatenation, 178 array, 233–254 abstract, 142, 356
++ operator, 66 collaborator, 212
+= operator, 66 as parameter, 235 independent, 212
-- operator, 66 initialization, 234 instance, 93
-= operator, 66 initializer list, 234, 250 wrapper, 110, 180
. operator, 97 length, 234 class method, 97
/ operator, 63 of objects, 239 ClassCastException, 75, 142, 146,
/= operator, 66 one-dimensional, 233
< operator, 64 shuffling, 354 181, 242
<= operator, 64 traversing, 235, 245, 251, 356 classes
== operator, 64 two-dimensional, 249, 356
> operator, 64 ArrayIndexOutOfBoundsException, ArrayList<E>, 241, 242, 244
>= operator, 64 Double, 182
% operator, 63 75, 233, 250 Integer, 181
%= operator, 66 ArrayList<E> class, 241, 242, 244 Math, 183
&& operator, 65 Object, 174
|| operator, 65 methods of, 244 Position, 194
vs. array, 241 String, 177, 180
A assertion, 219 client program, 94
abs method, 183 assignment operators, 66 collaborator class, 212
abstract, 142 auto-boxing, 183, 242 Collection<E> interface, 242
abstract class, 142, 355 average case, 220 collections
and generics, 242
vs. interface, 148 B and iterators, 247
abstract method, 142, 144, 356 backslash \, 68 Collections API library, 241
access specifier, 95 base case, 291 College Board web site, 57
accessor, 96 behavior, 92 Comparable, 145
actual parameter, 103 best case, 220 compareTo method, 64, 146, 178, 181,
add method binary number, 62, 356, 357
binary search, 329 182
of ArrayList, 244 bit, 482 compile-time error, 209, 219
of List, 243, 244 block, 100 compiler, 58, 482
algorithm, 213, 219 boolean, 60 composition relationship, 211, 219
average case, 220 boolean expression, 64 compound assignment operator, 66
best case, 220 compound boolean expression, 65
efficiency, 220, 240 compound, 65 concatenation operator, 178
worst case, 220 short-circuit evaluation, 65 constant, 94
aliasing, 102 bottom-up development, 212, 219 constructor, 95, 135, 354
AP exam, xi buffer, 482
free-response section, xi, xii bug, 209 default, 95, 135, 136
hints for taking, xii built-in type, 60 container class, 241
information, xi byte, 482 control structures, 69–74
mark-sense sheet, xi byte, 61
multiple-choice section, xi, xii bytecode, 58, 482 decision-making, 69–70
raw score, xi iteration, 71–74
Section I, xi C CPU, 482
Section II, xi cache, 482
AP Java subset, xi, 60, 67, 75 casting, 60, 63, 140 D
APCS labs, see labs CD-ROM, optional, xiii dangling else, 70
data field, 93
data structure, 219
debugger, 482
debugging, 207, 208

485

486 Index

default constructor, 95, 135, 136 floating-point numbers initializer list, 234, 250
default method, 144 comparison of, 65 input/output, 67
division storage of, 61 insertion sort, 325, 328
instance method, 97
floating-point, 63 for loop, 71 instance variable, 59, 93
integer, 63 for-each loop, ix, 72, 235, 245, 251
dot operator, 97 inherited, 135
Double, 182 in 2-D array, 251, 356 protected, 135
methods of, 182 in array, 235 int, 60
double, 60 in ArrayList, 245 Integer, 181
double quote \", 68 formal parameter, 103 methods of, 181
doubleValue method, 182 integer division, 63
downcasting, 140 G intent error, 209
driver class, 219 generics, 242 interface, 144–148, 356
dummy parameter, 103 Collection<E>, 242
dynamic binding, 138 ArrayList<E>, 242 Comparable, 145
Iterator<E>, 244 Iterator<E>, 247
E List<E>, 242, 243 List<E>, 242, 243
early binding, 138 get method vs. abstract class, 148
efficiency, 220, 240 of ArrayList, 244 interpreter, 483
Elevens lab, 353–356 of List, 243 intValue method, 181
encapsulation, 93, 211, 219 GUI, 482 is-a relationship, 132, 137, 211
equals method, 176, 181, 182 iteration, 71–74
equals vs. ==, 179 H for loop, 71
erasure, 242 hardware, 482 for-each loop, 72, 235, 251, 356
error, 74, 209 has-a relationship, 211 while loop, 72
hashCode method, 176 iterator
compile-time, 209 hasNext method for lists, 243
intent, 209 parameterized, 247
logic, 209 of Iterator, 247 iterator method
overflow, 60 header, 95 of List, 244
round-off, 65, 147 helper method, 295 Iterator<E> interface, 247
run-time, 209 Hertz (Hz), 483 methods of, 247
syntax, 209 hexadecimal number, 12, 62, 357, 483
escape sequence, 68 high-level language, 483 J
exam, see AP exam hints Java
exception, 74, 209, 219
ArithmeticException, 75 for taking exam, xii for-each loop, 72, 235, 245, 251
ArrayIndexOutOfBoundsException, for using this book, xiii static import, 184
HTML, 483 Java application, 59
75, 233, 250 Java introductory language features,
checked, 75 I
ClassCastException, 75, 142, IDE, 483 57–76
identifier, 60 Java subset, see AP Java subset
146, 181, 242 if statement, 69 Java virtual machine, 483
IllegalArgumentException, 75 if...else statement, 69, 353 java.lang, 58
IllegalStateException, 75, 249 IllegalArgumentException, 75 java.util, 241
IndexOutOfBoundsException, IllegalStateException, 75, 249 Javadoc comments, 59, 483
immutable object, 177, 183 JavaScript, 483
75, 180, 244, 245 implements, 145
NoSuchElementException, 75, implicit parameter, 100 K
import statement, 58 keyword, 59
247, 248 increment operator, 66
NullPointerException, 75, 103, independent class, 212, 219 L
indexOf method, 180, 352 lab
180, 243 IndexOutOfBoundsException, 75,
StringIndexOutOfBoundsException, Elevens, 353–356
180, 244, 245 Magpie, 351–353
180 infinite loop, 73 Picture, 356–358
unchecked, 75 infinite recursion, 292 labs, 351–359
explicit parameter, 100 Infinity, 62 late binding, 138
exponential run time, 295 information hiding, 94, 219 length method, 180
extended if statement, 70, 351 inheritance, 131–149, 356 linker, 483
extends, 132, 142, 145, 354 inheritance hierarchy, 131, 219 List<E> interface, 242, 243
inheritance relationship, 211, 219 methods of, 243
F inherited instance variable, 135 local variable, 100
final variable, 63, 94 inherited method, 135
float, 62 initialization, 103, 234
floating-point division, 63

logic error, 209, 219 random, 183 Index 487
logical operators, 65 remove, 244, 247
long, 61 set, 243, 244 P
loop size, 243, 244 package, 57
sqrt, 183 parameter, 95
for, 71 substring, 180, 352
for-each, 72, 235, 251, 356 swap, 237 actual, 103
infinite, 73 toString, 175, 181, 182 array, 235
nested, 74 microcomputer, 483 dummy, 103
while, 72 minicomputer, 483 explicit, 100
low-level language, 483 mod, 63 formal, 103
modem, 483 implicit, 100
M mutator, 97 pass by value, 104
Magpie lab, 351–353 passing object as, 105
main method, 58, 98 N passing primitive type as, 104
mainframe computer, 483 NaN, 62 two-dimensional array, 253
malware, 483 nested if statement, 69 parameter list, 95
mantissa, 61 nested loop, 74 partial overriding, 132, 135
Math class, 183 network, 483 partition method, 327
Math.PI, 184 new, 75, 233 PI (π), 184
matrix, 249 newline \n, 68 Picture lab, 356–358
merge method, 326 next method pivot element, 327
mergesort, 325 polymorphic method calls
method, 94 of Iterator, 247 rules for, 141
non-default method, 144 polymorphism, 138–142, 355
abstract, 144 NoSuchElementException, 75, 247, Position class, 194
accessor, 96 postcondition, 220
class, 97 248 pow method, 183
constructor, 95, 135 null, 103 precondition, 220
default, 144 null reference, 103 primary memory, 484
header, 95 NullPointerException, 75, 103, primitive type, 60, 101
helper, 295 private, 59, 94
inherited, 135 180, 243 method, 94
instance, 97 variable, 94
mutator, 97 O procedural abstraction, 213, 219
non-default, 144 Object, 174 program analysis, 219, 356
overloaded, 99, 138 program correctness, 219
overriding, 132, 135 methods of, 174 program design, 207–219, 356
partial overriding, 132, 135 object, 92–110 object-oriented, 210
public, 94 program maintenance, 210, 219
recursive, 290, 291 behavior, 92 program specification, 207, 208, 219
signature, 99 reference, 93, 95, 101 protected, 135
static, 59, 97 state, 92 public, 59, 94, 135
stub, 213 variable, 96 method, 94
method overriding, 132, 135 object code, 483 variable, 94, 135
methods object-oriented program, 219
abs, 183 object-oriented program design, 210, Q
add, 243, 244 quicksort, 327
compareTo, 64, 146, 178, 181, 182 356
doubleValue, 182 octal number, 62, 357 R
equals, 176, 181, 182 one-dimensional array, 233 RAM, 484
get, 243, 244 operating system, 483 random method, 183
hashCode, 176 operator, 63–67 random numbers, 184, 354
hasNext, 247 random selection, 352
indexOf, 180, 352 arithmetic, 63 recursion, 290–307
intValue, 181 assignment, 66
iterator, 244 concatenation, 178 base case, 291
length, 180 decrement, 66 general rules, 295
main, 58, 98 division, 63 in 2-D grids, 298
merge, 326 dot, 97 infinite, 292
next, 247 increment, 66 tail, 292
partition, 327 logical, 65 recursive definition, 293
pow, 183 mod, 63 recursive helper method, 295
precedence, 64, 67 recursive method, 290, 291
relational, 64 analysis of, 294
output, 67 reference, 95, 101
overflow error, 60
overloaded method, 99, 138

488 Index mergesort, 325 T
quicksort, 327 tail recursion, 292
relational operator, 64 recursive, 325 test data, 208, 219
remove method selection, 324 testing, 207, 208
sorting, 324–329 this, 100
of ArrayList, 244 algorithms in Java, 328 throw, 75
of Iterator, 247 source code, 484 top-down development, 213, 219
of List, 244 source file, 58 toString method, 175, 181, 182
reserved word, 59 specification, 207, 208 transistor, 484
return type, 95 sqrt method, 183 two-dimensional array, 249–254, 356
robust program, 209, 219 state, 92
ROM, 484 static, 59, 94, 98 as parameter, 253
round-off error, 65, 147 static binding, 138 traversal, 251
rounding, 61 static final variable, 94 type, 60
row-by-row array processing, 251 static import, 184 boolean, 60
run-time error, 209, 219 static method, 97 built-in, 60
static variable, 94 double, 60
S stepwise refinement, 213, 219 int, 60
scope, 100 storage of numbers, 61 primitive, 60, 101
String, 177, 180 type compatibility, 140
of loop variable, 71 comparison, 178
SDK, 484 concatenation operator, 178 U
search in Magpie lab, 352 UML diagram, 212, 219, 356
initialization, 177 URL, 484
binary, 329 methods of, 179, 352 USB flash drive, 484
sequential, 329 string literal, 177 user-defined constant, 63
secondary memory, 484 StringIndexOutOfBoundsException,
Section I answer sheet, xiii V
selection sort, 324 180 variable, 60, 94
sentinel, 73 stub method, 213, 219
sequential search, 329 subclass, 131, 354 final, 63, 94
server, 484 instance, 59, 93
set method rules for, 137 local, 100
of ArrayList, 244 subclass object public, 94, 135
of List, 243 variable declaration, 60
short, 61 declaration of, 137 virus, 483, 484
short-circuit evaluation, 65 subpackage, 58 void, 95
shuffle array, 354 substring method, 180, 352
signature, 99 super, 135, 139, 354 W
size method superclass, 131, 139 while loop, 72
of ArrayList, 244 swap method, 237 workstation, 484
of List, 243 Swing, 484 worst case, 220
software, 484 syntax error, 219 wrapper class, 110, 180–183
software development, 207, 219
waterfall model, 207
sort
insertion, 325, 328

Success on Advanced Placement Tests
Starts with Help from BARRON’S

Each May, thousands of college-bound students take one or more Advanced Placement Exams to earn college
credits—and for many years, they’ve looked to Barron’s, the leader in Advanced Placement test preparation.
You can get Barron’s user-friendly manuals for 23 different AP subjects, most with optional CD-ROMs.

BONUS ONLINE PRACTICE TEST: Free access
to one additional full-length online test with purchase.

AP: Art History, 2nd Ed., w/optional CD-ROM
Book: ISBN 978-0-7641-4691-6, $18.99, Can$21.99
Book w/CD-ROM: ISBN 978-1-4380-7125-1, $29.99, Can$34.50

AP: Biology, 5th Ed., w/optional CD-ROM
Book: ISBN 978-1-4380-0500-3, $18.99, Can$21.99
Book w/CD-ROM: ISBN 978-1-4380-7518-1, $29.99, Can$34.50

AP: Calculus, 13th Ed., w/optional CD-ROM
Book: ISBN 978-1-4380-0204-0, $18.99, Can$21.99
Book w/CD-ROM: ISBN 978-1-4380-7516-7, $29.99, Can$34.50

AP: Chemistry, 7th Ed., w/optional CD-ROM
Book: ISBN 978-1-4380-0271-2, $18.99, Can$21.99
Book w/CD-ROM: ISBN 978-1-4380-7382-8, $29.99, Can$34.50

AP: Chinese Language and Culture, w/3 Audio CDs, 2nd Ed.
ISBN 978-1-4380-7388-0, $29.99, Can$34.50

AP: Computer Science, 7th Ed., w/optional CD-ROM
Book: ISBN 978-1-4380-0594-2, $18.99, Can$21.99
Book w/CD-ROM: ISBN 978-1-4380-7553-2, $29.99, Can$34.50

AP: English Language and Composition, 6th Ed.,
w/optional CD-ROM

Book: ISBN 978-1-4380-0552-2, $16.99, Can$19.50
Book w/CD-ROM: ISBN 978-1-4380-7515-0, $29.99, Can$34.50

AP: English Literature and Composition, 5th Ed., AP: Psychology, 6th Ed., w/optional CD-ROM
w/optional CD-ROM Book: ISBN 978-1-4380-0270-5, $16.99, Can$19.50
Book: ISBN 978-1-4380-0278-1, $16.99, Can$19.50 Book w/CD-ROM: ISBN 978-1-4380-7381-1, $29.99, Can$34.50
Book w/CD-ROM: ISBN 978-1-4380-7386-6, $29.99, Can$34.50
AP: Spanish Language and Culture w/4 Audio CDs, 8th Ed.,
AP: Environmental Science, 6th Ed., w/optional CD-ROM and w/optional CD-ROM
Book: ISBN 978-1-4380-0132-6, $18.99, Can$21.99 Book w/4 audio CDs: ISBN 978-1-4380-7391-0, $26.99, Can$31.00
Book w/CD-ROM: ISBN 978-1-4380-7534-1, $29.99, Can$34.50
Book w/4 audio CDs and CD-ROM: ISBN 978-1-4380-7392-7,
AP: European History, 7th Ed., w/optional CD-ROM $34.99, Can$39.99
Book: ISBN 978-1-4380-0277-4, $18.99, Can$21.99
Book w/CD-ROM: ISBN 978-1-4380-7385-9, $29.99, Can$34.50 AP: Statistics, 8th Ed., w/optional CD-ROM
Book: ISBN 978-1-4380-0498-3, $18.99, Can$21.00
AP: French Language and Culture, w/3 Audio CDs Book w/CD-ROM: ISBN 978-1-4380-7517-4, $29.99, Can$34.50
ISBN 978-1-4380-7259-3, $26.99, Can$31.00
AP: U.S. Government and Politics, 8th Ed.,
AP: Human Geography, 5th Ed., w/optional CD-ROM w/optional CD-ROM
Book: ISBN 978-1-4380-0282-8, $16.99, Can$19.50 Book: ISBN 978-1-4380-0279-8, $16.99, Can$19.50
Book w/CD-ROM: ISBN 978-1-4380-7390-3, $29.99, Can$34.50 Book w/CD-ROM: ISBN 978-1-4380-7387-3, $29.99, Can$34.50

AP: Italian Language and Culture, w/3 Audio CDs AP: U.S. History, 2nd Ed., w/optional CD-ROM
ISBN 978-0-7641-9368-2, $26.99, Can$32.50 Book: ISBN 978-1-4380-0269-9, $18.99, Can$21.99
Book w/CD-ROM: ISBN 978-1-4380-7380-4, $29.99, Can$34.50
AP: Microeconomics/Macroeconomics, 5th Ed.
ISBN 978-1-4380-0495-2, $16.99, Can$19.50 AP: World History, 6th Ed., w/optional CD-ROM
Book: ISBN 978-1-4380-0272-9, $18.99, Can$21.99
AP: Music Theory, w/4 Audio CDs, 2nd Ed. Book w/CD-ROM: ISBN 978-1-4380-7383-5, $29.99, Can$34.50
ISBN 978-1-4380-7389-7, $34.99, Can$39.99

AP: Physics 1 and 2, w/optional CD-ROM Barron’s Educational Series, Inc. In Canada:
Book: ISBN 978-1-4380-0268-2, $18.99, Can$21.99 250 Wireless Blvd. Georgetown Book Warehouse
Book w/CD-ROM: ISBN 978-1-4380-7379-8, $29.99, Can$34.50 Hauppauge, NY 11788 34 Armstrong Ave.
Order toll-free: 1-800-645-3476 Georgetown, Ontario L7G 4R9
AP: Physics C, 3rd Ed. Canadian orders: 1-800-247-7160
ISBN 978-0-7641-4707-4, $18.99, Can$21.99 Prices subject to change without notice.

Available at your local book store or visit www.barronseduc.com (#93 R10/14)

THE FOLLOWING DOCUMENTATION APPLIES IF YOU PURCHASED
AP Computer Science A, 7th Edition

How to Use the CD-ROM

The software is not installed on your computer; it runs directly from the CD-ROM.
Barron’s CD-ROM includes an “autorun” feature that automatically launches the
application when the CD is inserted into the CD-ROM drive. In the unlikely event that
the autorun feature is disabled, follow the manual launching instructions below.

Windows®
1. Click on the Start button and choose “My Computer.”
2. Double-click on the CD-ROM drive, which is named AP_Computer Science.
3. Double-click AP_Computer Science to launch the program.

MAC®
1. Double-click the CD-ROM icon.
2. Double-click the AP_Computer Science icon to start the program.

SYSTEM REQUIREMENTS

Microsoft® Windows® MAC® OS X
2.33GHz or faster x86-compatible processor, Intel® Core™ Duo 1.83GHz
or Intel Atom™ (1.6GHz or faster processor
or faster processor
for netbook class devices) Mac OS X v10.6, v10.7, v10.8, or v10.9
Microsoft® Windows® XP, Windows
Server 2008, Windows Vista® Home 512MB of RAM (1GB recommended)
Premium, Business, Ultimate, or Enterprise
(including 64 bit editions) with Service Pack
2, Windows 7, or Windows 8 Classic
512MB of RAM (1GB recommended)

BARRON’S LICENSING AGREEMENT/DISCLAIMER OF WARRANTY

For books including one or more CD-ROMs and/or Audio CDs

1. Ownership of Rights. The disc(s) in the plastic sleeve was/were created for Barron’s Educational Series, Inc.,
and the editorial contents therein remain the intellectual property of Barron’s. Users may not reproduce the disc(s),
authorize or permit the disc(s) reproduction, transmit the disc(s), or permit any portion thereof to be transmitted for
any purpose whatsoever.

2. License. Barron’s hereby grants to the consumer of this product the limited license to use same solely for personal
use. Any other use shall be in violation of Barron’s rights to the aforesaid intellectual property and in violation of
Barron’s copyright interest in such disc(s).

3. Limited Warranty. Disclaimer of Implied Warranties. If the disc(s) fail(s) to function in a satisfactory manner, Barron’s
sole liability to any purchaser or user shall be limited to refunding the price paid for same by said purchaser or user.
Barron’s makes no other warranties, express or implied, with respect to the disc(s). Barron’s specifically disclaims any
warranty of fitness for a particular purpose or of merchantability.

4. Consequential Damages. Barron’s shall not be liable under any circumstances for indirect, incidental, special,
or consequential damages resulting from the purchase or use of the disc(s).



SCORE HIGHER
with BARRON’S

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 test.

BOOK 4 P roven test-taking strategies that make the difference

between a good score and a great score

4 O ne full-length diagnostic test to help you pinpoint your

strengths and weaknesses

4 T wo additional full-length practice tests to boost your

confidence

4 T he most up-to-date subject review that covers the specific

material you need to know for the test

ONLINE 4 A ccess to a full-length sample AP Computer Science A exam
with answer explanations and automatic scoring
See inside front cover for details.

BARRON’S GIVES YOU THE ANSWERS!

Every question in this book comes with a comprehensive answer explanation.

New chapter on ISBN: 978-1-4380-0594-2
StSchTiUeeDnCYcoGemRAEpEuNlat.ebrs
EAN

STUDYGREEN. $18.99 Canada $21.99 PRINTED
Printed on partially recycled paper www.barronseduc.com IN THE
Fully recyclable
USA


Click to View FlipBook Version