AP Computer Science A Exam Review

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/59

flashcard set

Earn XP

Description and Tags

AP Computer Science A Exam Review Flashcards

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

60 Terms

1
New cards

Identifier

Name for variable, parameter, constant, user-defined method/class, etc.

2
New cards

Built-in/Primitive Types

int, boolean, double

3
New cards

int

An integer, e.g. 5, -77, 9001

4
New cards

boolean

A boolean, true or false

5
New cards

double

A double precision floating-point number, 2.718, -3456.78, 1.4e5

6
New cards

Integer.MINVALUE and Integer.MAXVALUE

Represent the absolute lowest and highest values that can be stored in an integer

7
New cards

final variable

A quantity whose value will not change

8
New cards
    +

Addition

9
New cards
    -

Subtraction

10
New cards
    *

Multiplication

11
New cards

/

Division

12
New cards

%

Mod (remainder)

13
New cards

Integer division note

Integer division truncates the answer (cuts off the decimal)

14
New cards

==

Equal to

15
New cards

!=

Not equal to

16
New cards


Greater than

17
New cards

<

Less than

18
New cards

=

Greater than or equal to

19
New cards

<=

Less than or equal to

20
New cards

!

NOT

21
New cards

&&

AND

22
New cards

||

OR

23
New cards

=

Simple assignment

24
New cards

+=

x = x + 4

25
New cards

-=

y = y - 6

26
New cards

*=

p = p * 5

27
New cards

/=

n = n / 10

28
New cards

%=

n = n % 10

29
New cards

++

k = k + 1

30
New cards

--

i = i - 1

31
New cards

Conditional Control Structures

if, if…else, if…else if

32
New cards

Looping Control Structures

while loop, for loop, for-each loop

33
New cards

Constructors

Create an object of the class

34
New cards

Accessor

Gets data but doesn’t change data

35
New cards

Mutator

Changes instance variable(s)

36
New cards

Static methods

Class methods, deals with class variables

37
New cards

Method Overloading

Two or more methods with the same name but different parameter lists

38
New cards

Inheritance

Where a subclass is created from an existing superclass

39
New cards

Class hierarchy

Superclass should contain the data and functionality that are common to all subclasses that inherit from the superclass

40
New cards

Implementing Subclasses

Subclasses copy everything except constructors

41
New cards

Inheriting Instance Methods/Variables

Subclasses cannot directly access private variables if they are inherited from a superclass

42
New cards

Method Overriding

If a method has the same name and parameter list in both the superclass and subclass, the subclass method overrides the superclass method

43
New cards

Super

Call up to the superclass

44
New cards

Polymorphism

Method overridden in at least one subclass is polymorphic

45
New cards

Abstract Class

Superclass that represents an abstract concept

46
New cards

Interface

Collection of related methods whose headers are provided without implementations

47
New cards

List

Basically the same as ArrayList

48
New cards

Lists and Arrays

Search, delete and insert an item.

49
New cards

1-D Arrays

First index starts at 0

50
New cards

Array Length

length is a public instance variable of arrays

51
New cards

Traversing an Array

Use for-each loop when you need to access (only access) every element in an array without replacing or removing elements

52
New cards

Selection Sort Algorithm

Search and swap

53
New cards

Insertion Sort Algorithm

Check element (store in temp variable). If larger than the previous element, leave it. If smaller than the previous element, shift previous larger elements down until you reach a smaller element (or beginning of array). Insert element.

54
New cards

Merge Sort Algorithm

Divide data into 2 equal parts, Recursively sort both halves, Merge the results

55
New cards

Binary Search

Check middle element. Is this what we’re looking for? If so, we’re done. Does what we’re looking for come before or after? Throw away half we don’t need. Repeat with half we do need

56
New cards

Binary search

Recursive

57
New cards

GridWorld Case Study

Bugs and Critters are 25% of the exam

58
New cards

Bug Methods

Bug moves if possible; otherwise turns.

59
New cards

BoxBug Variables

number of steps in a side of its square

60
New cards

Critter Class

Get a list of neighboring actors, Process actors, Get list of possible locations to move to, Select location from list, Move to location