Back to United States Computer Science
United States · College BoardQ&A
Computer ScienceQ&A by dot point
A short Q&A bank for every United States Computer Science syllabus dot point. Each question and answer is drawn directly from our worked dot-point page, so you can scan key concepts before opening the long-form answer.
Unit 1: Primitive Types
- Topic 1.5 Casting and Ranges of Variables: use casting to convert between int and double, predict the effect of truncation, and recognize that an int has a finite range that can overflow.2Q&A pairs
- Topic 1.4 Compound Assignment Operators: use the compound assignment operators (+=, -=, *=, /=, %=) and the increment and decrement operators (++, --) as shorthand to update variables.2Q&A pairs
- Topic 1.3 Expressions and Assignment Statements: evaluate arithmetic expressions using operator precedence, integer division and the modulo operator, and assign results to variables.1Q&A pairs
- Topic 1.2 Variables and Data Types: identify the primitive types int, double and boolean, and declare, initialise and use variables of those types.2Q&A pairs
- Topic 1.1 Why Programming? Why Java?: explain how a program is a sequence of statements executed in order, how Java source is compiled and run, and how to display output and handle simple runtime behavior.2Q&A pairs
Unit 2: Using Objects
- Topic 2.5 Calling a Non-void Method: call a method that returns a value, and use the returned value by storing it, printing it, or including it in an expression.2Q&A pairs
- Topic 2.4 Calling a Void Method with Parameters: call a void method that takes parameters, passing arguments that match the parameter list in number, order and type, and explain how arguments are copied to parameters.3Q&A pairs
- Topic 2.3 Calling a Void Method: call a non-static void method on an object using dot notation, and explain that a void method performs an action but returns no value.2Q&A pairs
- Topic 2.2 Creating and Storing Objects (Instantiation): use the new keyword to call a constructor and instantiate an object, choosing the correct constructor by its parameters, and store the result in a reference variable.2Q&A pairs
- Topic 2.1 Objects: Instances of Classes: explain the relationship between a class and its objects, and describe an object as an instance of a class with state and behavior.2Q&A pairs
- Topic 2.6 String Objects: Concatenation, Literals, and More: create String objects from literals or a constructor, concatenate strings with the + operator, and predict the result of mixing strings with numbers and escape sequences.2Q&A pairs
- Topic 2.7 String Methods: call the String methods in the AP Java subset (length, substring, indexOf, equals, compareTo), respecting zero-based indexing and the immutability of String objects.2Q&A pairs
- Topic 2.9 Using the Math Class: call the static Math methods in the AP Java subset (abs, pow, sqrt, random) and generate a random integer or double in a specified range.2Q&A pairs
- Topic 2.8 Wrapper Classes: Integer and Double: use the Integer and Double wrapper classes, including autoboxing and unboxing, the MIN_VALUE and MAX_VALUE constants, and parsing methods.2Q&A pairs
Unit 3: Boolean Expressions and if Statements
- Topic 3.1 Boolean Expressions: evaluate expressions formed with the relational operators (<, >, <=, >=, ==, !=) that produce a boolean result of true or false.2Q&A pairs
- Topic 3.7 Comparing Objects: compare object references with == and !=, compare object contents with equals, and detect a null reference, understanding the difference between identity and equality.2Q&A pairs
- Topic 3.5 Compound Boolean Expressions: combine boolean expressions with the logical operators && (and), || (or) and ! (not), applying short-circuit evaluation.2Q&A pairs
- Topic 3.4 else if Statements: use an if / else if / else chain so that the first true condition runs its block and the rest are skipped, selecting exactly one outcome.2Q&A pairs
- Topic 3.6 Equivalent Boolean Expressions: apply De Morgan's laws and truth tables to produce equivalent boolean expressions and to simplify negations of compound conditions.2Q&A pairs
- Topic 3.3 if-else Statements: use a two-way if-else statement so that exactly one of two code blocks runs depending on whether the boolean condition is true or false.2Q&A pairs
- Topic 3.2 if Statements and Control Flow: use a one-way if statement so that a block of code runs only when its boolean condition is true, and trace the resulting flow of control.2Q&A pairs
Unit 4: Iteration
- Topic 4.3 Developing Algorithms Using Strings: traverse a String with a loop using length, substring and indexOf to implement standard algorithms such as counting characters, searching for a pattern and building a new String.2Q&A pairs
- Topic 4.2 for Loops: use a for loop, whose header combines initialisation, a boolean condition and an update, to repeat a block a controlled number of times, and convert between for and while loops.2Q&A pairs
- Topic 4.5 Informal Code Analysis: determine the number of times a statement executes in a loop or nested loop by counting iterations, without using formal big-O notation.1Q&A pairs
- Topic 4.4 Nested Iteration: write and trace nested loops, where an inner loop runs in full on each pass of an outer loop, and count the total number of inner-loop iterations.1Q&A pairs
- Topic 4.1 while Loops: use a while loop to repeat a block of statements while a boolean condition remains true, with correct initialisation, condition and update to avoid infinite or off-by-one loops.3Q&A pairs
Unit 5: Writing Classes
- Topic 5.4 Accessor Methods: write accessor (getter) methods, including a toString method, that return information about an object's state without changing it.2Q&A pairs
- Topic 5.1 Anatomy of a Class: identify the parts of a class definition (the class header, private instance variables, constructors and methods) and explain encapsulation through access modifiers.2Q&A pairs
- Topic 5.2 Constructors: write constructors that initialise an object's instance variables from parameters, including overloaded and default constructors, and explain the default initial values.2Q&A pairs
- Topic 5.3 Documentation with Comments: write comments that document a method, including its precondition and postcondition, to describe what the method assumes and guarantees.2Q&A pairs
- Topic 5.10 Ethical and Social Implications of Computing Systems: explain the ethical and social responsibilities of programmers, including data privacy, intellectual property, system impact and responsible design.2Q&A pairs
- Topic 5.5 Mutator Methods: write mutator (setter) methods, usually void, that change an object's instance variables, including methods that validate or constrain the new value before assigning it.2Q&A pairs
- Topic 5.8 Scope and Access: distinguish local variable scope from instance variable scope, and use the access modifiers public and private to control where a class member can be used.2Q&A pairs
- Topic 5.7 Static Variables and Methods: declare and use static variables and methods, which belong to the class as a whole rather than to any one object, and explain how they differ from instance members.2Q&A pairs
- Topic 5.9 this Keyword: use the implicit parameter this to refer to the current object, disambiguate an instance variable from a parameter of the same name, and pass the current object to another method.2Q&A pairs
- Topic 5.6 Writing Methods: design and implement methods that take parameters, perform a computation possibly using the object's instance variables, and return a result or perform an action.3Q&A pairs
Unit 6: Array
- Topic 6.1 Array Creation and Access: declare and initialise a one-dimensional array, access elements by index from 0 to length minus 1, and use the length attribute.3Q&A pairs
- Topic 6.4 Developing Algorithms Using Arrays: write and apply standard algorithms over a one-dimensional array, including finding minimum, maximum, sum, average, count and shifting or rearranging elements.3Q&A pairs
- Topic 6.3 Enhanced for Loop for Arrays: use an enhanced for-each loop to traverse the elements of an array, and explain why it cannot modify the array or access indices.2Q&A pairs
- Topic 6.2 Traversing Arrays: use a standard for loop with an index variable to traverse an array, reading or modifying each element, while staying inside the valid index bounds.2Q&A pairs