The AP CSA exam is on Wednesday May 12, 2027 at 12:00 PM!
Time remaining:
About the Course
- Course Syllabus. Read all about this course, student expectations, and how you will be evaluated.
- AP Computer Science A Description. The official College Board information about this course.
- Code of Honour. All about how to collaborate without plagiarism in this course.
- About the AP Exam. Updated for 2026-27.
- Send me your GitHub username for handin!
- Students get the Java quick reference guide as a cheat sheet on the AP Exam.
Resources
- We are using the textbook Think Java 2nd Edition by Allen Downey and Chris Mayfield. You can download the pdf version, use the online version, or use the interactive version.
- Get your College Board account (instructions here!) and join us at AP Classroom. You can get the join code in class from me.
- Some additional free text books: CS Awesome (requires free account), Tokyo EdTech's Intro to Java
- Java Style Guide for this course.
Chapter 1. Computer Programming
Ch 1 introduces the fundamentals of computers and programming, covering what a computer is, and basic programming instructions like input, output, mathematical operations, decisions, and repetitions. It presents the "Hello World" program to explain Java classes, methods, statements, and comments. The chapter also distinguishes between high-level and low-level languages, detailing the compilation and interpretation process (javac, java, JVM, byte code). It discusses displaying multiple messages using print vs println, source code formatting, escape sequences, and introduces the broader field of computer science. Finally, it outlines the three types of programming errors: compile-time, run-time, and logic errors, and provides initial debugging advice.
Notes & Assignments:
- Chapter 1 Slides
- Chapter 1 from "Introduction to Programming Using Java" by David J. Eck is recommended for expanding upon the topic of "What is a computer."
- Notes about Compilers, Interpreters, and Java
- YouTube playlist of my explanation of Compilers, Interpreters, and Java
Chapter 2. Variables and Operators
This chapters delves into variables for storing values (numbers, text) and their declaration and assignment. It introduces memory diagrams to visualise how values are stored and changed. The chapter covers arithmetic operators (+, -, *, /, %) and introduces floating-point numbers (double), discussing rounding errors and string concatenation. It further explains compiler error messages, run-time errors, and logic errors, providing insights into their identification.
Notes & Assignments:
- Chapter 2 Slides
- Textbook Exercises: 2.2 (Date.java), 2.3 (Time.java). Assigned Sept 14th. 📤 GitHub repository "ch2" 📤
- Ch2 reference solutions
Chapter 3. Input and Output
This chapters focuses on user interaction, explaining the System class (System.out, System.in) and the Scanner class for reading keyboard input. It details Java's language elements such as packages, classes, methods, statements, expressions, and tokens. The chapter covers literals and constants, formatting output with printf and format specifiers, and how to interpret error messages. It also introduces type cast operators and the remainder (modulo) operator, integrating these concepts into complete programs. We also deal with the "Scanner Bug," which is an annoying problem but easy to avoid if you know about it.
Notes & Assignments:
- Chapter 3 Slides
- Textbook Exercises: Assigned Sept 16th. 📤 GitHub Repository "ch3" 📤
- 3.2: Temperature.java
- 3.3: ConvertTime.java
- 3.4: GuessMyNumber.java
- Ch3 reference solutions
Chapter 4. Methods and Testing
This chapter teaches how to organise programs into multiple methods. It differentiates between void methods (no return value) and value-returning methods, explaining return types and return statements. Concepts such as flow of execution, parameters and arguments, and multiple parameters are introduced. Stack diagrams are presented as a tool to visualise the scope of variables and method execution. The chapter also explores methods in the Math class and the principle of composition, concluding with a discussion on incremental development and the use of stubs and scaffolding for testing.
Notes & Assignments:
- Chapter 4 Slides
- Textbook Exercises: Assigned Sept 22nd. 📤 GitHub repository "ch4" 📤
- 4.1: FormatDate.java
- 4.2-4.5 Do these on the paper provided. No need to submit to GitHub
- 4.6: Multadd.java
Chapter 5. Boolean Logic
This chapter introduces relational operators (==, !=, >, <, >=, <=) that produce boolean values (true/false). It covers conditional statements (if-else, if-else-if chains, nesting) for decision-making and the switch statement. The chapter explains logical operators (&&, ||, !), De Morgan's Laws, and the use of boolean variables and methods. A significant focus is placed on validating input and using System.err for error messages.
Notes & Assignments:
- Chapter 5 Slides
- Coding Bat: Make an account at codingbat.com
- Logic-1: First column only [My Solutions]
- Logic-2: First column only [My Solutions]
- Textbook Exercises: Assigned Oct 5th. 📤 GitHub repository "ch5" 📤
- 5.1, 5.4, 5.5: Paper exercises
- 5.2: GuessMyNumber.java
- 5.3: Fermat.java
- 5.6: Quadratic.java
- 5.7: Triangle.java
- De Morgan's Law Assignment
- Check out additional practice questions on AP Classroom (MCQ 1.9, 1.10, 2.2-2.6 as well as Unit 2 Progress Check).
Chapter 6. Loops and Strings
This chapter focuses on repetition using while and for statements, including concepts like loop body, infinite loops, and increment/decrement operators. It discusses nested loops for iterating over multiple variables. The chapter also introduces characters (char, Unicode, escape sequences) and applies loops to strings, covering string length, charAt, indexOf, and substring methods. It concludes with string comparison (equals, compareTo) and String formatting (String.format).
Notes & Assignments:
- Chapter 6 Slides
- Textbook Exercises: Assigned Oct 13th. 📤 GitHub repository "ch6" 📤
- 6.1: Paper exercises
- 6.2: Roots.java [My Solution]
- 6.3: Gauss.java [My Solution]
- Coding Bat Exercises:
- String-1, first column. Assigned Oct 16th [My Solutions]
- String-2, first four rows. Assigned Oct 20th [My Solutions]
- More Textbook Exercises: Assigned Oct 22th. 📤 Keep using repository "ch6" 📤
- 6.4: Abecedarian.java [My Solution]
- 6.5: Doubloon.java [My Solution]
- 6.6: Scrabble.java [My Solution]
- Strings Practice Assignment. Assigned Oct 26. Solutions: [PPAP.java], [Binary.java], [Palindrome.java], [PigLatin.java]
- New Order of Operations
Chapter 7. Arrays and References
Chapter 7 introduces arrays as collections of values of the same type. It explains creating and accessing array elements using the [] operator, including ArrayIndexOutOfBoundsException. The chapter covers displaying and copying arrays (including references and aliasing), and traversing arrays for operations like searching (sequential search), reducing values (sum, product, min/max), and building histograms. It also introduces the enhanced for loop (for-each) and demonstrates character counting using arrays.
Notes & Assignments:
- Chapter 7 Slides
- Coding Bat Exercises:
- Array-1: First Column only. Assigned Oct 28th [My Solutions]
- Array-2: First Column only. Assigned Oct 30th [My Solutions]
- Stock Trader Simulation, Assigned Nov 3. Upload to Ch7 repo as StockTrader.java
- Stock Trader Data Files
Chapter 9, 10, 11: Object Oriented Programming
Chapter 9 introduces the distinction between primitive types and objects, focusing specifically on immutable objects like Strings and wrapper classes that cannot be modified after creation.
Chapter 10 expands on object-oriented concepts by exploring mutable objects, such as the Point and Rectangle classes, which allow their attributes to be changed and require careful handling of references and aliasing.
Chapter 11 guides you through the process of designing your own classes to create new object types, covering essential elements like encapsulation, constructors for initialization, and methods for accessing and modifying instance variables
Notes & Assignments:
- Chapter 9 Slides, Chapter 10 Slides, Chapter 11 Slides.
- Ch 9 Exercise: Command Line Java. Assigned Nov 12th. 📤 Use repository "ch9" 📤
- The Fraction Class. Assigned Nov 17. 📤 Use repository "ch10" 📤
- 🆕 Using the Fraction Class. Assigned Nov 24. 📤 Use repository "ch10" 📤
- 🆕 Ch 11 Practice Assignment. Assigned Nov 26. 📤 Use repository "ch11" 📤