WELCH TEACHING & COACHING · AP Computer Science AWebsite → Cortado → AP Classroom → Workbook
AP Computer Science A · Unit 1

Data, Variables & Java Foundations

A unified eight-lesson sequence linking our website explanations, CodeHS Cortado coding activities, AP Classroom topic videos, and the student learning workbook.

8 aligned lessons38-page workbookSTRIDES guided notesVisual algorithm models
↓ Download Student Workbook (PDF)See how the unit works
How to use this unitSTRIDES notesLesson roadmap1.11.21.31.41.51.61.71.8Motion LabReview
Start here · Workbook pages 2–4

How to use this unit

Your website is the map. CodeHS and AP Classroom are resource libraries; the workbook records your thinking. Follow this loop for every lesson.

Open the website lessonRead examples & watch videosComplete notes and predictCode and test in CodeHSResult matchesyour prediction?Reflect & check your trackerTrace, debug,retestYESNONext lesson

The same routine every time

  1. Open the website lesson and read the worked model.
  2. Watch the selected CodeHS/AP Daily videos.
  3. Record STRIDES vocabulary and notes.
  4. Predict, illustrate, write pseudocode and trace.
  5. Code in CodeHS, test, debug and reflect.

If the two platforms use a different order

Do not work straight through a CodeHS module just because it appears next. Use the specific activities listed in this website lesson or assigned by your teacher. AP Daily topics are listed by official number.

Do not start the complete AP Unit 1 progress check yet: object creation and instance methods are taught in our later Unit 3.

Workbook pages 5–7

STRIDES: turn examples into lasting notes

Each letter has a programming purpose. Your notes should include a rule, a visual model and a worked example — not just a copied definition.

SSubject
TTopic
RRules
IIllustrations
DDefinitions
EExample
SSteps

A modeled note: variable update

Java statement
int laps = 3;
laps = laps + 1;
Before: laps = 3→After: laps = 4

Rule: evaluate the right side first. Steps: choose type → declare → assign → trace.

Good reflection vs. weak reflection

Weak: “I finished the activity.”

Strong: “I thought 7/2 would print 3.5. When it printed 3, I realized both values were integers. I changed one operand to 2.0 and retested.”

Write what you predicted, observed, changed and learned.

Pseudocode is a plan: use steps such as INPUT distance, speed ← distance/time, DISPLAY speed. It is not expected to use exact Java syntax. The next stage is converting the plan to code.
Workbook page 8

Eight-lesson assignment roadmap

Follow our lesson numbers even when the referenced CodeHS topics appear in other parts of the platform.

Our lessonWebsite topicSelected CodeHS activitiesAP Classroom topicsWorkbook
1.1Algorithms & First Java Program1.1.1 Introduction to Algorithms; 1.1.3 Basic Java Program Structure; 1.1.7 Welcome Program; 1.1.10 Debugging: Quotes1.19–11
1.2Variables & Data Types1.2.1–1.2.2 Variables and Primitive Data Types; 1.2.11 Variables About You1.212–14
1.3Expressions & Output1.3.7 Arithmetic Expressions; 1.3.9 Tricky Integer Division; 1.3.13 Exploration: Temperature Conversion1.315–17
1.4Assignment, Input & Updates1.4.1 Assignment Statements; 1.4.6 User Input; 1.6.5 Basketball Stats Simplification1.4, 1.618–20
1.5Casting & Numerical Precision1.5.2 Casting Example; 1.5.3 Casting Order of Operations; 1.5.8 Range of Variables; 1.5.9 Integer Overflow1.521–23
1.6Strings & Combining Data1.2.7 Reference Data Types and Strings; 1.15.1 String Concatenation; 1.15.3 Concatenating Primitives1.2, intro 1.1524–26
1.7Libraries, Methods & Documentation1.7.5 Navigating an API; 1.8.4 Bank Account Comments; 1.9.1 Method Signatures; 1.10.2 Basic Calculator; 1.11.3 Exploring the Math Class API1.7–1.1127–30
1.8Vertical Motion Calculator1.4.5 Freely Falling Bodies (supporting activity); website Vertical Motion Calculator projectApplication: 1.1–1.1131–34
Teacher selection: these are vetted activity references, not an automatic requirement to complete every listed exercise. AP Classroom video titles and assignments must be finalized in the teacher account.

Student progress

0 of 8 lessons marked complete on this browser.

Lesson 1.1 · Workbook pages 9–11

Algorithms & First Java Program

AP Topic(s) 1.1

Learning target: Represent an algorithm as ordered steps; explain how Java source is compiled and executed; identify syntax and logic errors.

Follow your assigned resources

1. Website: Read this lesson and study the worked model. 2. CodeHS Cortado: 1.1.1 Introduction to Algorithms; 1.1.3 Basic Java Program Structure; 1.1.7 Welcome Program; 1.1.10 Debugging: Quotes.

3. AP Classroom: Topic(s) 1.1; watch the AP Daily video(s) your teacher assigns. 4. Workbook: complete pages 9–11 before the reflection.

Open CodeHS lesson · Open AP Classroom

Understand the idea

A program is a sequence of exact instructions. Java source is checked and translated by a compiler before it runs on the Java Virtual Machine.

Worked Java example
public class Main {
    public static void main(String[] args) {
        System.out.println("Start");
        System.out.println("Ready");
    }
}
Expected output Start Ready

Illustrate / model

Java source→Compiler→Bytecode / JVM→Output

Thinking before coding

Vocabulary for your STRIDES notes:

algorithmsequencecompilersyntax errorlogic error

Pseudocode model

START DISPLAY "Start" DISPLAY "Ready" END

Practice questions

What happens if the two println statements are reversed?

The output order is reversed: Ready, then Start.

Why does missing a quotation mark stop compilation?

It violates Java syntax, so the compiler rejects the source code.

In your workbook: Draw the program lifecycle: write, compile, fix errors if needed, execute, check output.
Finish the learning cycle: Complete the selected CodeHS programming activities; compare actual results with predictions; explain one change or error in the workbook before advancing.
Lesson 1.2 · Workbook pages 12–14

Variables & Data Types

AP Topic(s) 1.2

Learning target: Choose types; declare and initialize variables; visualize stored values; predict updates.

Follow your assigned resources

1. Website: Read this lesson and study the worked model. 2. CodeHS Cortado: 1.2.1–1.2.2 Variables and Primitive Data Types; 1.2.11 Variables About You.

3. AP Classroom: Topic(s) 1.2; watch the AP Daily video(s) your teacher assigns. 4. Workbook: complete pages 12–14 before the reflection.

Open CodeHS lesson · Open AP Classroom

Understand the idea

Primitive variables store a value. A String is a reference type. Each assignment evaluates the right side and stores the result in the variable on the left.

Worked Java example
int laps = 3;
double pace = 6.5;
String runner = "Maya";
laps = laps + 1;
System.out.println(laps);
Expected output 4

Illustrate / model

laps: 3→ assign +1 →laps: 4

Each assignment replaces the value stored in the named location.

Thinking before coding

Vocabulary for your STRIDES notes:

intdoublebooleanStringdeclareinitialize

Pseudocode model

SET laps ← 3 SET pace ← 6.5 laps ← laps + 1 DISPLAY laps

Practice questions

Which data type represents elapsed seconds measured to tenths?

double, because the value may have a fractional part.

If int a=4; int b=a; b=7;, what is a?

4: primitive variables have separate stored values.

In your workbook: Draw memory boxes for laps and pace before and after an update.
Finish the learning cycle: Complete the selected CodeHS programming activities; compare actual results with predictions; explain one change or error in the workbook before advancing.
Lesson 1.3 · Workbook pages 15–17

Expressions & Output

AP Topic(s) 1.3

Learning target: Evaluate arithmetic and output expressions; distinguish integer division, modulus, and decimal division.

Follow your assigned resources

1. Website: Read this lesson and study the worked model. 2. CodeHS Cortado: 1.3.7 Arithmetic Expressions; 1.3.9 Tricky Integer Division; 1.3.13 Exploration: Temperature Conversion.

3. AP Classroom: Topic(s) 1.3; watch the AP Daily video(s) your teacher assigns. 4. Workbook: complete pages 15–17 before the reflection.

Open CodeHS lesson · Open AP Classroom

Understand the idea

Operator precedence and operand types determine results. int/int produces an integer quotient, while % produces the remainder.

Worked Java example
System.out.println(2 + 3 * 4);
System.out.println(17 / 5);
System.out.println(17 % 5);
System.out.println(17 / 5.0);
Expected output 14 3 2 3.4

Illustrate / model

17 ÷ 5→quotient: 3andremainder: 2

Thinking before coding

Vocabulary for your STRIDES notes:

expressionliteralprecedenceinteger divisionmodulus

Pseudocode model

INPUT totalSeconds minutes ← totalSeconds / 60 (whole number) seconds ← totalSeconds % 60 DISPLAY minutes and seconds

Practice questions

What is 29 % 6?

5, since 29 = 6×4 + 5.

What expression gets the decimal result of 7 divided by 2?

7.0 / 2 or (double) 7 / 2 gives 3.5.

In your workbook: Create a quotient-and-remainder algorithm for converting seconds into minutes and seconds.
Finish the learning cycle: Complete the selected CodeHS programming activities; compare actual results with predictions; explain one change or error in the workbook before advancing.
Lesson 1.4 · Workbook pages 18–20

Assignment, Input & Updates

AP Topic(s) 1.4, 1.6

Learning target: Trace assignments and compound assignments; read values with Scanner; model input, process and output.

Follow your assigned resources

1. Website: Read this lesson and study the worked model. 2. CodeHS Cortado: 1.4.1 Assignment Statements; 1.4.6 User Input; 1.6.5 Basketball Stats Simplification.

3. AP Classroom: Topic(s) 1.4, 1.6; watch the AP Daily video(s) your teacher assigns. 4. Workbook: complete pages 18–20 before the reflection.

Open 4665 · Open 4667 · Open AP Classroom

Understand the idea

A variable update changes stored state. Scanner lets a program accept input; operators such as += and *= are concise update forms.

Worked Java example
int score = 90;
score += 5;
score *= 2;
score--;
System.out.println(score);
Expected output 189

Illustrate / model

90+5 →95×2 →190−1 →189

Thinking before coding

Vocabulary for your STRIDES notes:

assignmentScannerinputcompound assignmentincrement

Pseudocode model

INPUT distance INPUT elapsedTime speed ← distance / elapsedTime DISPLAY speed with units

Practice questions

What prints if the update order is reversed (multiply, then add, then subtract)?

184, because 90×2+5−1 = 184.

What does total += 5 mean?

total = total + 5, using the previous total value.

In your workbook: Design an input-process-output model for distance/time = speed.
Finish the learning cycle: Complete the selected CodeHS programming activities; compare actual results with predictions; explain one change or error in the workbook before advancing.
Lesson 1.5 · Workbook pages 21–23

Casting & Numerical Precision

AP Topic(s) 1.5

Learning target: Predict conversions, truncation, integer overflow and finite precision.

Follow your assigned resources

1. Website: Read this lesson and study the worked model. 2. CodeHS Cortado: 1.5.2 Casting Example; 1.5.3 Casting Order of Operations; 1.5.8 Range of Variables; 1.5.9 Integer Overflow.

3. AP Classroom: Topic(s) 1.5; watch the AP Daily video(s) your teacher assigns. 4. Workbook: complete pages 21–23 before the reflection.

Open CodeHS lesson · Open AP Classroom

Understand the idea

Casting changes how expressions are evaluated. When integer division happens before an assignment to double, fractional information is already lost.

Worked Java example
int correct = 17;
int total = 20;
double wrong = correct / total;
double right = (double) correct / total;
System.out.println(wrong);
System.out.println(right);
Expected output 0.0 0.85

Illustrate / model

17/20 → 0 → 0.0vs.(double)17/20 → 0.85

Thinking before coding

Vocabulary for your STRIDES notes:

casttruncationpromotioninteger overflowround-off error

Pseudocode model

INPUT correct, total percentage ← 100.0 * correct / total DISPLAY percentage

Practice questions

What is (int) -3.9?

-3: casting to int truncates toward zero.

Why is double pct = correct/total not enough?

The int division runs first and discards the fraction.

In your workbook: Create a type-flow diagram comparing 17/20 with (double)17/20.
Finish the learning cycle: Complete the selected CodeHS programming activities; compare actual results with predictions; explain one change or error in the workbook before advancing.
Lesson 1.6 · Workbook pages 24–26

Strings & Combining Data

AP Topic(s) 1.2, intro 1.15

Learning target: Distinguish Strings from primitive values; trace concatenation and format meaningful outputs.

Follow your assigned resources

1. Website: Read this lesson and study the worked model. 2. CodeHS Cortado: 1.2.7 Reference Data Types and Strings; 1.15.1 String Concatenation; 1.15.3 Concatenating Primitives.

3. AP Classroom: Topic(s) 1.2, intro 1.15; watch the AP Daily video(s) your teacher assigns. 4. Workbook: complete pages 24–26 before the reflection.

Open 4663 · Open 4676 · Open AP Classroom

Understand the idea

The + operator adds numeric operands but concatenates when String text is involved. Parentheses control when arithmetic occurs.

Worked Java example
System.out.println(2 + 3 + " meters");
System.out.println("meters: " + 2 + 3);
System.out.println("meters: " + (2 + 3));
Expected output 5 meters meters: 23 meters: 5

Illustrate / model

"meters: " + 2→"meters: 2" + 3→"meters: 23"

Thinking before coding

Vocabulary for your STRIDES notes:

Stringconcatenationreference typeescape sequence

Pseudocode model

INPUT name, distance DISPLAY "Athlete: " + name DISPLAY "Distance: " + distance + " m"

Practice questions

What prints for "A" + 1 + 2?

A12, because left-to-right concatenation begins with a String.

How can you make "Total: " + 2 + 3 print Total: 5?

Use "Total: " + (2 + 3).

In your workbook: Plan a readable two-line report with athlete name, distance and units.
Finish the learning cycle: Complete the selected CodeHS programming activities; compare actual results with predictions; explain one change or error in the workbook before advancing.
Lesson 1.7 · Workbook pages 27–30

Libraries, Methods & Documentation

AP Topic(s) 1.7–1.11

Learning target: Use API documentation, identify method signatures and return values, call Math class methods and write useful comments.

Follow your assigned resources

1. Website: Read this lesson and study the worked model. 2. CodeHS Cortado: 1.7.5 Navigating an API; 1.8.4 Bank Account Comments; 1.9.1 Method Signatures; 1.10.2 Basic Calculator; 1.11.3 Exploring the Math Class API.

3. AP Classroom: Topic(s) 1.7–1.11; watch the AP Daily video(s) your teacher assigns. 4. Workbook: complete pages 27–30 before the reflection.

Open 0538 · Open 4669 · Open 4670 · Open 4671 · Open 4672 · Open AP Classroom

Understand the idea

A method accepts arguments through parameters and may return a value. API documentation describes its purpose, inputs and return type.

Worked Java example
double root = Math.sqrt(49.0);
double cube = Math.pow(2.0, 3.0);
System.out.println(root);
System.out.println(cube);
Expected output 7.0 8.0

Illustrate / model

Argument: 49.0→Math.sqrt( )→Return: 7.0

Thinking before coding

Vocabulary for your STRIDES notes:

APIlibrarymethodsignatureparameterargumentreturn valuecomment

Pseudocode model

INPUT value root ← Math.sqrt(value) DISPLAY root

Practice questions

What type does Math.sqrt return?

double, even when the square root is mathematically a whole number.

Why is a comment like // gravity is positive here useful?

It describes an assumption that may be unclear from the formula alone.

In your workbook: Illustrate a Math.sqrt call: argument enters the method, the result returns, and the caller stores it.
Finish the learning cycle: Complete the selected CodeHS programming activities; compare actual results with predictions; explain one change or error in the workbook before advancing.
Lesson 1.8 · Workbook pages 31–34

Vertical Motion Calculator

AP Topic(s) Application: 1.1–1.11

Learning target: Design, implement and test a vertical-motion calculator with pseudocode, a flowchart and a prediction table.

Follow your assigned resources

1. Website: Read this lesson and study the worked model. 2. CodeHS Cortado: 1.4.5 Freely Falling Bodies (supporting activity); website Vertical Motion Calculator project.

3. AP Classroom: Topic(s) Application: 1.1–1.11; watch the AP Daily video(s) your teacher assigns. 4. Workbook: complete pages 31–34 before the reflection.

Open CodeHS lesson · Open AP Classroom

Understand the idea

Use vertical displacement y = v₀t − 0.5gt². Initial upward velocity is positive; g is the positive magnitude of downward acceleration (usually 9.8 m/s²).

Worked Java example
double v0 = 20.0;
double t = 2.0;
double g = 9.8;
double y = v0*t - 0.5*g*t*t;
System.out.println("Displacement: " + y + " m");
Expected output Displacement: 20.4 m

Illustrate / model

INPUT v₀, t, g→PROCESS y = v₀t − ½gt²→OUTPUT y (m)

Thinking before coding

Vocabulary for your STRIDES notes:

modelinputoutputtest casedisplacementassumption

Pseudocode model

INPUT v0, t g ← 9.8 y ← v0*t - 0.5*g*t*t DISPLAY "Displacement: " + y + " m"

Practice questions

What is y for v0=20, t=1, g=9.8?

15.1 meters.

What does a negative displacement mean?

The object is below its starting position (not necessarily below ground).

In your workbook: Create input-process-output, student flowchart, code, predictions at t = 0,1,2,3 and a debugging log.
Finish the learning cycle: Complete the selected CodeHS programming activities; compare actual results with predictions; explain one change or error in the workbook before advancing.
Visual code tracing · Lessons 1.2 and 1.4

Step through Java variable updates

Predict how each statement changes the stored value. Advance one statement at a time, then reset.

Program trace
int score = 90;
score += 5;
score *= 2;
score--;

Current statement: Before initialization

score = not set

Predict 90, 95, 190, 189 before advancing.

Project · Lesson 1.8 · Workbook pages 31–34

Vertical Motion Calculator — Prediction Studio

Predict vertical displacement before checking the model. Adjust the launch conditions and compare the numeric result with the trajectory diagram. This tool illustrates the formula; your actual Java program belongs in CodeHS or your assigned IDE.

20.0
2.0
9.8
Predicted vertical displacement using the model
20.40 m
y = 20 × 2 − 0.5 × 9.8 × 2²

Make a prediction, then compare against the model.

yTime (seconds)Displacement (m)
Model assumptions: constant gravitational acceleration, no air resistance, and displacement measured from the launch point. Negative displacement does not automatically mean the object has gone underground.
v₀ (m/s)t (s)g (m/s²)y (m)
20.009.80.00
20.019.815.10
20.029.820.40
20.039.815.90
Unit review · Workbook pages 35–38

Review, reference and submit

Practice these problems without opening the solution first. The workbook contains space for your full written reasoning and a one-page personal reference sheet.

Trace and explain

int n = 13; int r = n % 5; n += 3;

What are n and r at the end?

n = 16 and r = 3. r was calculated before n changed.

System.out.println("Lap " + (2+3));

Predict the output

Lap 5

Debug and model

Why is double fraction = 3 / 8; not the intended decimal result?

Check reasoning

3/8 is integer division (0), then assigned as 0.0. Use 3.0/8 or (double)3/8.

Draw an algorithm for converting a race time in minutes and seconds to seconds per 400 meters.

See a model

Input minutes and seconds → total = 60×min + sec → pace400 = total/4.0 → display pace.

Submission: turn in the completed student workbook according to teacher instructions. CodeHS exercises are submitted in CodeHS. The teacher solution edition is distributed separately, not on this public student page.

↓ Download the student workbook Next: Unit 2 — Control Structures →

Student resource

Unit 1 Student Workbook

Use the student workbook alongside the lessons, practice questions, and unit project.

Download the student workbook (PDF) Open workbook in a new tab

Open the student workbook PDF to view or download it.