AP Computer Science Principles Study Guide

Unit 1: The Internet

Lesson 1: Personal Innovations

  • Innovation: A new or improved idea, device, or product.
  • Computer Science impacts various fields like energy, fashion, and medicine.

Lesson 2: Sending Binary Messages

  • Binary: A number system using only 1 and 0.
  • Bit: Short for "binary digit," the single unit of information in a computer.
  • Binary questions have two answers (e.g., Yes/No).

Lesson 3: Sending Binary Messages with the Internet Simulator

  • Bandwidth: Transmission capacity measured by bit rate.
  • Bit rate: Number of bits conveyed or processed per unit of time (e.g., 8 bits/sec).
  • Latency: Time for a bit to travel from sender to receiver.
  • Protocol: Rules directing data transmission between devices.
  • Internet: A physical system for moving information using wires, cables, and Wi-Fi.
  • Internet delivers information in bits, similar to a postal system.
  • 8 bits = 1 byte, 1024 bytes = 1 kilobyte, 1024 kilobytes = 1 megabyte.
  • Methods to send bits: Electricity, Light and Radio.
  • Bandwidth increases the number of bits sent per second.

Lesson 4: Number Systems

  • Number systems rely on place patterns and rules for accuracy.

Lesson 5: Binary Numbers

  • The binary number system uses only 0s and 1s.

Lesson 6: Sending Numbers

  • Protocol: Rules governing data exchange between devices.

Lesson 7: Sending Text

  • Abstraction: A simplified representation of complexity.
  • ASCII: American Standard Code for Information Interchange.
  • Protocol: Rules governing data exchange between devices.

Lesson 8: The Internet

  • IETF: Internet Engineering Task Force, develops Internet standards and protocols (TCP/IP).
  • Internet: A computer network providing information and communication services.
  • Net Neutrality: All Internet traffic should be treated equally by ISPs.
  • The Internet is composed of independently operated networks.

Lesson 9: The Need for Addressing

  • IP Address: A number assigned to any item connected to the Internet.
  • Packet: A small block of information sent over a network.
  • Protocol: Rules governing data exchange between devices.
  • IP Addresses & DNS
    • Internetworking protocol created by Vint Cerf and Bob Kahn.
    • IP (Internet Protocol) Address.
    • Traditional IP addresses are 32 bits long.
      • IPv4 has 4 billion unique addresses.
    • IPv6 is advanced with 340 undecillion unique IP Addresses.
    • DNS associates website names with IP addresses.
  • 2^6 = 64 unique IP addresses can be made in a fixed length IP address system using 6 bits.

Lesson 10: Routers and Redundancy

  • Network Redundancy: Multiple backups to ensure reliability.
  • Router: A computer that forwards data across a network.
  • Packets may be rerouted many times.
  • A packet contains addressing information for routing.

Lesson 11: Packets and Making a Reliable Internet

  • Packets: Small chunks of information.
  • TCP: Transmission Control Protocol, provides reliable, ordered, error-checked delivery of packets.
  • Information travels in packets that take various routes.
  • Routers manage packet flow efficiently.
  • TCP manages sending and receiving data to ensure delivery.
  • Fault tolerant: not many errors since there are many paths (Reliability)

Lesson 12: The Need for DNS

  • DNS: Domain Name System, translates domain names to IP addresses.

Lesson 13: HTTP and Abstraction

  • DNS: Translates domain names to IP addresses.
  • HTTP: HyperText Transfer Protocol, transmits web pages.
  • URL: Easy-to-remember address for a web page.
  • HTTP requests use abstractions provided by lower-level protocols.
  • Displaying a webpage requires multiple HTTP requests.

Unit 2: Digital Information

Lesson 1: Bytes and File Sizes

  • 1 photo is about 2-5 megabytes.

Lesson 2: Text Compression

  • Heuristic: A problem-solving approach to find a satisfactory solution.
  • Lossless Compression: Allows original data to be perfectly reconstructed.
  • Lossy Compression: Discards some data using approximations (e.g., .jpg).

Lesson 3: Encoding B&W Images

  • Image: Data for graphics or pictures.

Lesson 4: Encoding Color Images

  • Pixel: Short for "picture element", the fundamental unit of a digital image.
  • RGB: Color model using intensities of Red, Green, and Blue.
  • Hexadecimal: A base-16 number system (0-9 and A-F).

Lesson 5: Lossy vs Lossless Compression

  • Lossless Compression: Allows perfect reconstruction of original data.
  • Lossy Compression: Uses approximations, discarding some data.
  • Metadata: Data that describes other data.

Abstraction

  • Abstraction reduces detail to focus on relevant concepts.

Algorithm

  • Algorithm: is a precise sequence of instructions for a process that can be executed by a computer.

Unit 3: Intro to Programming

Lesson 1: The Need for Programming Languages

Lesson 2: The Need for Algorithms

  • Algorithm: A list of steps to finish a task.
  • High Level Programming Language: A programming language with many commands and features designed to make common tasks easier to program.
  • Low Level Programming Language: A programming language that captures only the most primitive operations available to a machine.

Lesson 3: Creativity in Algorithms

  • Algorithm: A list of steps to finish a task.
  • Iterate: Repeat to achieve a goal.
  • Selection: An if-statement that uses a Boolean condition to determine.
  • Pair Programming: Two programmers write code using a single computer.

Lesson 4: Using Simple Commands

  • Turtle Programming: commands to control movement and drawing of an on-screen robot called a "turtle".

Lesson 5: Creating Functions

  • Abstraction: Hiding details to manage complexity.
  • Function: A named bit of programming instructions.
  • Steps to creating functions in JavaScript
    • Defined the function (give a single name to represent the set of actions)
    • Call it (type the name of the function followed by a parentheses)
  • Defining a function:
    • function [function name] () {
    • [write commands/steps] }
  • Calling a function:
    • [function name] ();
  • Generic term is procedure.
  • Give functions meaningful names.

Lesson 6: Functions and Top-Down Design

  • Abstraction: A simplified representation of something more complex.
  • Function: A named bit of programming instructions.
  • Top-Down Design: Break a system to gain insight into the subsystems that make it up

Lesson 7: APIs and Function Parameters

Lesson 8: APIs and Function Parameters

  • API: Application Program Interface, a collection of available commands.
  • Documentation: Description of a command's behavior.
  • Library: Commands/functions with a shared purpose.
  • Parameter: Extra information passed to a function to customize it.
  • Generalized behavior of repetition per function can be represented with the parameter.
  • Parameters help generalize the solution.

Lesson 9: Looping and Random Numbers

  • For Loop: Loops that have a predetermined beginning, end, and increment (step interval).
  • Loop: Repeating an action.

Unit 4: Big Data and Privacy

Lesson 1: What is Big Data?

  • Big Data: Datasets too large or complex for traditional processing.

Lesson 2: Finding Trends with Visualization

Lesson 3: Check your assumptions

Lesson 4: Rapid Research- Data Innovations

  • Code is used in medicine.
  • Everyone has a sequence of DNA, this is how we can identify any viruses or diseases visible in a person’s DNA

Lesson 5: Identifying People with Data

  • Computing Innovation: A program using code as an essential part of its functionality.

Lesson 6: The Cost of Free

Lesson 7: Simple Encryption

  • Caesar Cipher: Shifts the alphabet by a certain number of characters for encryption.
  • Cipher: A technique that performs encryption.
  • Cracking encryption: Attempting to decode a secret message without knowing the cipher details.
  • Decryption: Reversing encryption.
  • Encryption: Encoding messages to keep them secret.
  • Random Substitution Cipher: Maps each letter to a randomly chosen letter.

Lesson 8: Encryption with Keys and Passwords

  • Computationally Hard: A problem a computer can't solve in a reasonable time.
  • Encryption: Hiding a message.
  • Decryption: Unscrambling a message.
  • Caesar cipher Associates each number in the alphabet with a certain Number of steps below or above a certain letter.

Lesson 9: Public Key Crypto

  • Symmetric encryption: the same key used to encrypt and decrypt.
  • Asymmetric encryption: Different keys for encrypting and decrypting
    • Public key: shared with everybody so anybody can encrypt a message.
    • Private key: can only be decrypted by a computer with access.

Lesson 10: Rapid Research- Cybercrime

  • Antivirus Software: usually keeps big lists of known viruses and scans your computer looking for the virus programs in order to get rid of them.
  • DDoS Attack: Distributed Denial of Service Attack
  • Firewall - software that runs on servers (often routers) that only allows traffic through according to some set of security rules.
  • Phishing Scam - a thief trying to trick you into sending them sensitive information
  • SSL/TLS: Secure Sockets layer/ Transport Layer Security
  • Cybercrime exploits vulnerabilities and causes problems for families, society, financially, and with national security.

Unit 5: Building Apps

Chapter 1: Event-Driven Programming

Lesson 1: Buttons and Events

  • Callback function: Function called by the system after an event.
  • Event: An action that causes something to happen.
  • Event-driven program: Program that runs code in response to events.
  • Event handling: Coding tasks to make a program respond to events.
  • Event listener: Command triggering a function upon an event.
  • UI Elements: On-screen objects like buttons and images.
  • User Interface: Visual elements for user control.

Lesson 2: Multi-Screen apps

  • setScreen (screenId) is used to set a screen to a particular one of the screens in the app

Lesson 3: Building an App: Multi-Screen App

Lesson 4: Controlling Memory with Variables

  • Debugging: Finding and fixing program problems.
  • Data Type: A single value of either TRUE or FALSE
  • Expression: Any code that resolves to a value

Lesson 5: Build an App: Clicker Game

  • = = - The equality operator is used to compare two values and returns a Boolean.
  • Global Variable - A variable whose scope is "global" to the program

Lesson 6: User Input and Strings

  • setText(id,text) sets the text for the specified screen element.
  • If-Statement - The common programming structure that implements "conditional statements".
  • Local Variable - A variable with local scope is one that can only be seen, used and updated by code within the same scope.
  • Concatenate - to link together
  • String - Any sequence of characters between quotation marks

Lesson 7: "If" Statements Unplugged

  • setText(id,text) sets the text for the specified screen element.

Lesson 8: Boolean Expressions and “If” Statements

  • Boolean - A single value of either TRUE or FALSE
  • Boolean Expression - in programming, an expression that evaluates to True or False.

Lesson 9: "if-else-if" and Conditional Logic

  • Boolean - A single value of either TRUE or FALSE
  • Boolean Expression - in programming, an expression that evaluates to True or False.

Chapter 2: Programming with Data Structures

Lesson 10: Building an App: Color Sleuth

Lesson 11: While Loops

Lesson 12: Loops and Simulations

  • Iterate - To repeat in order to achieve, or get closer to, a desired goal.
  • while loop - a programming construct used to repeat a set of commands (loop) as long as (while) a boolean condition is true.

Lesson 13: Introduction to Arrays

  • Array - A data structure in JavaScript used to represent a list.
  • List - A generic term for a programming data structure that holds multiple items.

Lesson 14: Building an App: Image Scroller

Lesson 15: Processing Arrays

  • for loop - A typical looping construct designed to make it easy to repeat a section of code using a counter variable.

Lesson 16: Functions with Return Values

  • Return Value - A value sent back by a function to the place in the code where the function was called from

Lesson 17: Building an App: Canvas Painter