Days 41-45 lessons, for review

Monday Oct 26 to Friday Oct 30, 2026. Every row that goes into the sheet, in the order students see it. Correct answers are marked so you can check them. The live widgets shuffle the answer order.

Before you post

  • Built: java-019 (Selection Lab), java-020 (FRQ challenge with two questions: Haunted Hallway and Candy Stand), and apcsp-011 (Big Idea 3 Quiz). Also built: cyber-024 (Unit 3 Networking Lab) and its field guide. Also built: the Hex Tutorial (cyber-025) and the Network Sandbox (cyber-026), which is the Cyber weekly task. The sandbox now scores goals and prints an orange certificate.
  • Confirm the file names on your site match the links in the rows (cyber-024 to cyber-026, java-019, java-020, apcsp-011). The Cyber rows and pages link to specific sections of the field guide, so keep cyber-024-field-guide.html in the same folder.
  • Friday is a work day in all three courses, so Procedures (CSP) and routers/switches (Cyber) moved. The pacing file has the changes.
  • Certificates are orange this week in every course.

AP CSA

Selection and Iteration

Day 41

Mon 10/26

2.3 if statements (day 1 of 2)

1 of 9 - Story

Skips the Whole Party

Why is a one-way if a terrible host? When the condition is false, it skips the whole party.

2 of 9 - Vocab

selection
A statement that chooses whether some code runs, based on a condition. The if and the if-else are Java's selection statements.
one-way if
An if with no else. Its body runs only when the condition is true. When the condition is false, the body is skipped and the program continues after the closing brace.
condition
The boolean expression inside the parentheses of an if, like score >= 70. It has to be a boolean, so if (x = 5) does not compile.
block
The statements between { and } that belong to an if. Without braces, only the very next statement belongs to the if, which is a classic trap.

3 of 9 - Scenario

Nina is coding the ticket booth for the school's haunted hallway on Halloween night. She stores int tickets = 4; and int total = 20; and then writes three separate if statements in a row: if (tickets > 3) { total = total - 5; } if (total > 20) { total = total + 100; } if (tickets == 4) { total = total * 2; } Her friend Leo says total will end at 15, because once one if is true the others are skipped. Nina decides to trace each statement in order and write down what total holds after every one.

What does total hold when all three statements have been checked?

  • Correct
    30

    The first condition 4 > 3 is true, so total becomes 15. The second condition 15 > 20 is false, so it is skipped. The third condition 4 == 4 is true, so total becomes 15 * 2, which is 30.

    Ties to today: Each one-way if is checked on its own, using the values at that moment. That is the heart of Topic 2.3.

  • Wrong
    15

    That would be true if the other ifs were skipped after the first true one, but separate ifs are each checked on their own. The third condition is true as well.

  • Wrong
    230

    The second if checks total after the discount, when total is already 15. Since 15 > 20 is false, the + 100 never happens.

  • Wrong
    40

    The third if multiplies the current total, which is 15 after the discount, so it gives 30 and not 40.

4 of 9 - Quiz

  1. int x = 8; if (x > 10) { x = 0; } What does x hold afterward?

    • Correct8
    • Wrong0
    • Wrong10
    • WrongThe code does not compile
  2. What happens in a one-way if when its condition is false?

    • CorrectThe body is skipped and the program continues after it
    • WrongThe program stops with an error
    • WrongThe body runs anyway
    • WrongThe else block runs
  3. Which of these lines does NOT compile?

    • Correctif (x = 3) { x++; }
    • Wrongif (x == 3) { x++; }
    • Wrongif (x != 3) { x++; }
    • Wrongif (x > 3) { x++; }
  4. int n = 5; if (n > 2) n = n + 1; n = n * 10; What does n hold afterward?

    • Correct60
    • Wrong6
    • Wrong50
    • Wrong5
  5. Fill in: the boolean expression inside the parentheses of an if is called the ___.

    Accepted answers: condition, the condition

5 of 9 - Reflection

In your own words, explain what a one-way if does when its condition is false. Then write one real decision from your day as an if statement in plain English.

6 of 9 - Instruction

Today's Task: Selection Lab - Day 1

Head to https://phillycomputerscience.com/lessons/labs/java-019-selection-lab.html#day1 and open the Day 1 tab. Trace one-way if statements, including the braceless trap, then write three CodingBat-style methods that each use an if. Every method comes with a signature box, a precondition, and a Call and Value Returned table, just like the AP exam. Type your name at the top so your progress and certificate save. Each topic needs 3 right answers in a row. Your certificate is orange this week.

7 of 9 - Instruction

Weekly Task (due Friday): FRQ Challenge: Haunted Hallway, Read and Part (a)

Head to https://phillycomputerscience.com/lessons/labs/java-020-frq-lab.html#day1 and open the Read tab, then start Part (a). This is the Methods and Control Structures type of question from the AP exam, and this one is about a haunted hallway at a school Halloween night. The challenge has two questions: Question 1 runs Monday to Wednesday, and Question 2, the Candy Stand, is Thursday. Part (a) needs only a one-way if, which is today's topic. The FRQ is your weekly task, due Friday. Type your name at the top so your progress and certificate save.

8 of 9 - Instruction

Bonus Practice: CodingBat: Logic-1

Head to https://codingbat.com/java/Logic-1 and work through as many problems as you can. Now that you know if, try each problem two ways: once with an if, and once by returning a boolean expression directly. Finished Logic-1? Move up to the harder https://codingbat.com/java/Logic-2.

9 of 9 - Instruction

Dual Enrollment: Dual Enrollment: The Deadline Is Sunday, Nov 15

A reminder for anyone applying for college credit through Harrisburg University's College in the High School program. Your course there is CISC 120 02 H Programming I, and the application deadline is Sunday, November 15, 2026. If you have not submitted yet, read the Application Instructions (PDF), then log in at https://apply.harrisburgu.edu/portal/cihs_app and finish the steps. After you submit, check your inbox and junk/spam every day, because payment has to be completed within 48 hours to be eligible for credit. It is optional, but do not let the deadline slip by. Questions? Email dualenrollment@harrisburgu.edu or ask me.

Day 42

Tue 10/27

2.3 if statements (day 2 of 2)

1 of 8 - Story

Exactly One Path

Why did the coder get stuck at the fork in the road? Exactly one path runs, and she kept trying to take both.

2 of 8 - Vocab

two-way if
An if-else statement. Exactly one of the two blocks runs, never both and never neither.
else
The block that runs when the if condition is false. It has no condition of its own.
missing return
A compile error for a non-void method when some path through the code has no return. Every path must return a value.
mutually exclusive
Two outcomes that cannot happen together. The two blocks of an if-else are mutually exclusive.

3 of 8 - Scenario

Marcus is coding the costume contest for the Halloween parade. He starts with int votes = 9; and int bonus = 0; and String result = ""; and then writes: if (votes >= 10) { bonus = 5; result = "winner"; } else { bonus = 2; result = "runner-up"; } votes = votes + bonus; if (votes >= 10) { result = result + "!"; } His friend Kai says the contest will report a winner, since the final votes will be over 10. Marcus traces the code one statement at a time before the parade starts.

What do votes and result hold when the code finishes?

  • Correct
    votes is 11 and result is runner-up!

    9 >= 10 is false, so the else block runs: bonus becomes 2 and result becomes runner-up. Then votes becomes 9 + 2, which is 11. The second if is a separate check made after that, and 11 >= 10 is true, so a ! is added.

    Ties to today: Each if-else makes its decision once, using the values at that moment.

  • Wrong
    votes is 14 and result is winner!

    The first condition was checked while votes was still 9, and 9 >= 10 is false, so the winner block never runs.

  • Wrong
    votes is 11 and result is runner-up

    Close, but the second if is its own statement. After votes becomes 11, its condition is true, so the ! gets added.

  • Wrong
    votes is 9 and result is runner-up!

    votes is changed by the line votes = votes + bonus, so it does not stay at 9.

4 of 8 - Quiz

  1. int x = 3; if (x > 5) { x = 1; } else { x = 2; } What does x hold afterward?

    • Correct2
    • Wrong1
    • Wrong3
    • Wrong5
  2. A method with return type int contains only if (n > 0) { return 1; } and nothing after it. What happens when it is compiled?

    • CorrectIt fails with a missing return statement error
    • WrongIt returns 0 when n is not positive
    • WrongIt compiles and returns null
    • WrongIt compiles but crashes at run time
  3. What does passed(70) return? public static boolean passed(int score) { if (score >= 70) { return true; } else { return false; } }

    • Correcttrue
    • Wrongfalse
    • Wrong70
    • WrongIt does not compile
  4. How many of the two blocks in an if-else run each time it executes?

    • CorrectExactly one
    • WrongBoth
    • WrongNeither
    • WrongIt depends on the else
  5. Fill in: the method in question 3 can be written as one line: return score ___ 70;

    Accepted answers: >=, greater than or equal to

5 of 8 - Reflection

Write a method isEven(int n) two ways: once with an if-else and once as a single return line. Which one do you prefer, and why?

6 of 8 - Instruction

Today's Task: Selection Lab - Day 2

Head to https://phillycomputerscience.com/lessons/labs/java-019-selection-lab.html#day2 and open the Day 2 tab. Trace if-else statements, including returns inside each branch, then write four CodingBat-style methods. Watch for the missing return statement error. Type your name at the top so your progress and certificate save. Each topic needs 3 right answers in a row. Your certificate is orange this week.

7 of 8 - Instruction

Weekly Task (due Friday): FRQ Challenge: Haunted Hallway, Part (b)

Head to https://phillycomputerscience.com/lessons/labs/java-020-frq-lab.html#day2 and open the Part (b) tab. Part (b) needs an if-else, which is today's topic. Part (a) should already be done and passing. The FRQ is your weekly task, due Friday. Type your name at the top so your progress and certificate save.

8 of 8 - Instruction

Bonus Practice: CodingBat: Logic-1

Head to https://codingbat.com/java/Logic-1 and work through as many problems as you can. Now that you know if, try each problem two ways: once with an if, and once by returning a boolean expression directly. Finished Logic-1? Move up to the harder https://codingbat.com/java/Logic-2.

Day 43

Wed 10/28

2.4 Nested if statements (day 1 of 2)

1 of 8 - Story

Every Door Has to Open

Why did the nested if get lost in the haunted house? Every door had to open before it could reach the room it wanted.

2 of 8 - Vocab

nested if
An if or if-else placed inside another if or else block. The inner condition is only checked if the program reaches that block.
else-if chain
A series of if, else if, and else. Conditions are checked from the top, and only the first true branch runs.
cutoff order
In a chain that tests ranges, the order of the conditions matters. Put the highest cutoff first, or a score of 95 will match a lower test.
dangling else
An else always pairs with the nearest unmatched if, no matter how the code is indented. Braces make the pairing clear.

3 of 8 - Scenario

Theo is coding the candy rule for trick-or-treat night. He stores int age = 14; and boolean costume = true; and int candy = 2; and then writes: if (age < 13) { if (costume) { candy = candy + 5; } else { candy = candy + 1; } } else { if (costume) { candy = candy + 3; } } His sister Ana says anyone wearing a costume must get the big 5 candy bonus, since the costume check is right there in the code. Theo traces it from the outside in, one condition at a time.

What does candy hold when the code finishes?

  • Correct
    5

    14 < 13 is false, so the outer else block runs. Inside it, costume is true, so candy becomes 2 + 3, which is 5.

    Ties to today: Working from the outside in, one condition at a time, is the key skill for nested ifs.

  • Wrong
    7

    The + 5 bonus belongs to the age < 13 branch, and 14 is not less than 13.

  • Wrong
    2

    The inner if inside the else block still gets checked, and costume is true there, so candy changes.

  • Wrong
    3

    The 3 is added to candy, which already holds 2, so the result is 2 + 3 and not just 3.

4 of 8 - Quiz

  1. In nested ifs, when is the inner if's condition checked?

    • CorrectOnly when the program reaches the block it sits in
    • WrongEvery time, before the outer condition
    • WrongOnly after the else runs
    • WrongNever, it is just a comment
  2. int x = 6; if (x > 2) { if (x > 8) { x = 0; } else { x = 1; } } else { x = 2; } What does x hold afterward?

    • Correct1
    • Wrong0
    • Wrong2
    • Wrong6
  3. A chain gives an A for 90 or more, a B for 80 or more, and a C for 70 or more. How should the conditions be ordered?

    • CorrectHighest cutoff first: 90, then 80, then 70
    • WrongLowest cutoff first: 70, then 80, then 90
    • WrongThe order does not matter
    • WrongOnly the last condition has to be in order
  4. int n = 7; if (n > 5) { if (n < 7) { n = 1; } } n = n + 10; What does n hold afterward?

    • Correct17
    • Wrong11
    • Wrong7
    • Wrong1
  5. Fill in: when an else could pair with more than one if, Java pairs it with the ___ unmatched if.

    Accepted answers: nearest, closest

5 of 8 - Reflection

Think of a real decision with two layers, like deciding what to wear based on the weather and then on where you are going. Write it as nested ifs in plain English or Java.

6 of 8 - Instruction

Today's Task: Selection Lab - Day 3

Head to https://phillycomputerscience.com/lessons/labs/java-019-selection-lab.html#day3 and open the Day 3 tab. Trace nested ifs from the outside in, then write four CodingBat-style methods that use else-if chains and nested ifs. Watch the order of your cutoffs. Type your name at the top so your progress and certificate save. Each topic needs 3 right answers in a row. Your certificate is orange this week.

7 of 8 - Instruction

Weekly Task (due Friday): FRQ Challenge: Haunted Hallway, Part (c)

Head to https://phillycomputerscience.com/lessons/labs/java-020-frq-lab.html#day3 and open the Part (c) tab. Part (c) calls the methods you wrote in parts (a) and (b), and it needs a nested if or an else-if chain, which is today's topic. The FRQ is your weekly task, due Friday. Type your name at the top so your progress and certificate save.

8 of 8 - Instruction

Bonus Practice: CodingBat: Logic-1

Head to https://codingbat.com/java/Logic-1 and work through as many problems as you can. Now that you know if, try each problem two ways: once with an if, and once by returning a boolean expression directly. Finished Logic-1? Move up to the harder https://codingbat.com/java/Logic-2.

Day 44

Thu 10/29

2.4 Nested if statements (day 2 of 2)

1 of 8 - Story

Stop Looking

Why do else-if chains make great detectives? Once they find the culprit, they stop looking.

2 of 8 - Vocab

independent ifs
Separate if statements that each check their own condition. Any number of them can run, one after another.
first match wins
In an else-if chain, the first true condition runs and every other branch is skipped.
boundary value
A test value right at the edge of a condition, like 12 and 13 for age >= 13. Bugs hide at the edges.
trace table
A table where you write each variable's value after each statement. It is the most reliable way to find out what code really does.

3 of 8 - Scenario

Priya is coding the letter grades for the first quarter report cards, which close this Friday. Her first version starts with String grade = "F"; and then has three separate ifs: if (score >= 90) { grade = "A"; } if (score >= 80) { grade = "B"; } if (score >= 70) { grade = "C"; } A friend tests it with a score of 95 and the program says C. Priya changes the second and third if into else if, so it reads: if (score >= 90) { grade = "A"; } else if (score >= 80) { grade = "B"; } else if (score >= 70) { grade = "C"; } She runs both versions with score = 95.

What does grade hold for score = 95 in the first version and in the second version?

  • Correct
    C in the first version and A in the second

    In the first version all three conditions are true, so the three separate ifs all run in order and the last one wins. In the second version, 95 >= 90 is true, so grade becomes A and every else-if branch is skipped.

    Ties to today: Separate ifs versus an else-if chain is the main idea of Topic 2.4.

  • Wrong
    A in both versions

    The first version has three separate ifs, and nothing stops the second and third from running after the first.

  • Wrong
    C in both versions

    The second version stops at the first true condition, which is score >= 90, so it never reaches the C.

  • Wrong
    A in the first version and C in the second

    That is backwards. Separate ifs keep running all the way down, and the else-if chain stops early.

4 of 8 - Quiz

  1. int x = 10; if (x > 5) { x = x - 3; } if (x > 5) { x = x - 3; } What does x hold afterward?

    • Correct4
    • Wrong7
    • Wrong10
    • Wrong3
  2. int x = 10; if (x > 5) { x = x - 3; } else if (x > 5) { x = x - 3; } What does x hold afterward?

    • Correct7
    • Wrong4
    • Wrong10
    • Wrong3
  3. Which pair of test values is the best boundary check for if (age >= 13)?

    • Correct12 and 13
    • Wrong1 and 100
    • Wrong20 and 30
    • Wrong0 and 99
  4. int n = 4; if (n > 3) { if (n > 6) { n = 0; } } else { n = 9; } What does n hold afterward?

    • Correct4
    • Wrong0
    • Wrong9
    • WrongIt does not compile
  5. Fill in: in an else-if chain, once a condition is true, the rest of the branches are ___.

    Accepted answers: skipped, not run

5 of 8 - Reflection

Explain the difference between three separate ifs and an if with two else ifs. Give one example, with a number, where they give different answers.

6 of 8 - Instruction

Today's Task: Selection Lab - Day 4

Head to https://phillycomputerscience.com/lessons/labs/java-019-selection-lab.html#day4 and open the Day 4 tab. Trace mixed practice, then write six CodingBat-style methods that mix if, else if, and nested ifs, with returns inside the branches. Pick boundary values to test your own work. Type your name at the top so your progress and certificate save. Each topic needs 3 right answers in a row. Your certificate is orange this week.

7 of 8 - Instruction

Weekly Task (due tomorrow): FRQ Challenge: Question 2, the Candy Stand

Head to https://phillycomputerscience.com/lessons/labs/java-020-frq-lab.html#day4 and open the Question 2 tab. It is the same three skills as Question 1 in a new setting: a decision with ordered rules, a method that uses it, and a method where the order of the rules matters. Finish all of Question 1 first, then write the three Candy Stand methods. Hints and worked examples work the same way. The FRQ is your weekly task, due tomorrow. Type your name at the top so your progress and certificate save.

8 of 8 - Instruction

Bonus Practice: CodingBat: Logic-2

Head to https://codingbat.com/java/Logic-2 and work through as many problems as you can. Logic-2 mixes several conditions in one method, so trace your answer by hand before you run it. Already crushing it? Ask me about CodeQuest-style problems.

Day 45

Fri 10/30

Work day: finish selection practice and the Haunted Hallway and Candy Stand FRQs (last day of Quarter 1 grades)

1 of 4 - Story

Null and Void

Why do Java programmers love Halloween? Every object finally gets to be null and void.

2 of 4 - Reflection

Write down what you finished this week, what is still left, and one thing about if statements that you can do now and could not do on Monday.

3 of 4 - Instruction

Work Day: Catch Up and Finish (Last Day of Quarter 1)

No new lesson today, and it is the last day for first quarter grades. Use the whole period to finish any tabs you have not passed in the Selection Lab and both FRQ questions. If you are caught up, try CodingBat Logic-2 or help a classmate who is stuck. Both certificates this week are orange: one for the Selection Lab and one for the FRQ. Happy Halloween, and enjoy the parade.

4 of 4 - Instruction

Weekly Task (due today): FRQ Challenge: Check and Score Both Questions

Head to https://phillycomputerscience.com/lessons/labs/java-020-frq-lab.html#day5 and open the Check and score tab. Run the checks on all six parts, fix anything marked, test your own boundary values, press the score button, and answer the reflection questions. The FRQ is your weekly task, due today. Type your name at the top so your progress and certificate save.

AP CSP

Big Idea 3: Mad Libs, week 2

Day 41

Mon 10/26

Boolean expressions and logical operators

1 of 9 - Story

Either ID Works

Why did the OR operator get hired as a bouncer? It lets you in if either of your IDs works.

2 of 9 - Vocab

boolean expression
An expression that works out to true or false, like count < 3. Every decision in a program depends on one.
|| (or)
True when at least one side is true. On the AP exam it is written OR.
&& (and)
True only when both sides are true. On the AP exam it is written AND.
! (not)
Flips a boolean, so !true is false and !false is true. On the AP exam it is written NOT.

3 of 9 - Scenario

Omar is adding a safety check to his Mad Libs program so it rejects word lists that are empty, too short, or too long. He stores let box = "cat dog"; and let count = 2; and then writes: let tooFew = count < 3; let tooMany = count > 8; let empty = box === ""; let bad = tooFew || tooMany || empty; let good = !bad; His friend Ravi says the check should use && instead of ||, because it has to catch every problem at once. Omar traces the values one line at a time.

What do bad and good hold?

  • Correct
    bad is true and good is false

    count < 3 is true because 2 is less than 3, and the other two pieces are false. true || false || false is true, and the ! flips that to false for good.

    Ties to today: || needs only one true piece, which is exactly what a safety check wants.

  • Wrong
    bad is false and good is true

    That is what && would give, since every piece would have to be true. || only needs one.

  • Wrong
    bad is true and good is true

    good is !bad, so the two values always disagree.

  • Wrong
    bad is false and good is false

    good is !bad, so the two values can never match.

4 of 9 - Quiz

  1. What does true || false give?

    • Correcttrue
    • Wrongfalse
    • Wrongnull
    • WrongAn error
  2. What does true && false give?

    • Correctfalse
    • Wrongtrue
    • Wrongnull
    • WrongAn error
  3. let a = 5; let b = 10; What does a > 3 && b < 8 give?

    • Correctfalse
    • Wrongtrue
    • Wrong5
    • Wrong10
  4. let n = 0; What does !(n > 2) give?

    • Correcttrue
    • Wrongfalse
    • Wrong0
    • Wrong2
  5. Fill in: the JavaScript symbol for "or" is ___ (two vertical bars).

    Accepted answers: ||, two bars

5 of 9 - Reflection

Describe one check your Mad Libs program should make. Write it in plain English first, then say whether it needs ||, &&, or !.

6 of 9 - Instruction

Today's Task: Live Stream: Combine Checks and Catch an Empty Box

Join your period's live stream. Open the stream spreadsheet at the stream spreadsheet and click the link for your period (2, 6, or 7), then code along. Steps: 1. Find the line in makestory that counts how many words are missing. 2. Add a check for an empty box (hint: box === ""). 3. Combine it with the too-few check using || so the program stops when the box is empty OR has too few words. 4. Test with an empty box, one word, and the full default text. You are done when empty and short inputs give a sensible alert. If your working version from last Friday does not run, tell me right away, because today builds on it.

7 of 9 - Instruction

Today's Practice: Big Idea 3 Quiz, 5 to 10 Minutes

Head to the Big Idea 3 Quiz and answer questions for 5 to 10 minutes. Today's new ideas are Boolean expressions with AND, OR, and NOT, so look for those, along with IF and ELSE. You get +5 for a right answer and -10 for a wrong one, so slow down and read each question. After every answer you see why, and there is a short pause before the next question. Your points (up to 100) are your grade, so keep going until you are happy with it. Type your name to start, and your progress saves on this device. Your certificate is orange this week.

8 of 9 - Instruction

Weekly Task (finished version due Friday, Oct 30): My Own Mad Libs Program

Your finished version is due Friday, Oct 30. Today and tomorrow are live coding days for the last technical steps. From Wednesday to Friday the time is yours for your story, your graphics, and your style. Before the stream, make sure last Friday's working version still runs.

9 of 9 - Instruction

Dual Enrollment: Dual Enrollment: The Deadline Is Sunday, Nov 15

A reminder for anyone applying for college credit through Harrisburg University's College in the High School program. Your course there is ISIT 103 01 H Comp&InfoScncs, and the application deadline is Sunday, November 15, 2026. If you have not submitted yet, read the Application Instructions (PDF), then log in at https://apply.harrisburgu.edu/portal/cihs_app and finish the steps. After you submit, check your inbox and junk/spam every day, because payment has to be completed within 48 hours to be eligible for credit. It is optional, but do not let the deadline slip by. Questions? Email dualenrollment@harrisburgu.edu or ask me.

Day 42

Tue 10/27

Iteration: while-style loops (repeat until a condition)

1 of 8 - Story

The Party That Never Ended

Why did the while loop never leave the party? Its condition was never false.

2 of 8 - Vocab

while loop
A loop that repeats its body as long as its condition is true. The condition is checked before every pass, including the first.
iteration
One pass through the body of a loop.
loop counter
A variable that changes on each pass so the loop can eventually stop, like i = i + 1.
infinite loop
A loop whose condition never becomes false. On a web page it freezes the browser tab.
REPEAT UNTIL
How the AP exam writes a while-style loop: REPEAT UNTIL(condition). It checks the condition before each pass and stops when the condition becomes true, which is the opposite of a JavaScript while loop, which keeps going while its condition is true.

3 of 8 - Scenario

Jules is rewriting the Mad Libs fill-in code as a while loop. To understand it first, she tests a tiny version with let missing = 5; and let typed = 0; and then writes: while (missing > 2) { typed = typed + 1; missing = missing - 1; } Her friend Dev says the body will run 5 times, because missing starts at 5. Jules decides to trace each pass in a table before she runs it.

What do typed and missing hold after the loop ends?

  • Correct
    typed is 3 and missing is 2

    The loop runs while missing > 2. Pass 1 makes missing 4, pass 2 makes it 3, and pass 3 makes it 2. Then 2 > 2 is false, so the loop stops after exactly 3 passes.

    Ties to today: The condition is checked before every pass, which is why the loop stops the moment it is false.

  • Wrong
    typed is 5 and missing is 0

    The loop stops as soon as missing reaches 2, so it never gets that far.

  • Wrong
    typed is 4 and missing is 1

    That would happen if the condition were missing >= 2. With missing > 2, the loop stops when missing is 2.

  • Wrong
    typed is 3 and missing is 3

    missing goes down by 1 on every pass, so after 3 passes it is 5 - 3, which is 2 and not 3.

4 of 8 - Quiz

  1. When does a while loop check its condition?

    • CorrectBefore every pass, including the first
    • WrongOnly after the first pass
    • WrongOnly once, at the very start
    • WrongOnly after the last pass
  2. In AP exam pseudocode: n ← 0 REPEAT UNTIL (n > 5) { n ← n + 2 } What does n hold afterward?

    • Correct6
    • Wrong5
    • Wrong4
    • Wrong8
  3. let n = 1; while (n < 20) { n = n * 2; } What does n hold afterward?

    • Correct32
    • Wrong16
    • Wrong20
    • Wrong64
  4. What usually causes an infinite loop?

    • CorrectA condition that never becomes false, such as forgetting to change the counter
    • WrongA condition that is false from the start
    • WrongUsing more than one variable
    • WrongWriting the loop on more than one line
  5. Fill in: one pass through the body of a loop is called one ___.

    Accepted answers: iteration, pass

5 of 8 - Reflection

Explain why forgetting to change the counter inside a while loop can freeze a page, and how the debugging terminal could help you find the bug.

6 of 8 - Instruction

Today's Task: Live Stream: Rewrite the Fill-In Loop as a while Loop

Join your period's live stream. Open the stream spreadsheet at the stream spreadsheet and click the link for your period (2, 6, or 7), then code along. Steps: 1. Find the for loop in the FROM HERE / TO HERE block that fills in the blanks. 2. Write a while loop that does the same job: set up a counter before the loop, put the condition in the parentheses, and change the counter at the bottom of the body. 3. Run it and compare the story to the one you had before. You are done when the story looks exactly the same as before. This is the last technical step of the project, so if you are behind, tell me today and I will get you the starter files.

7 of 8 - Instruction

Today's Practice: Big Idea 3 Quiz, 5 to 10 Minutes

Head to the Big Idea 3 Quiz and answer questions for 5 to 10 minutes. Today's new idea is REPEAT UNTIL, which stops when its condition becomes TRUE. That is the opposite of a JavaScript while loop. You get +5 for a right answer and -10 for a wrong one, so slow down and read each question. After every answer you see why, and there is a short pause before the next question. Your points (up to 100) are your grade, so keep going until you are happy with it. Type your name to start, and your progress saves on this device. Your certificate is orange this week.

8 of 8 - Instruction

Weekly Task (finished version due Friday, Oct 30): My Own Mad Libs Program

Today is the last technical step. Starting tomorrow, the time is yours for your story, graphics, and style. If your page is not running after today, see me before Wednesday.

Day 43

Wed 10/28

Iteration: for-style loops (repeat a set number of times) + free build day 1 (story)

1 of 8 - Story

Start, Stop, Step

Why do for loops make terrible secret agents? They tell everyone exactly where they start, when they stop, and how they step.

2 of 8 - Vocab

for loop
A loop with its setup written in one line, like for (let i = 0; i < 5; i++). It is the usual choice when you know how many passes you need.
initialization
The first part of a for header. It runs once, before the first pass, like let i = 0.
condition and update
The condition is checked before every pass. The update, like i++, runs after every pass.
i++
A shortcut for i = i + 1. It adds 1 to i.
REPEAT n TIMES
How the AP exam writes a loop that runs a fixed number of times. REPEAT 4 TIMES runs its block 4 times. In JavaScript you write the same idea as a for loop.

3 of 8 - Scenario

Ravi wants a spooky banner on his Mad Libs page that repeats the word boo three times. He writes let banner = ""; for (let i = 0; i < 3; i++) { banner = banner + "boo "; } His friend Dev bets the banner will have four boos, because i goes 0, 1, 2, and 3. Ravi counts the passes one at a time and writes down the value of i at the start of each one.

What does banner hold when the loop ends?

  • Correct
    Three copies of boo, each followed by a space

    The loop runs while i < 3, so it runs for i = 0, 1, and 2. When i becomes 3, the condition 3 < 3 is false and the loop stops before a fourth pass.

    Ties to today: Counting from 0 up to, but not including, the number in the condition is how for loops work.

  • Wrong
    Four copies of boo

    i does reach 3, but the condition is checked first, and 3 < 3 is false, so there is no fourth pass.

  • Wrong
    One copy of boo

    The loop keeps going while i < 3, so it does not stop after the first pass.

  • Wrong
    Nothing, because banner starts out empty

    The body adds to banner on every pass, so it grows each time.

4 of 8 - Quiz

  1. In AP exam pseudocode, how many times does REPEAT 5 TIMES { DISPLAY("boo") } display boo?

    • Correct5
    • Wrong4
    • Wrong6
    • Wrong1
  2. Which part of a for header runs only once, at the very start?

    • CorrectThe initialization
    • WrongThe condition
    • WrongThe update
    • WrongThe body
  3. let sum = 0; for (let i = 1; i <= 3; i++) { sum = sum + i; } What does sum hold?

    • Correct6
    • Wrong3
    • Wrong5
    • Wrong10
  4. let c = 0; for (let i = 0; i < 6; i = i + 2) { c = c + 1; } What does c hold?

    • Correct3
    • Wrong6
    • Wrong2
    • Wrong4
  5. Fill in: i++ is a shortcut for i = i + ___.

    Accepted answers: 1, one

5 of 8 - Reflection

In your own words, say what the three parts of a for header do. Then say where in your Mad Libs code you used a for loop, or could use one.

6 of 8 - Instruction

Today's Task: Free Build Day 1: Write Your Story

Join your period's live stream. Open the stream spreadsheet at the stream spreadsheet and click the link for your period (2, 6, or 7), then code along. Steps: 1. Write every paragraph of your story, with blanks for all four word types. 2. Add a comment above the for loop that labels its three parts: initialization, condition, and update. 3. Save and test after every paragraph, not just at the end. You are done when your story has at least 12 blanks and uses all four word types. Nobody types the whole story, so if you want a head start, ask me for the starter story. Join the stream for a quick check-in if you want help, or work on your own.

7 of 8 - Instruction

Today's Practice: Big Idea 3 Quiz, 5 to 10 Minutes

Head to the Big Idea 3 Quiz and answer questions for 5 to 10 minutes. Today's new idea is REPEAT n TIMES, which is a for loop. Count the passes carefully. You get +5 for a right answer and -10 for a wrong one, so slow down and read each question. After every answer you see why, and there is a short pause before the next question. Your points (up to 100) are your grade, so keep going until you are happy with it. Type your name to start, and your progress saves on this device. Your certificate is orange this week.

8 of 8 - Instruction

Weekly Task (finished version due Friday, Oct 30): My Own Mad Libs Program

Today is Free Build Day 1, the day for your story. The finished version needs at least 12 blanks. Tomorrow is for graphics and style, and Friday is for polish and handing in.

Day 44

Thu 10/29

Combining lists and loops: traversing a list + free build day 2 (graphics and style)

1 of 8 - Story

Visiting Every Item

Why did the loop and the list become best friends? One holds the items and the other visits every single one.

2 of 8 - Vocab

traversal
Using a loop to visit every element of a list, one at a time.
index
The position of an element in a list. The first element is at index 0 in JavaScript. On the AP exam, lists start at index 1, so watch for it.
.length
The number of elements in a list. A traversal usually loops while i < list.length.
split
A string method that cuts a string into a list. "a b c".split(" ") gives a list of three words. Your Mad Libs page uses it to turn the typed words into a list.
FOR EACH
How the AP exam visits every element of a list in order: FOR EACH item IN aList. In JavaScript you can write it with a for loop that goes through each index.

3 of 8 - Scenario

Leo's Mad Libs page shows a list of spooky words. He writes let words = ["moon", "bat", "owl"]; let out = ""; for (let i = 0; i < words.length; i++) { out = out + words[i] + "!"; } His friend Mara says the loop will crash on its last pass, because words[3] does not exist and the loop goes up to 3. Leo traces the value of i and the text in out on every pass before he runs it.

What does out hold when the loop ends?

  • Correct
    moon!bat!owl!

    words.length is 3, so the loop runs for i = 0, 1, and 2. When i becomes 3, 3 < 3 is false, so words[3] is never read.

    Ties to today: Pairing a loop with i < list.length visits every item and stops in the right place.

  • Wrong
    moon!bat!owl!undefined!

    That would happen if the condition were i <= words.length. Here it is i < words.length, so the loop stops before index 3.

  • Wrong
    bat!owl!

    The loop starts at i = 0, which is the first word, moon.

  • Wrong
    moon!

    The loop keeps going until i < 3 is false, so it visits all three words.

4 of 8 - Quiz

  1. let nums = [5, 8, 2]; What is nums[1]?

    • Correct8
    • Wrong5
    • Wrong2
    • Wrong1
  2. In AP exam pseudocode, lists start at index 1. If myList ← [5, 8, 2], what is myList[1]?

    • Correct5
    • Wrong8
    • Wrong2
    • WrongIt causes an error
  3. let t = 0; let a = [4, 1, 6]; for (let i = 0; i < a.length; i++) { t = t + a[i]; } What does t hold?

    • Correct11
    • Wrong7
    • Wrong6
    • Wrong10
  4. What does "a b c".split(" ") give?

    • CorrectA list with three items: a, b, and c
    • WrongA single string with no spaces
    • WrongA list with one item
    • WrongThe number 3
  5. Fill in: the index of the first element in a list is ___.

    Accepted answers: 0, zero

5 of 8 - Reflection

Find one place in your Mad Libs code where a loop visits a list. Say what the list holds and what the loop does with each item.

6 of 8 - Instruction

Today's Task: Free Build Day 2: Graphics and Style

Join your period's live stream. Open the stream spreadsheet at the stream spreadsheet and click the link for your period (2, 6, or 7), then code along. Steps: 1. Style your page in style.css: backgrounds, fonts, and colors that feel like your story. 2. Add at least one image. Save it in your project folder with a name that has no spaces, and keep it small so it loads fast on Chromebooks. 3. Credit every image and font in an HTML comment at the top of index.html. An AI image is fine if you wrote the prompt. 4. Find the line with .split in code.js and add a comment saying what it builds. You are done when your page looks like yours and every image and font is credited.

7 of 8 - Instruction

Today's Practice: Big Idea 3 Quiz, 5 to 10 Minutes

Head to the Big Idea 3 Quiz and answer questions for 5 to 10 minutes. Today's new idea is loops that walk through lists. Remember that AP pseudocode lists start at index 1. You get +5 for a right answer and -10 for a wrong one, so slow down and read each question. After every answer you see why, and there is a short pause before the next question. Your points (up to 100) are your grade, so keep going until you are happy with it. Type your name to start, and your progress saves on this device. Your certificate is orange this week.

8 of 8 - Instruction

Weekly Task (finished version due tomorrow): My Own Mad Libs Program

Today is Free Build Day 2, the day for graphics and style. Tomorrow is the last day to polish and hand in, and it is the last day for first quarter grades.

Day 45

Fri 10/30

Work day: Mad Libs polish and hand-in (last day of Quarter 1 grades)

1 of 3 - Story

Haunting the Blanks

Why do ghosts love Mad Libs? They get to haunt all the blanks.

2 of 3 - Reflection

In a few sentences, describe what in your Mad Libs program is your own work, such as your story, your decisions, and your design, and what came from the starter code or from outside help.

3 of 3 - Instruction

Weekly Task (finished version due today): Free Build Day 3: Polish and Hand In

Join your period's live stream. Open the stream spreadsheet at the stream spreadsheet and click the link for your period (2, 6, or 7), then code along. Steps: 1. Ask a classmate to try to break your program, for example with an empty box, one very long word, or words typed on separate lines. 2. Fix what they find. 3. Check that every image and font is credited in an HTML comment at the top of index.html. 4. Submit your link: in Codio right-click index.html, choose Preview, copy the address bar URL, and paste it into the Mad Libs assignment in Google Classroom. 5. Open the Big Idea 3 Quiz, finish with a grade you are happy with, press Finish for now (view certificate), and print your orange status. You are done when your finished version is handed in. It is due today, it is not optional, and today is the last day for first quarter grades. Next week we start procedures.

AP Cybersecurity

Unit 3: Securing Networks

Day 41

Mon 10/26

Networking fundamentals: what is a network? LAN vs. WAN; routers and switches

1 of 8 - Story

Always Knew the Next Hop

Why was the router such a good tour guide? It always knew the next hop.

2 of 8 - Vocab

LAN
Local area network. A network that covers a small area, like one school building or one home.
WAN
Wide area network. A network that spans cities or countries. The internet is the largest WAN.
packet
A small chunk of data sent over a network. Every packet carries a source address, a destination address, and a piece of the message.
switch
A device that connects the devices inside one LAN and sends each message only to the device it is meant for.
router
A device that connects different networks and forwards each packet toward its destination.

3 of 8 - Scenario

Dana's Chromebook prints to the library printer in the same building almost instantly, but loading a website takes a little longer, because the request has to leave the school. The school's network has her Chromebook, a switch that connects the wired devices in the building, a wireless access point, and a router that connects the building to the internet service provider. Dana's teacher asks the class which device is responsible for forwarding her website request out of the school's local network and toward the internet.

Which device forwards that request out of the LAN?

  • Correct
    The router

    A router connects different networks and decides where each packet goes next, so it is the one that sends the request out of the school's LAN toward the internet.

    Ties to today: Naming what each device does is the first step in understanding any network.

  • Wrong
    The switch

    A switch connects devices inside the same LAN. It does not connect the LAN to the internet.

  • Wrong
    The wireless access point

    An access point lets wireless devices join the LAN, but it does not route packets to other networks.

  • Wrong
    The printer

    The printer is just another device on the LAN. It receives print jobs and does not forward anything.

4 of 8 - Quiz

  1. A network that covers one school building is called a what?

    • CorrectLAN
    • WrongWAN
    • WrongPacket
    • WrongRouter
  2. The internet is the biggest example of what kind of network?

    • CorrectWAN
    • WrongLAN
    • WrongSwitch
    • WrongPort
  3. Data sent over a network is broken into small pieces called what?

    • CorrectPackets
    • WrongPorts
    • WrongRouters
    • WrongProtocols
  4. Which device connects the devices inside one LAN to each other?

    • CorrectA switch
    • WrongA router
    • WrongThe internet
    • WrongA packet
  5. Fill in: a device that forwards packets between different networks is called a ___.

    Accepted answers: router, a router

5 of 8 - Reflection

Trace what happens, step by step, between pressing Enter on a web address and the page appearing. Use at least four of today's words.

6 of 8 - Instruction

Today's Task: Unit 3 Networking Lab - Day 1

Head to https://phillycomputerscience.com/lessons/labs/cyber-024-networking-lab.html#day1 and open the Day 1 tab. Label the devices on a small school network (LAN, switch, router), then follow a packet from a client to a server and back. Stuck? Read section 1, What a network is in the field guide. Type your name at the top so your progress and certificate save. Each topic needs 3 right answers in a row. Your certificate is orange this week.

7 of 8 - Instruction

Weekly Task (due Friday): Network Sandbox

Open the Network Sandbox and work in it each day. Today, load 1. Home network, find every device, and send your first packet from the Laptop to the Web server. Click each device to see its IP address and MAC address. If a packet does not do what you expect, read section 1, What a network is in the field guide. Your weekly task is to finish the goals in scenarios 1, 3, 4, 5, and 6 by Friday (scenarios 2 and 7 are for fast finishers). Type your name in the sandbox once, and your progress saves on this device. Your score comes from the goals you finish. When you are done, press View my certificate, print it or save it as a PDF, and turn it in with your lab certificate. Everything in the sandbox is practice on simulated networks, never real ones.

8 of 8 - Instruction

Need Help?: Unit 3 Networking Field Guide

Stuck on a tool or a topic? Today, read section 1, What a network is in the field guide (the whole guide is here). It explains each idea, shows worked examples, and has a fix-it checklist. It never gives away your answers. The lab and the sandbox link to the matching section too, and every lab question has its own Show me an example button. For vocabulary and ports, open the Computer Science Hub, choose AP Cybersecurity, then the Vocabulary tab, or Cheat Sheets and the Common Ports filter.

Day 42

Tue 10/27

Network topology, IP addressing, and MAC addresses (MAC bytes are written in hex)

1 of 8 - Story

I Stay on the Card

What did the MAC address say to the IP address? You can change networks all you like, but I stay on the card.

2 of 8 - Vocab

network topology
The layout of how the devices in a network connect to each other. In a star topology, every device connects to one central switch. In a mesh topology, devices connect to several others.
IP address
A number that identifies a device on a network. An IPv4 address is four numbers from 0 to 255, like 192.168.1.23. It changes when a device joins a different network.
private address
An address that only works inside one local network. The private ranges are 10.x.x.x, 172.16 to 172.31, and 192.168.x.x. Many homes use the same ones.
MAC address
A hardware address built into a network card, written as six bytes in hexadecimal, like 3C:22:FB:9A:10:5E. It identifies a device on its local network and usually stays with the card.

3 of 8 - Scenario

Maya and Devon live in different houses across town, and both of their home routers hand out addresses that start with 192.168.1. Maya's laptop is 192.168.1.23, and so is Devon's. Devon worries that when both of them visit the same website at the same time, their traffic will crash into each other. Maya says the two laptops will never collide. Their teacher asks the class to explain who is right and why.

Why can two different homes use the same 192.168.1.23 address without a conflict?

  • Correct
    Those are private addresses that only mean something inside each home's own network, and each router has its own public address that the internet sees

    192.168.x.x is a private range. The websites never see the laptop's private address, only the public address of each home's router.

    Ties to today: Telling private addresses from public ones is a core networking skill.

  • Wrong
    Each website keeps a list that tells the two laptops apart by name

    Websites never see the private address at all. They only see the router's public address.

  • Wrong
    Only one of the two laptops can be online at a time

    Both can be online at once, because private addresses are not shared between homes.

  • Wrong
    192.168.1.23 is a public address that two homes are allowed to share

    192.168.x.x is a private range. Public addresses are unique across the whole internet.

4 of 8 - Quiz

  1. In a star topology, how are the devices connected?

    • CorrectEach device connects to one central switch
    • WrongEach device connects to every other device
    • WrongAll devices share one long cable in a line
    • WrongEach device connects only to the device next to it in a ring
  2. Which of these is a valid IPv4 address?

    • Correct192.168.1.10
    • Wrong192.168.1.256
    • Wrong192.168.1
    • Wrong192.168.1.1.1
  3. Which of these is a private address?

    • Correct10.4.7.9
    • Wrong8.8.8.8
    • Wrong172.32.0.1
    • Wrong11.0.0.1
  4. How many hex digits are in a MAC address like 3C:22:FB:9A:10:5E?

    • Correct12
    • Wrong6
    • Wrong8
    • Wrong16
  5. Fill in: each of the four numbers in an IPv4 address goes from 0 up to ___.

    Accepted answers: 255, two hundred fifty-five

5 of 8 - Reflection

Explain the difference between an IP address and a MAC address. Which one changes when you carry your laptop to a different network, and why?

6 of 8 - Instruction

Today's Task: Unit 3 Networking Lab - Day 2

Head to https://phillycomputerscience.com/lessons/labs/cyber-024-networking-lab.html#day2 and open the Day 2 tab. Compare network layouts (star, bus, ring, and mesh), sort addresses into valid, private, and public, and read the bytes of a MAC address. Stuck? Read section 2, IP addresses and MAC addresses in the field guide. Type your name at the top so your progress and certificate save. Each topic needs 3 right answers in a row. Your certificate is orange this week.

7 of 8 - Instruction

Weekly Task (due Friday): Network Sandbox

Open the Network Sandbox and work in it each day. Today, load 5. Mystery network. The Network check panel lists what is wrong with the addresses. Fix them, then get a packet delivered. If a packet does not do what you expect, read section 2, IP addresses and MAC addresses in the field guide. Your weekly task is to finish the goals in scenarios 1, 3, 4, 5, and 6 by Friday (scenarios 2 and 7 are for fast finishers). Type your name in the sandbox once, and your progress saves on this device. Your score comes from the goals you finish. When you are done, press View my certificate, print it or save it as a PDF, and turn it in with your lab certificate. Everything in the sandbox is practice on simulated networks, never real ones.

8 of 8 - Instruction

Need Help?: Unit 3 Networking Field Guide

Stuck on a tool or a topic? Today, read section 2, IP addresses and MAC addresses in the field guide (the whole guide is here). It explains each idea, shows worked examples, and has a fix-it checklist. It never gives away your answers. The lab and the sandbox link to the matching section too, and every lab question has its own Show me an example button. For vocabulary and ports, open the Computer Science Hub, choose AP Cybersecurity, then the Vocabulary tab, or Cheat Sheets and the Common Ports filter.

Day 43

Wed 10/28

The TCP/IP model (conceptual layers) and reading hexadecimal in a packet header

1 of 9 - Story

FF Percent Sure

Why was the hex number so confident? It was FF percent sure.

2 of 9 - Vocab

TCP/IP model
A four-layer description of how data travels: application, transport, internet, and network access. Each layer has its own job. TCP, which opens a connection with a three-way handshake, works at the transport layer.
header
Extra information a layer adds to the front of the data, like source and destination addresses. A hex dump of a packet starts with these headers.
hexadecimal
Base 16. It uses the digits 0 to 9 and the letters A to F, where A is 10 and F is 15. One hex digit stands for 4 bits, so two hex digits make one byte.
hex dump
A display of raw bytes written in hex, usually with the matching ASCII characters beside them. Analysts use it to read packets and files.

3 of 9 - Scenario

Priya is reading a packet capture for the school's network team. The first 14 bytes of one frame, shown in hex, are: FF FF FF FF FF FF 3C 22 FB 9A 10 5E 08 00. She knows the first six bytes are the destination MAC address, the next six are the source MAC address, and the last two bytes say what kind of packet comes next: 08 00 means IPv4, 08 06 means ARP, and 86 DD means IPv6. She also knows that FF FF FF FF FF FF is the address that means every device on the LAN. Her teammate Leo says a frame like this must be meant for one specific laptop, because it has a MAC address in it.

What is this frame doing?

  • Correct
    It is a broadcast to every device on the LAN, sent from 3C:22:FB:9A:10:5E and carrying an IPv4 packet

    The destination bytes are all FF, which means everyone. The source is the next six bytes, 3C 22 FB 9A 10 5E. The last two bytes, 08 00, mean an IPv4 packet comes next.

    Ties to today: Reading a header one byte at a time is exactly what a hex dump is for.

  • Wrong
    It is sent to one specific laptop and carries an IPv4 packet

    All six destination bytes are FF, which is the broadcast address, so every device on the LAN receives it.

  • Wrong
    It is a broadcast to every device and carries an ARP message

    An ARP message would end in 08 06. These bytes end in 08 00, which means IPv4.

  • Wrong
    It is a broadcast to every device and carries an IPv6 packet

    An IPv6 packet would end in 86 DD. These bytes end in 08 00, which means IPv4.

4 of 9 - Quiz

  1. Which layer of the TCP/IP model uses IP addresses to move packets between networks?

    • CorrectThe internet layer
    • WrongThe application layer
    • WrongThe transport layer
    • WrongThe network access layer
  2. TCP and UDP belong to which layer of the TCP/IP model?

    • CorrectThe transport layer
    • WrongThe application layer
    • WrongThe internet layer
    • WrongThe network access layer
  3. What is the hex value FF in decimal?

    • Correct255
    • Wrong15
    • Wrong256
    • Wrong16
  4. The bytes 48 49 are ASCII codes. What text do they spell?

    • CorrectHI
    • WrongGH
    • WrongHJ
    • Wrong48 49
  5. Fill in: one hex digit stands for ___ bits.

    Accepted answers: 4, four

5 of 9 - Reflection

Convert the hex byte 2F to decimal and show your steps. Then explain why people who read packets like hex better than long strings of 1s and 0s.

6 of 9 - Instruction

Today's Task: Unit 3 Networking Lab - Day 3

Head to https://phillycomputerscience.com/lessons/labs/cyber-024-networking-lab.html#day3 and open the Day 3 tab. Walk down the four layers of the TCP/IP model, then read the first bytes of a frame in hex: find the destination MAC, the source MAC, and the packet type. Practice converting hex to decimal and back. Need a refresher? Try Flippy, which shows binary, decimal, and hex side by side. Type your name at the top so your progress and certificate save. Each topic needs 3 right answers in a row. Your certificate is orange this week.

7 of 9 - Instruction

Today's Practice: Hex Tutorial

Head to the Hex Tutorial and work through the four tabs: bits, hex digits, hex as text, and reading a real packet. It is the practice for today's lab, and it has its own orange certificate when you finish.

8 of 9 - Instruction

Weekly Task (due Friday): Network Sandbox

Open the Network Sandbox and work in it each day. Today, load 4. Two providers, send a packet, and read each frame in hex. Find the TTL and the two MAC addresses on every step. If a packet does not do what you expect, read section 4, The TCP/IP model and packet headers and section 3, Bits, bytes, and hexadecimal in the field guide. Your weekly task is to finish the goals in scenarios 1, 3, 4, 5, and 6 by Friday (scenarios 2 and 7 are for fast finishers). Type your name in the sandbox once, and your progress saves on this device. Your score comes from the goals you finish. When you are done, press View my certificate, print it or save it as a PDF, and turn it in with your lab certificate. Everything in the sandbox is practice on simulated networks, never real ones.

9 of 9 - Instruction

Need Help?: Unit 3 Networking Field Guide

Stuck on a tool or a topic? Today, read section 4, The TCP/IP model and packet headers and section 3, Bits, bytes, and hexadecimal in the field guide (the whole guide is here). It explains each idea, shows worked examples, and has a fix-it checklist. It never gives away your answers. The lab and the sandbox link to the matching section too, and every lab question has its own Show me an example button. For vocabulary and ports, open the Computer Science Hub, choose AP Cybersecurity, then the Vocabulary tab, or Cheat Sheets and the Common Ports filter.

Day 44

Thu 10/29

Ports and common protocols (HTTP, HTTPS, FTP, SSH); firewall allow/deny rules by port

1 of 8 - Story

It Runs SSH

Why is port 22 so good at keeping secrets? It runs SSH.

2 of 8 - Vocab

port
A number that says which service on a computer a packet is for. A computer can listen on many ports at once.
HTTP and HTTPS
HTTP is the plain web, on port 80, and it sends data in cleartext. HTTPS is the secure web, on port 443, and it encrypts the data.
FTP and SSH
FTP moves files, on port 21, and sends everything in cleartext. SSH gives encrypted remote access, on port 22.
firewall rule
An allow or deny decision for traffic, based on things like the port, the protocol, or the address. Rules are the core of an access control list.

3 of 8 - Scenario

Lakeside Clinic is setting up the web portal where patients read their test results. The server could be listening on four services: plain web (HTTP) on port 80, secure web (HTTPS) on port 443, file transfer (FTP) on port 21, and remote administration (SSH) on port 22. Patients need to reach the portal, staff need to manage the server remotely, and the clinic does not want passwords or medical data crossing the network in cleartext. The IT lead has to write the firewall's allow and deny rules. A new technician suggests allowing all four ports so that nothing breaks.

Which rule set best fits the clinic's goals?

  • Correct
    Allow ports 443 and 22, and deny ports 80 and 21

    Port 443 serves the portal over encrypted HTTPS, and port 22 lets staff manage the server over encrypted SSH. Ports 80 and 21 send data and passwords in cleartext, so they are denied.

    Ties to today: Writing allow and deny rules by port is exactly what the firewall lessons later in Unit 3 build on.

  • Wrong
    Allow ports 80 and 21, and deny ports 443 and 22

    That is backwards. It blocks the two encrypted services and allows the two cleartext ones.

  • Wrong
    Allow all four ports so nothing breaks

    Allowing everything leaves the cleartext services open. A rule set should allow only what the server needs.

  • Wrong
    Deny all four ports to be as safe as possible

    Denying everything would lock out both the patients and the staff, so the portal would stop working.

4 of 8 - Quiz

  1. Which port does HTTPS normally use?

    • Correct443
    • Wrong80
    • Wrong22
    • Wrong21
  2. Which port does SSH normally use?

    • Correct22
    • Wrong21
    • Wrong80
    • Wrong443
  3. Which of these sends its data in cleartext?

    • CorrectFTP
    • WrongSSH
    • WrongHTTPS
    • WrongA VPN
  4. A firewall rule says to deny port 80. What does it block?

    • CorrectPlain, unencrypted web traffic (HTTP)
    • WrongEncrypted web traffic (HTTPS)
    • WrongRemote logins over SSH
    • WrongNothing, because port 80 is not used
  5. Fill in: the default port for plain HTTP is ___.

    Accepted answers: 80, eighty

5 of 8 - Reflection

Pick one of HTTP, HTTPS, FTP, or SSH. Say what it is used for, which port it uses, and whether it sends data in cleartext. Then explain how a firewall rule would allow or deny it.

6 of 8 - Instruction

Today's Task: Unit 3 Networking Lab - Day 4

Head to https://phillycomputerscience.com/lessons/labs/cyber-024-networking-lab.html#day4 and open the Day 4 tab. Match ports to protocols, decide which ones send cleartext, and write allow and deny firewall rules for a clinic's web server. Stuck? Read section 5, Ports, protocols, and firewall rules and section 7, TCP, UDP, FTP, and sending files in the field guide. Type your name at the top so your progress and certificate save. Each topic needs 3 right answers in a row. Your certificate is orange this week.

7 of 8 - Instruction

Weekly Task (due tomorrow): Network Sandbox

Open the Network Sandbox and work in it each day. Today, load 3. One web request: ports. Find out which ports the server accepts, then add a firewall rule to the router and watch a packet get blocked. When you finish, load 6. FTP vs UDP and send the Photo both ways: UDP just sends, but FTP over TCP notices lost packets and sends them again. If a packet does not do what you expect, read section 5, Ports, protocols, and firewall rules and section 7, TCP, UDP, FTP, and sending files in the field guide. Your weekly task is to finish the goals in scenarios 1, 3, 4, 5, and 6 by Friday (scenarios 2 and 7 are for fast finishers). Type your name in the sandbox once, and your progress saves on this device. Your score comes from the goals you finish. When you are done, press View my certificate, print it or save it as a PDF, and turn it in with your lab certificate. Everything in the sandbox is practice on simulated networks, never real ones.

8 of 8 - Instruction

Need Help?: Unit 3 Networking Field Guide

Stuck on a tool or a topic? Today, read section 5, Ports, protocols, and firewall rules and section 7, TCP, UDP, FTP, and sending files in the field guide (the whole guide is here). It explains each idea, shows worked examples, and has a fix-it checklist. It never gives away your answers. The lab and the sandbox link to the matching section too, and every lab question has its own Show me an example button. For vocabulary and ports, open the Computer Science Hub, choose AP Cybersecurity, then the Vocabulary tab, or Cheat Sheets and the Common Ports filter.

Day 45

Fri 10/30

Work day: finish the Unit 3 lab and the Network Sandbox (last day of Quarter 1 grades)

1 of 5 - Story

Straight Through the Firewall

Why don't ghosts make good network admins? They keep passing right through the firewall.

2 of 5 - Reflection

Write down what you finished this week in the Network Sandbox and the lab, what is still left, and which of the four skills (IP and MAC addresses, TCP/IP layers, reading hex, or ports and protocols) you could now teach a classmate.

3 of 5 - Instruction

Work Day: Catch Up and Finish (Last Day of Quarter 1)

No new lesson today, and it is the last day for first quarter grades. Use the whole period to finish any tabs you have not passed in the Unit 3 Networking Lab and the scenario goals you have left in the Network Sandbox. If you are caught up, help a classmate who is stuck, or build your own network from an empty sandbox. The lab certificate is orange this week. Happy Halloween, and enjoy the parade.

4 of 5 - Instruction

Weekly Task (due today): Network Sandbox

Open the Network Sandbox and work in it each day. Today, finish any scenario you have not completed, including 6. FTP vs UDP. If you are done, try 7. Lakeside Clinic firewall or 2. School LAN. If a packet does not do what you expect, read section 8, If something is not working: a checklist and section 6, Reading a result in the Network Sandbox in the field guide. Your weekly task is to finish the goals in scenarios 1, 3, 4, 5, and 6 by Friday (scenarios 2 and 7 are for fast finishers). Type your name in the sandbox once, and your progress saves on this device. Your score comes from the goals you finish. When you are done, press View my certificate, print it or save it as a PDF, and turn it in with your lab certificate. Everything in the sandbox is practice on simulated networks, never real ones.

5 of 5 - Instruction

Need Help?: Unit 3 Networking Field Guide

Stuck on a tool or a topic? Today, read section 8, If something is not working: a checklist and section 6, Reading a result in the Network Sandbox in the field guide (the whole guide is here). It explains each idea, shows worked examples, and has a fix-it checklist. It never gives away your answers. The lab and the sandbox link to the matching section too, and every lab question has its own Show me an example button. For vocabulary and ports, open the Computer Science Hub, choose AP Cybersecurity, then the Vocabulary tab, or Cheat Sheets and the Common Ports filter.