Exploring Computer Science – Comprehensive Midterm Notes

Planning / Problem-Solving Process

  • Ordered Steps (know exact sequence)
    • Define / Understand the Problem – clarify goals, constraints, stakeholders.
    • Research & Generate Ideas – gather information, data, prior solutions.
    • Brainstorm / Make a Plan – sketch multiple approaches; select tools, timeline.
    • Explore Possibilities – prototype, simulate, weigh pros & cons.
    • Select an Approach / Carry Out the Plan – implement chosen solution.
    • Reflection / Review – test, evaluate results, document lessons learned.

Computer Fundamentals

Core Definitions

  • Computer – “one that computes; a programmable electronic device that can store, retrieve, and process data.”
  • Computing – “to determine or calculate, especially by mathematical means or by using a computer.”

Major Hardware / Software Components

  • Central Processing Unit (CPU)
    • Executes basic operations, exchanges data with memory & peripherals, orchestrates everything else.
  • Operating System (OS)
    • The master program that manages hardware, files, user interface, and provides a platform for other programs.
  • Memory (RAM)
    • Temporarily stores data / instructions for quick CPU access; volatile.
  • Hard Drive (Mass Storage)
    • Long-term, non-volatile storage using magnetic platters (HDD) or flash (SSD).
    • SSD vs. HDD
    • SSD – Pro: speed, small size; Con: cost.
    • HDD – Pro: low cost, availability; Con: slower, larger physical size.
  • Optical Disk Drive – Uses laser/electromagnetic waves to read/write CDs, DVDs, Blu-ray.
  • Monitor – Video display screen.
  • Video Card (GPU) – Generates the visual output sent to a monitor.
  • Sound Card – Generates or reproduces audio; interfaces with speakers.
  • Keyboard – Primary text input device.
  • Mouse – Hand-held pointing device that controls on-screen pointer.
  • Modem – Converts digital computer signals to analog telephone (or other medium) and back.

World Wide Web & Search Engines

  • Web 1.0 vs. Web 2.0
    • Web 1.0 – static pages, read-only, minimal user interaction.
    • Web 2.0 – dynamic, user-generated content, social networking, collaboration.
  • Search Engine – Program that indexes the web and returns ranked pages matching a query.
    • Main players: Google, Bing, Yahoo, DuckDuckGo, Baidu, Yandex.
  • Search Syntax (symbols / keywords)
    • Combine keywords → AND or implicit space.
    • Exclude words / sites → -keyword or site:-example.com.
    • Weather for location → weather city (e.g., weather Boston).
    • Dictionary definition → define:word.
  • Website Evaluation Criteria
    • Accuracy – correctness, verifiable sources.
    • Authority – author’s credentials, domain reputation.
    • Objectivity – bias, purpose (inform/persuade/sell).
    • Accessibility – ease of use, navigation, ADA compliance, load speed.

Computer Programs

  • Program – a set of instructions that tell a computer what to do.

Artificial Intelligence (AI)

  • Turing Test – Proposed by Alan Turing; if a human interrogator cannot distinguish the machine’s responses from a human’s, the machine is said to exhibit intelligence.
  • Artificial Intelligence – The field concerned with making computers perform tasks that normally require human intelligence.
  • Key AI Capabilities
    • Acoustic Processing – handling sound waves, filtering noise.
    • Speech Recognition – converting spoken words to text.
    • Facial Recognition – identifying or verifying persons from images.

Binary Number System

  • Concept – base-2 system using digits 00 and 11.

Decimal → Binary (LEFT → RIGHT)

  • Show card = 1, hide card = 0.
  • Example: 311031_{10}
    • 16+8+4+2+1=3116 + 8 + 4 + 2 + 1 = 31 → binary: 1111111111.

Binary → Decimal (LEFT → RIGHT)

  • Example: 11111211111_2 → 16+8+4+2+1=3116 + 8 + 4 + 2 + 1 = 31.

Capacity Rule

  • “Add 1 bit, double patterns.” Mathematically: 2n2^n patterns for nn bits.
    • 1 bit → 2
    • 2 bits → 4
    • …
    • 8 bits → 256 (one byte)

Decoding Messages

  • Convert binary to decimal, map to alphabet table (1 = a, 2 = b, … 26 = z).

Graph Theory: Spanning Trees

  • Spanning Tree – A sub-graph that connects all vertices with the minimum possible edges (no cycles).
  • The sample graph shown has 16 possible spanning trees.
  • Minimum Spanning Tree (MST) – Spanning tree whose total edge weight is minimum; useful in networking, circuit design, clustering, route planning.

Programming Concepts (Code.org)

Debugging

  • Process of locating & fixing errors (bugs) that prevent correct software operation.

Coordinate System (Game Lab)

  • Uses XX (horizontal) & YY (vertical) coordinates.
  • Screen origin: top-left (0,0)(0,0).

Variables

  • Container for data.
  • Naming Rules
    • No spaces.
    • Cannot start with number.
    • Case-sensitive; spelling must be exact.
  • Style
    • camelCase: sizeOfRectangle.
    • underscores: size_of_rectangle.
    • Choose meaningful names; maintain consistency.

Boolean Logic & Conditionals

  • Boolean value – true\text{true} / false\text{false}.
  • Comparison Operators
    • Less-than <<, greater-than >>, equal ====.
  • Conditional Statements
    • if (condition) {…}
    • if … else … – choose between two code blocks.

Draw Loop & Animation

  • Program flow in Game Lab
    1. Run all code outside draw() once.
    2. Execute code inside draw() repeatedly (~30 frames per second).
  • Definitions
    • Animation – series of images (frames) creating motion.
    • Frame – single image.
    • Frame Rate – frames per second.
  • Randomness
    • Pseudo-random – algorithmic.
    • True random – physical process.
  • Velocity Blocks
    • velocityX, velocityY change position automatically each frame.
    • Equivalent to counter pattern: sprite.x = sprite.x + 1;.

Functions

  • Group of commands given a name; enables reuse.
  • Creating – wrap commands in a function block, give it a name.
  • Calling – write functionName(); wherever needed.
  • Advantages
    1. Organizes code (large blocks can sit out of the way).
    2. Improves readability (names explain purpose).
    3. Removes repetition (change code in one place).