AP Computer Science A
AP Computer Science A (Java)
Intro to
Computers
and
Computer Programs
:
Introduction to the "computer" as a
programmable
computing device
Overview on how a computer works (+
information encoding
):
The computer memory and the binary number system
Introduction of
computer program/algorithm
:
What
does a
computer program
contain?:
The process of writing computer programs
--- what is going on behind the scenes
Installing the
BlueJ
Integrated Development Environment:
Introduction to Java programming
Hello.java - Everyone's first Java program:
How to compile and run a Java program with
BleuJ
(demo interactively):
Chapter 2: Elementary Programming
Writing a simple Java program that compute area of a circle:
Java input and output:
Variables
,
Identifiers
and
Primitive data types
:
In depth:
How does a
(Java) compiler
work ?
Arithmetic operations
and
short hand
operators:
Assign homework 1:
Mixed
data type operations:
Named
constants
and naming convention:
Misc topics:
(1) cascaded assignment, (2) swap variables
Chapter 3: Selections
Conditions
,
boolean
data type,
boolean
variables and
boolean
expressions:
if
-statements: (1)
one-way
if-statement and (2)
two-way
if-statement (a.k.a. "if-else"-statement) + their
flow charts
:
Advanced
if
-statements: (1)
nested
if-statement and (2)
multi-way
if-statement
Assign homework 2:
Some
common errors
made with
if
-statements:
Generating random numbers + making a subtraction quiz:
Assign homework 3:
Logical operators
(!, &&, ||)
Case study
: checking for
leap year
--
The
switch
statement
The
conditional expression (? :)
Operator precedence
and
operator associativity
Chapter 4a: Using the static methods in the
Math
class
Intro to
using
methods:
Java's
Math
class:
Assign homework 4:
Chapter 4b: using the instance methods in the
String
class
The
char
primitive data type:
Advanced usage
of
char
data in Java programs:
Assign homework 5:
Intro to
instance methods
using the
String
class:
Java's methods:
instance methods
and
static methods
:
Advanced usage
of
String
data in Java programs:
Assign homework 6:
(1)
Mixed type
operations with
String
and (2) string
input operation
:
Converting
number strings
into
integers
or
float/double
Chapter 5: Loops
Introduction:
The
while
-loop:
Assign homework 7:
The
do-while
-loop:
The
for
-loop:
Some
algorithms
using loops (
find GCD
,
prime number factoring
and
perfect number
):
Nested
loops:
Assign homework 8:
The
break
and
continue
statements:
Algorithm design
and
implementation
example (that use loops) ((1) palindrome test and (2) prime number test):
Chapter 6: (Static) Methods
Introduction:
Defining
a method:
Assign homework 9:
Program control
when
calling
a method +
activation record
:
Passing arguments
by value
- what happens when you update a parameter ?:
Programming
with
methods
- how to use methods to package code together that perform a useful task:
Assign homework 10:
Overloading
methods - how Java picks the method to invoke:
The
scope
and
life time
of a
local variable
:
Program development using the
divide and conquer
strategy:
Assign homework 11:
Chapter 18: Recursion
Intro to
recursion
:
How a recursive method works - computing
factorial of n
recursively:
Solving problems with recursion:
A
graphical explanation
of
recursion
:
Writing a
recursive
isPalindrome()
method:
Assign homework 12:
Improving program efficiency:
The
private
modifier:
Solving a
complex problem
with
recursion
- the
Tower of Hanoi
problem:
Recursion
vs
iteration (loop)
:
Assign homework 13:
Chapter 7: Single-Dimensional Arrays
Introduction to
array
:
Array basics:
Defining and using (accessing) array elements:
Processing data stored in arrays:
Assign homework 14:
The
for-each
loop access array elements:
Using an array to represent a deck of cards:
Assign homework 15:
Copying
arrays:
Extending
the
size
of an array:
Passing
arrays as arguments to methods:
Methods with
variable number
of arguments in Java:
Returning
an array from a method:
Assign homework 16:
Searching
arrays:
Assign homework 17:
Sorting
arrays:
The
selection sort
algorithm:
The
insertion sort
algorithm:
The
merge sort
algorithm: (My material on Chapter 23.4)
Merging 2
sorted arrays
:
The
merge sort
algorithm:
The
running time
of the sorting algorithms:
Java's
Arrays
class
with useful array methods:
The command line argument of the
main( )
method:
Arrays used in Mathematics:
Chapter 8: Multi-dimensional Arrays
Introduction to
2-dimensional arrays
:
2-dimensional array basics:
Defining and using 2-dimensional arrays:
Processing data stored in 2-dimensional arrays:
Passing a 2-dimensional array to a method and returning a 2-dim array:
2-dimensional arrays used in Mathematics:
Assign homework 18:
Chapter 9: Objects and Classes
Intro to
object oriented programming
Defining classes
and
creating objects
with classes:
Assign homework 19:
Constructors
of a class:
Accessing object
via reference variables:
The
this
reference variable:
Copying
object:
The
copy constructor
of a class:
Assign homework 20:
Array
of objects:
Intro to
Object Oriented Programming
- implementing a deck of cards
Using classes from the Java Library:
Assign homework 21:
Data (field)
encapsulation
:
Passing
object arguments
to methods:
The other kinds of variables and methods in a class:
static
variables (and constants) and
static
methods:
Assign homework 22:
Assign homework 23:
Assign homework 24:
Chapter 11.11: The ArrayList class
Intro to the
ArrayList
class in
Java's utilities library
:
Adding (= inserting)
new elements into an
ArrayList
object (and automatic arraylist size adaptation):
Looking up
elements in an
ArrayList
object:
Replacing
and
Removing
elements in/from an
ArrayList
object and
other useful methods
:
Helper methods
for
Lists
:
Summary:
similarities and differences between an
array
and an
arraylist
:
Assign homework 25:
Chapter 10: processing primitive types as objects
Processing
primitive
data type as
objects
:
Automatic conversion
between a
primitive type
and its
wrapper class
:
Assign homework 26:
Chapter 11: Inheritance and Polymorphism
Introduction to
inheritance
:
The
Object Oriented Design
methodology (superclass and subclass):
------------------------------------ 9/12
Program design
using the
Object Oriented Design
methodology:
Relationship
between superclass and subclass and their
constructors
:
Java's
Object
class
and its
toString()
method:
Assign homework 27:
Overriding vs. overloading:
-------------------------------------------------------- 9/14
Intro to
Polymorphism
:
request
on object vs.
ability
of object
Application of
polymorphism
: making algorithms work for
more general
data types
-------------------------------------------------------- 9/19
Terminology:
Upcasting
,
downcasting
and the
instanceof
operator:
-------------------------------------------------------- 9/21
The
protected
accessibility classfier:
Preventing
a class from being extended by other classes:
Released AP Exam
:
Multiple Choice questions 1-10:
Multiple Choice questions 11-20:
Multiple Choice questions 21-30:
Multiple Choice questions 31-40: