AP Computer Science A: Course and Exam Description Study Guide
Principles of the Advanced Placement Program
The Advanced Placement (AP) program is governed by seven core principles designed to ensure transparency, intellectual freedom, and academic challenge:
- Clarity and Transparency: AP makes course frameworks and sample assessments public to eliminate confusion about classroom expectations.
- Encounter with Evidence: AP courses prioritize evidence and the scientific method. Students are developed as independent thinkers who draw their own conclusions.
- Opposition to Censorship: AP respects intellectual freedom. If a school bans required topics (e.g., evolution in Biology), the AP designation is removed.
- Opposition to Indoctrination: No points on an AP Exam are awarded for agreeing with a specific perspective. Students are expected to analyze multiple viewpoints.
- History and Culture: Disciplines are grounded in primary sources to allow students to evaluate different nationalities and ethnicities for themselves.
- Respect for Every Student: Diversity in backgrounds and viewpoints is sought. Debate is protected, but personal attacks are prohibited.
- Choice for Parents and Students: Enrollment is a free choice. Committees of professors and expert educators craft course materials, which are validated by the American Council on Education.
AP Computer Science A: Course Foundations
- College Course Equivalent: The course is equivalent to an introductory college-level computer science course.
- Primary Goals:
- Design Code: Determine program design and develop algorithms.
- Develop Code: Write and implement program code.
- Analyze Code: Determine output/result or explain why code may not work.
- Document Code: Describe behavior and conditions of a program.
- Use Computers Responsibly: Understand the ethical and social implications of computing systems.
- Prerequisites: Successful completion of a first-year high school algebra course. Students should have a strong foundation in linear functions, composition of functions, and problem-solving strategies. They must be able to use a Cartesian coordinate system.
- Programming Language: The course uses Java. Because the language is extensive, the exam covers a specific subset of Java (see Java Quick Reference).
- Lab Requirement: A minimum of hours of hands-on, structured lab experiences is required.
- Resource Requirements: Each student should have access to a computer system for at least hours a week. Computers must be able to create, edit, compile, and execute Java programs.
Computational Thinking Practices and Skills
Students must master five central practices:
- Practice 1: Design Code
- Skill 1.A: Determine an appropriate program design to solve a problem.
- Skill 1.B: Determine what knowledge can be extracted from data.
- Practice 2: Develop Code
- Skill 2.A: Write program code to implement an algorithm.
- Skill 2.B: Write program code involving data abstractions.
- Skill 2.C: Write program code involving procedural abstractions.
- Practice 3: Analyze Code
- Skill 3.A: Determine the result or output based on statement execution order.
- Skill 3.B: Determine the result/output based on code with data abstractions.
- Skill 3.C: Determine the result/output based on code with procedural abstractions.
- Skill 3.D: Explain why code will not compile or work and modify it to correct errors.
- Practice 4: Document Code and Computing Systems
- Skill 4.A: Describe the behavior of a code segment or program.
- Skill 4.B: Describe initial conditions (preconditions) required for code to work.
- Practice 5: Use Computers Responsibly
- Skill 5.A: Explain how computing impacts society, economy, and culture.
Course Content Overview and Unit Weighting
The course is organized into four main units, each weighted for the multiple-choice section of the exam:
- Unit 1: Using Objects and Methods (): Introduction to Java, variables, built-in data types, and basics of calling classes.
- Unit 2: Selection and Iteration (): Conditional statements (), logical operators, and loops ().
- Unit 3: Class Creation (): Designing user-defined reference types, attributes (instance variables), and behaviors (methods).
- Unit 4: Data Collections (): Arrays, , arrays, searching, sorting, and recursion.
Unit 1: Detailed Concepts: Using Objects and Methods
- Foundations:
- Algorithms: Step-by-step processes. Sequencing defines the order.
- Errors:
- Syntax error: Mistake in language rules; detected by compiler.
- Logic error: Mistake in the algorithm; program runs but produces wrong output.
- Run-time error: Mistake during execution that causes abnormal termination.
- Exception: A type of run-time error (e.g., ).
- Data Types and Variables:
- Primitive Types: (integers), (real numbers), and ().
- Exclusion: , , , , and are outside the scope.
- Reference Types: Used to define objects.
- Expressions and Output:
- Output: moves cursor to new line; does not.
- Arithmetic Operators: Addition (), subtraction (), multiplication (), division (), and remainder ().
- Integer Division: When both operands are , the result is truncated to the integer portion.
- Order of Precedence: Parentheses first, then multiplication/division/remainder, then addition/subtraction. Evaluation is left-to-right for same precedence.
- Casting and Range:
- Casting: and convert values. Casting double to int truncates the decimal.
- Rounding: Positive numbers: ; Negative numbers: .
- Limits: and . Exceeding these causes integer overflow.
- Math Class (java.lang):
- : Returns such that .
Unit 2: Detailed Concepts: Selection and Iteration
- Boolean Expressions:
- Relational Operators: , (equality/inequality), , , , (comparison).
- Logical Operators:
- ! (Not): Inverts boolean value.
- && (And): True only if both operands are true.
- || (Or): True if at least one operand is true.
- Short-circuit evaluation: If the first operand of && is false, or the first of is true, the second operand is not evaluated.
- De Morgan’s Law:
- !(a\,\text{&&}\,b) is equivalent to .
- is equivalent to !a\,\text{&&}\,!b.
- Iteration:
- while loop: Evaluates boolean expression before each iteration.
- for loop: Header contains initialization, boolean expression, and update.
- Common Errors: Infinite loops (condition always true) and off-by-one errors (looping once too many/few).
- Standard Algorithms (Selection/Iteration):
- Identifying if an integer is divisible by another.
- Extracting individual digits of an integer.
- Determining minimum/maximum values, sum, or average.
Unit 3: Detailed Concepts: Class Creation
- Encapsulation: Visibility constraints using and . Instance variables are typically ; classes and constructors are .
- State and Behavior:
- State: Defined by instance variables; the current values of an object.
- Behavior: Defined by methods.
- Accessor (Getter): Non-void method that permits reading instance variable values.
- Mutator (Setter): Method that changes instance variable values.
- Constructors: Used to set the initial state. Java provides a default no-argument constructor if none are written.
- Scope:
- Local variables: Defined in a block (method/constructor); cannot be accessed outside.
- this keyword: A special variable holding a reference to the current object.
- Static Variables/Methods: Shared by all instances of a class. Belong to the class itself.
Unit 4: Detailed Concepts: Data Collections
- Arrays: Static size; established at creation.
- Index starts at and ends at .
- Elements initialized to default (, , , or ).
- ArrayList (java.util): Dynamic size; stores object references.
- Methods:
- : Number of elements.
- : Appends to end.
- : Inserts at index; shifts others right.
- : Returns element at index.
- : Replaces element; returns old one.
- : Removes; shifts others left; returns removed element.
- Methods:
- Sorting Algorithms:
- Selection Sort: Repeatedly selects the smallest element from the unsorted portion and swaps it into the front.
- Insertion Sort: Inserts unsorted elements into the sorted portion by shifting elements out of the way.
- Merge Sort: Recursive algorithm that divides arrays into subarrays and merges them in sorted order.
- Searching Algorithms:
- Linear Search: Checks each element in order.
- Binary Search: Requires sorted data; starts at middle and eliminates half of the remaining data in each step.
- Recursion: A method that calls itself. Must have at least one base case to stop execution.
Artificial Intelligence Guidelines
- Value of Dual Competency: Students must combine foundational programming knowledge with AI tools. Understanding logic is more valuable than simple generation.
- Acceptable AI Use:
- Explore approaches: Use AI to understand different solutions to a problem.
- Debugging: Get help identifying syntax or specific logic errors.
- Documentation: Get suggestions for clear identifiers or comments.
- Unacceptable AI Use:
- Bypassing the problem-solving process by asking for complete solutions.
- Using AI for homework/labs without attempting to learn concepts.
- Violating academic integrity or submitting code without proper attribution.
Exam Information and Structure
The AP Computer Science A Exam consists of two sections:
- Section I: Multiple-Choice (\text{ of score})$**\n * 4290 minutes.\n * Assesses all computational thinking practices and course units.\n* **Section II: Free-Response (45\%)$
- questions in minutes.
- Question 1: Methods and Control Structures ( points): Part A (iteration/selection) and Part B (String methods).
- Question 2: Class Design ( points): Design and implement a full class from specifications.
- Question 3: Data Analysis with ArrayList ( points): Analyze and manipulate data in an ArrayList.
- Question 4: Array ( points): Manipulate data in a array structure.
- Scoring Criteria: Points are awarded for algorithm implementation. Algorithm points are lost if steps are omitted, assembled incorrectly, or if persistent data is modified erroneously.