AP Computer Science Principles Cheatsheet

Computing Innovation

  • Definition: Innovation using a program as a key function.
  • Examples:
    • Physical: Robots, Tablets, Smart Tech
    • Non-physical: Social Media, Video Games

Collaboration

  • Allows diverse ideas.
  • Pair Programming: Two people, one computer, shared coding.

Program Function and Purpose

  • Purpose: What a program is designed to do.
  • Code Segments: Smaller parts of a program.
  • Code Statements: Individual instructions.
  • Program Inputs: Data a computer takes in.
  • Program Outputs: Data a computer returns.
  • Program Events: Actions that give the program data.
  • Program Behavior: Program response to user interaction.

Development Processes

  • Iterative: Develop prototypes, redevelop.
  • Incremental: Break problem into parts, fix, reassemble.
  • Program Documentation: Description of program workings.
  • Comments: Documentation inside the program.

Common Errors

  • Logic Errors: Unexpected output.
  • Syntax Errors: Incorrectly typed code.
  • Run-Time Errors: Error during code execution.
  • Overflow Errors: Numbers too big.

Methods of Fixing

  • Hand tracing: Manually track variable values.
  • Print statements: Output values for checking.

Data

  • Collection of facts.
  • Stored in bits (binary digits).
  • Machine code in binary.
  • Abstraction: Reduces complexity by focusing on important parts.

Binary Numbers

  • 8 \, bits = 1 \, byte
  • Hexadecimal: Base 16, used for RGB color codes.

Data Representation

  • ASCII: converts text to binary.
  • Analog data: continuous measurement.
  • Digital data: simplified, discrete measurement (abstraction).

Data Compression

  • Dependent on method and repeated info.
  • Lossless: less compression, better quality.
  • Lossy: more compression, worse quality.

Extracting Information from Data

  • Metadata: data about data.
  • Data mining: examining large datasets.
  • Transforming data: editing data.
  • Cleaning data: making data uniform.

Pseudocode

  • Important for MCQ section.
  • Index starts at 1.

Data Types

  • Numbers, strings, lists, booleans.
  • Strings: ordered list of characters.
  • Substrings: part of a string.
  • String concatenation: connecting strings with "+".
  • Lists (arrays): ordered sequence of elements.
  • Element: individual value in a list.
  • Index: position in the list.
  • Booleans: True/False; logical operators: NOT, AND, OR.

Mathematical Operators

  • Use exam reference sheet.
  • MOD (%) gives the remainder of two numbers.

Algorithms

  • Instructions to accomplish a task using sequencing, selection, and iteration.

Sequencing, Selection, and Iteration

  • Sequencing: code executes in order.
  • Selection: if statements, else statements, nested conditionals.
  • Iteration: loops (repeat n times, repeat until).
  • Binary Search: splits data, eliminates half with each split.

Procedures/Functions

  • Programming instructions (methods).
  • Parameters: input variables.
  • Arguments: procedure call with defined values.
  • Abstraction: call a procedure without knowing how it works.

The Internet

  • Interconnection of networks.
  • Computer network: devices communicating.
  • Data packets: data split with metadata.
  • Routing: finding best path.
  • Path: sequence of connected devices.
  • Bandwidth: rate of data transfer.
  • Protocol: set of rules (TCP/IP, UDP).
  • World Wide Web: system of webpages, etc., runs on the Internet.
  • Scalability: capacity to change in size.

Fault Tolerance

  • Functions despite malfunction.
  • Redundancy: duplication for fault tolerance.

Parallel and Distributed Computing

  • Sequential computing: traditional, one process at a time.
  • Parallel computing: broken into smaller operations, processed simultaneously.
  • Distributed computing: multiple devices communicating.
  • Sequential solution time: sum of all steps (a + b + c).
  • Parallel computing solution: faster with more cores.
  • Speedup: sequential time / parallel time.

Key Concepts

  • Digital divide: gap between internet access.
  • Computing bias: reflecting existing biases.
  • Intellectual property: work considered "theirs".
  • Copyright: creator determines use.
  • Creative Commons: license for others to use work.
  • Open-sourcing: freely shared, distributed, modified work.
  • Open access: unrestricted research access.
  • Crowdsourcing: input from many people online.
  • Citizen Science: public helps conduct research.

Digital Security

  • PII: personally identifiable information.
  • Virus: attached to files, activated by user.
  • Worm: operates independently.
  • Malware: malicious software.
  • Phishing: tricking people for personal information.
  • Multi-factor authentication: multiple verification methods.

Encryption

  • Encoding data to prevent access.
  • Key: secret information for encryption.
  • Symmetric key encryption: one key for both.
  • Public key encryption: public key to encrypt, private key to decrypt.

MCQs

  • 120 minutes, 70 questions, 70% of score.
  • Pace yourself (1.7 min/question).
  • Skip confusing questions.
  • No guessing penalty.
  • Read reference sheet.
  • Practice questions.

Performance Task

  • 9 hours, 30% of score.
  • Work ahead of time.
  • Review scoring guidelines.
  • View sample responses.
  • Avoid plagiarism.
  • Be confident.