Skip to content

AP Computer Science A

AP · College BoardComputer Science A44 notes in 4 folders, 228 KB

Notes for AP Computer Science A (College Board), in folders for the four units of the course framework in order: Using Objects and Methods; Selection and Iteration; Class Creation; Data Collections. Each note covers one topic with short Java examples, traced by hand where that helps. Delete any note you have already mastered once the notes are yours.

Adding them puts a copy in your notes, in a folder of its own with the folders below, for you to change and turn into flashcards or a question deck. Download gives you a zip of markdown files, which opens in any notes app.

What is inside

  • Using objects and methods
    • Algorithms, compilers and errors5 KB
    • Variables and primitive types5 KB
    • Expressions and output5 KB
    • Casting, range and compound assignment5 KB
    • APIs, libraries and comments4 KB
    • Methods, parameters and class methods5 KB
    • The Math class4 KB
    • Classes, objects and constructors5 KB
    • Creating and combining Strings4 KB
    • String methods5 KB
  • Selection and iteration
    • Algorithms with selection and repetition4 KB
    • Boolean expressions and relational operators4 KB
    • if statements5 KB
    • Logical operators and equivalent expressions5 KB
    • Comparing object references4 KB
    • while loops4 KB
    • for loops5 KB
    • Standard algorithms with loops5 KB
    • String algorithms6 KB
    • Nested loops and run-time analysis5 KB
  • Class creation
    • Abstraction and program design5 KB
    • Reliability, legal and ethical impacts of computing4 KB
    • Anatomy of a class5 KB
    • Constructors and object state6 KB
    • Writing methods5 KB
    • Passing and returning object references6 KB
    • Class variables and methods5 KB
    • Scope, access and this6 KB
  • Data collections
    • Data collection, privacy and bias5 KB
    • Arrays5 KB
    • Array traversals6 KB
    • Array algorithms6 KB
    • Text files and Scanner6 KB
    • Wrapper classes5 KB
    • ArrayList methods6 KB
    • ArrayList traversals5 KB
    • ArrayList algorithms6 KB
    • 2D arrays4 KB
    • 2D array traversals6 KB
    • 2D array algorithms7 KB
    • Searching6 KB
    • Selection sort and insertion sort6 KB
    • Recursion7 KB
    • Merge sort5 KB

The first note

Using objects and methods / Algorithms, compilers and errors

## Algorithms and sequencing An **algorithm** is a step-by-step process for completing a task or solving a problem. Everyday processes are algorithms: a recipe, directions to a friend's house, the steps for making a phone call. An algorithm can be written in ordinary language or drawn as a diagram such as a flowchart, and writing one out before any code is a good habit because it shows which steps the program needs and in what order. **Sequencing** is the ordering of the steps. The steps of a process are carried out one at a time, and the order matters, because changing it can change the result. Consider this algorithm for making a sandwich with cheese and butter: 1. Take two slices of bread. 2. Spread butter on one slice. 3. Place cheese on the buttered slice. 4. Place the second slice on top. If step 4 came before step 3 the cheese would have nowhere to go. A program is an algorithm written in a language a computer can follow, and a Java program runs its statements in order from top to bottom unless a statement changes the flow of control. ```java int width = 4; int height = 3; int area = width * height; System.out.println(area); ``` This prints 12. Swapping the third and fourth lines would not compile or would print the wrong thing, because `area` would be used before it has a value. ## Writing, compiling and running Java Java source code is plain text and can be written in any text editor. Most programmers use an **integrated development environment** (IDE), which…

And 43 more once you add or download them.

Reviews

No written reviews yet. Add these notes to yours and you can be the first to leave one.