Learn how to program
by playing video games.

Java Projects

AP Computer Science A - Study Session

March 26, 2021
Part of: Java Projects

Get prepared for the AP Computer Science A exam! I'll let you know what to expect and go through some example questions from the official 2021 College Board AP Comp Sci exam guide. Should be a good supplement to the rest of your studying!

I'll explain what you need to focus on, give you tips for test day, and work through some sample questions with you. This study guide should also be beneficial for any beginner Java programmer, even if you're not taking the AP Comp Sci test.

Links
Official AP Comp Sci A Course and Exam description PDF: https://apcentral.collegeboard.org/pdf/ap-computer-science-a-course-and-exam-description.pdf?course=ap-computer-science-a
Write your own Java game: https://youtu.be/PJLLDpaLjds

The AP Computer Science test is coming up for all you high school students in the US. But don't worry, I’m gonna help you prepare by giving you the secret, never-before-seen source of all answers on the test that no student has ever seen before. That's right, I have the official AP Computer Science A course and exam description pdf from the Advanced Placement website.

And as someone who has taken this test, I should be well equipped to let you know what to expect, give you some tips, and I'll even embarrass myself by going through some example questions with you.

So the first thing you should know is: what's on the test. And here it is [pg. 188], all the topics and what percentage of multiple choice questions come from each topic. And the first thing that should jump out at you is *bam* 17.5% on "if statements", and then *bam* 22.5% on iteration. And you know what else I see: 15% on Arrays, 7.5% on ArrayList, and 10% on 2D Arrays. And you can bet you're going to be looping over all of these arrays using iteration, so:

Loops and arrays, guys. Loops and arrays.

And let's look at the breakdown of the free response questions, too. As you can see it's 4 questions, all equally weighted, but 2 of them are about arrays!

Loops and Arrays.

Let me really nail this point home. I've distilled all these topics into 3 giant categories, so you can see what you really need to study.

  • Basics: variables, if/else, methods (total 22%)
    • Primitive Types 5%
    • Boolean Expressions and if Statements 17.5%
    • Free Response: Methods and Control Structures 12.5%
  • Loops and Arrays (total 55%)
    • Iteration 22.5%
    • Array 15%
    • ArrayList 7.5%
    • 2D Array 10%
    • Recursion 7.5%
    • Free Response: Array/ArrayList 12.5%
    • Free Response: 2D Array 12.5%
  • Object Oriented Programming (total 23%)
    • Using Objects 7.5%
    • Writing Classes 7.5%
    • Inheritance 10%
    • Free Response: Class 12.5%

The basics. You need to know your common data types: "int" for whole numbers, "double" for decimal numbers, "boolean" for true or false, and Strings. "if” statements: You really shouldn't pass this test if you aren't comfortable with if statements, so hopefully you're there already.

Remember single equal sign for assignment, double equal sign for comparisons. All the AND, OR, LESS THAN stuff. Make sure you know about MODULO, they'll throw that at you at least once.

They'll also hit you with some stupid gotcha's, especially around if statements, so just be sure to read the questions carefully. For some reason they're kinda big on understanding the order of operations, so spend some time reviewing that. Like what is executed first, addition or multiplication? AND or OR? Even though in the real world we use parentheses in any situation that’s even slightly ambiguous, so I don’t know why they do this to you.

And for methods, you need to know how to use parameters, and definitely return statements. Don't forget in your method header you need to put the data type of the returned value.

Loops and lists. That's what this test is all about. They don't want to give you any college credit if you don't understand loops and arrays. So your classic for-loop, your while loop, your nested loops. You need to be able to read and write these, and you need to be able to step through them. Either in your mind, or on some scrap paper. Arrays start at 0.

They'll throw some string manipulation at you, too, using loops. So know how substring() works, and concatenation. You'll probably see random() used in one of these loop questions.

Recursion is kinda the odd ball here, but it should have been the last subject you covered in class so hopefully it's fresh in your mind. I put it in this group because recursion is just a fancy way of doing loop, by having a method call itself. But if you find recursion hard, I wouldn't spend too much time focusing on it, just because it's only a small part of the multiple-choice test, and it doesn't sound like it’s going to be on the free-response portion at all.

And then we have the object oriented topics. You'll definitely have one question about classes in the free-response section. So I would get comfortable writing out your own class: one that has properties, and methods, and a constructor. And you should make sure you know how to read and write to property variables from within a method. And then how you create an object from a class (you call the constructor with the new keyword).

Watch the video to see me work through some sample problems.

If you're looking for a more practical, hands-on approach to learning Java, check out my video on how to make a simple 2D game. In there I give you some code to get started with, and you can mess around with loops and arrays to your heart's content and actually get to see the results of your code in a more visual way. And it's more fun than banging your head against all these weird, contrived problems they put in textbooks.

So good luck on your test!


Ben Johnson My name is Ben and I help people learn how to code by gaming. I believe in the power of project-based learning to foster a deep understanding and joy in the craft of software development. On this site I share programming tutorials, coding-game reviews, and project ideas for you to explore.