APCSA Unit 1- College Board Video Notes
AP Computer Science A: Unit 1
Unit 1.1 Video 1 Notes (Skill 2.B)-
System/class methods
Key Takeaways-
Unit 1.1 Video 2 Notes (Skill 2.B)-
String literals
Unit 1.1 Video 3 Notes (Skill 4.B)-
Syntax errors and logic errors
Unit 1.2 Video 1 Notes (Skill 1.A)-
Variables and Data Types
Unit 1.2 Video 2 Notes (Skill 1.B)-
Variables and Data Types
Unit 1.3 Video 1 Notes (Skill 2.A)-
Expressions and Assignment Statements (Basic Arithmetic Knowledge)
Unit 1.3 Video 2 Notes (Skill 2.A)-
Expressions and Assignment Statements (Evaluating Compound Expressions)
8 * 6 - 14 % 3 + 8 / 2
48 – 14 % 3 + 8 / 2
48 – 2 + 8 / 2
48 – 2 + 4
46 + 4
50
Ex 2:
8 * 6 - 14 % (3 + 8) / 2
8 * 6 - 14 % 11 / 2
48 - 14 % 11 / 2
48 – 3 / 2
48 – 1
47
Unit 1.3 Video 3 Notes (Skill 1.B)-
Expressions and Assignment Statements (Initialize/Change Stored Values in Variables)
Unit 1.4 Video 1 Notes (Skill 2.B)-
Compound Assignment Operators
Ex: x += 7. Instructions: 1) Take the value currently stored n x. 2) Add 7. 3) Assign the result back to x.
Unit 1.4 Video 2 Notes (Skill 2.B)-
Compound Assignment Operators (increment ++ and decrement --)
Ex: x++; Instruction: 1) Take the value currently stored in x. 2) Add 1. 3) Assign the result back to x. EXCLUSION STATEMENT: The use of increment and decrement operators in the prefix form (i.e., ++x) and inside other expressions (i.e., arr[x++]) is outside the score of this course and the ap exam).
Unit 1.4 Video 3 Notes (Skill 5.A)-
Compound Assignment Operators (describing the behavior and overall purpose of code)
int x = 23; 1) define an int var x, set its initial value to 23
x *= 2; 2) take the current value of x, mult. by 2, assign result to x
x %= 10; 3) take the curr. value of x, find x mod 10, assign result to x
System.out.println(x); 4) display the current value of x
Unit 1.5 Video 1 Notes (Skill 2.B)-
Casting and Ranges of Variables
(int) (2.5 * 3.0) 7
(double) 25 / 4 6.25
6 / (double) 5 1.2
(int) (12 / 5) 2
Unit 1.5 Video 2 Notes (Skill 5.B)-
Casting and Ranges of Variables
-2147483647 (Integer.MIN_VALUE)
Double: up to 14-15 digits.
^^ Above image is outside of allowable range (provides unexpected result).
AP Computer Science A: Unit 1
Unit 1.1 Video 1 Notes (Skill 2.B)-
System/class methods
Key Takeaways-
Unit 1.1 Video 2 Notes (Skill 2.B)-
String literals
Unit 1.1 Video 3 Notes (Skill 4.B)-
Syntax errors and logic errors
Unit 1.2 Video 1 Notes (Skill 1.A)-
Variables and Data Types
Unit 1.2 Video 2 Notes (Skill 1.B)-
Variables and Data Types
Unit 1.3 Video 1 Notes (Skill 2.A)-
Expressions and Assignment Statements (Basic Arithmetic Knowledge)
Unit 1.3 Video 2 Notes (Skill 2.A)-
Expressions and Assignment Statements (Evaluating Compound Expressions)
8 * 6 - 14 % 3 + 8 / 2
48 – 14 % 3 + 8 / 2
48 – 2 + 8 / 2
48 – 2 + 4
46 + 4
50
Ex 2:
8 * 6 - 14 % (3 + 8) / 2
8 * 6 - 14 % 11 / 2
48 - 14 % 11 / 2
48 – 3 / 2
48 – 1
47
Unit 1.3 Video 3 Notes (Skill 1.B)-
Expressions and Assignment Statements (Initialize/Change Stored Values in Variables)
Unit 1.4 Video 1 Notes (Skill 2.B)-
Compound Assignment Operators
Ex: x += 7. Instructions: 1) Take the value currently stored n x. 2) Add 7. 3) Assign the result back to x.
Unit 1.4 Video 2 Notes (Skill 2.B)-
Compound Assignment Operators (increment ++ and decrement --)
Ex: x++; Instruction: 1) Take the value currently stored in x. 2) Add 1. 3) Assign the result back to x. EXCLUSION STATEMENT: The use of increment and decrement operators in the prefix form (i.e., ++x) and inside other expressions (i.e., arr[x++]) is outside the score of this course and the ap exam).
Unit 1.4 Video 3 Notes (Skill 5.A)-
Compound Assignment Operators (describing the behavior and overall purpose of code)
int x = 23; 1) define an int var x, set its initial value to 23
x *= 2; 2) take the current value of x, mult. by 2, assign result to x
x %= 10; 3) take the curr. value of x, find x mod 10, assign result to x
System.out.println(x); 4) display the current value of x
Unit 1.5 Video 1 Notes (Skill 2.B)-
Casting and Ranges of Variables
(int) (2.5 * 3.0) 7
(double) 25 / 4 6.25
6 / (double) 5 1.2
(int) (12 / 5) 2
Unit 1.5 Video 2 Notes (Skill 5.B)-
Casting and Ranges of Variables
-2147483647 (Integer.MIN_VALUE)
Double: up to 14-15 digits.
^^ Above image is outside of allowable range (provides unexpected result).