Table of Contents
Vocab
Abstraction
The most fundamental idea in computer science, giving a name to something in a program to make it more readable.
Procedural abstraction
Using a procedure to name an idea, ex. the procedure "who" to the idea of picking an item from the list of people or cats.
How not to do pair programming:
A table is a two-dimensional data structure with rows and columns. If you've used a spreadsheet program, what it displays is a table.
In Snap!, a table is implemented as a list of lists, in which each sublist is one row of the table.
## Important Blocks
broadcast
Sends a message to all the sprites. To set the message, click the down arrow and select "new..."
when I receive
(Click help on the block to learned more about it in order to complete this definition)
The list expression list{Señora, Ms. C, my cat, Hannah, Jake} would be written as [Señora, Ms. C, my cat, Hannah, Jake]. The items are positioned in the list in the order they appear in the text: "Señora" has index 1, "Ms. C" has index 2, and so on.
The assignment instruction set (shopping list) to (list) would be written as shoppingList ← [] or shoppingList ← [].
The assignment instruction set (shopping list) to {apples, bread, carrots, rice, pasta} would be written as shoppingList ← [apples, bread, carrots, rice, pasta] or shoppingList ← [apples, bread, carrots, rice, pasta]. (In this app, you'll want the shopping list to begin empty, and then the user will add or insert additional grocery items one at a time.)
insert (tomatoes) at (2) of (shopping list) would be written as INSERT(shoppingList, 2, "tomatoes") or INSERT(shoppingList, 2, 'tomatoes').
add (tomatoes) to (shopping list) would be written as APPEND(shoppingList, "tomatoes") or APPEND(shoppingList, 'tomatoes').
would be written as REMOVE(shoppingList, 2) or
When you run this script in Snap!, the second line of code assigns to shopping list 2 the value of shopping list (that is, the same list, not a copy). So, the third line of code modifies both variables:
set(shopping list) to (list(apple)(banana))
set(shopping list 2) to (shopping list)
add (carrot) to (shopping list) shopping list watcher showing the contents of the variable to be apple, banana, carrot; and the shopping list 2 watcher showing the contents of the variable to be apple, banana, carrot
However on the exam, the statement shoppingList2 ← shoppingList makes a copy of the list. So modifying one of them does not modify the other.
The rules for how to use lists and how they behave differ depending on the programming language you are using.
## On the AP Exam
- Many languages (and the AP CS Principles Exam) use return instead of report as the name of the command to give a value back at the end of a function call.
- The exam uses "value of a procedure" to mean the value the procedure returns when called. For example, "the value of double(5)" means 10.
## Markdown Style Guide for Coding Notebooks
Follow this guide to keep your coding notebook **clear, consistent, and professional**.
This ensures your notes are easy for you (and others) to read later.
---
## Headings
**When to use:** Organize your notebook into sections (like days, topics, or projects).
- `#` for the notebook title (use once at the top).
- `##` for each day or major topic.
- `###` for subsections (like "Notes", "Practice", "Reflections").
# Example:
# My Coding Notebook
## Day 1
### Notes
### Practice
# Text Formatting
When to use: Highlight important ideas or add emphasis.
Use bold for key terms or definitions.
Use italic for emphasis or side comments.
Use inline code for keywords, functions, or commands.
# Example:
**Class** = a blueprint for objects
*Remember:* always test your code
Use `System.out.println()` to print
# Code Blocks
When to use: Anytime you write multiple lines of code.
Inline code for short snippets.
Fenced code blocks with language for full examples.
# Example:
```java
public class Hello {
public static void main(String[] args) {
System.out.println("Hello World!");
}
}
```
# Lists
When to use: Organize steps, notes, or key points.
Numbered lists for sequences or steps.
Bulleted lists for unordered ideas.
# Example:
Define the class
Write the main method
Test your program
Variables
- Loops
- Conditionals
# Checklists
When to use: Track progress on assignments or tasks.
# Example:
[x] Complete coding warm-up
- [ ] Finish project draft
- [ ] Reflect on learning
# Blockquotes
When to use: Call out notes, reminders, or teacher comments.
# Example:
> 💡 Remember: Loops repeat code until a condition is false.
# Tables
When to use: Compare values, track progress, or organize data neatly.
# Example:
| Task | Status | Notes |
|--------------|------------|-----------------|
| Homework 1 | Done # | Submitted |
| Homework 2 | Pending | Needs review |
# Links & Images
When to use: Add references, resources, or visuals.
# Example:
[Java Docs](https://docs.oracle.com/javase/8/docs/api/)

To make an image that is a link, paste the image, then add the following before it, replacing website address with the link:
And after the image info, add:
# Collapsible Sections
When to use: Hide solutions, extended notes, or extra details.
# Example:
Click to reveal solution
System.out.println("Answer: 42");
# Footnotes
When to use: Add references or side notes without cluttering the page.
# Example:
This concept is related to object-oriented programming.[^1]
[^1]: See "Objects and Classes" in your textbook.
# Style Rules
Consistency matters more than creativity
Always use headings to structure your notes.
Always use code blocks for multi-line code.
Clarity first
Bold key terms.
Use lists instead of long sentences when outlining steps.
Professional tone
Don’t mix casual notes with formal work in the same section.
Use blockquotes for reflections or teacher feedback.
Track your learning
Use checklists to mark what’s done.
Use collapsible sections if you want to hide answers until review time.
# Bottom Line:
Headings = Structure
Bold/Italic = Emphasis
Code blocks = Code
Lists = Steps/Ideas
Tables = Organization
Checklists = Progress
Blockquotes = Notes/Tips
Collapsible = Hide/Show detail
Keep it simple, consistent, and clear.