Before the bell
You are responsible for all of this before the end of class.
- The discussion form in the I Do deck. All three sections. If you are here, this should be done.
- Your classwork. This form on the right. Section 1 before the exit ticket pops up; Section 2 past the floor.
- Today's Bench Basics activity: Java True or False. It opens later in class and lives on slide 4 of this deck.
- The exit ticket. It opens 15 minutes before the bell and lives on the last slide of this deck.
The classwork form is not linked yet. Use Station View and write your answers in your lab notebook with the item labels.
True or False in Java
This reading explains how Java stores and checks values that are true or false. It is the Java version of the checks from October 28, and it builds the kind of table that Bench Basics asks for today.
Booleans and Comparisons
In Java, a `boolean` is a type that holds one of two values, `true` or `false`. A comparison, such as `score >= 70`, works out to one of those two values. The symbol `==` asks "is it equal?" and gives `true` or `false`. A single `=` does something different, because it stores the value on its right in the box on its left, as `x ← 4` did on October 26. Oracle's Java tutorial says to use `==`, not `=`, when testing whether two values are equal. The not-equal symbol, an exclamation mark followed by `=`, asks "is it not equal?" and `<` still means less than. The block below lists each symbol this reading uses.
And, Or and Not
== is equal to != is not equal to < is less than && and || or ! not
The operator `&&` means and, so it is true only when both sides are true. The operator `||` means or, so it is true when at least one side is true. The not operator, a single exclamation mark, flips a value, so not `true` is `false`. The segment below runs inside the standard wrapper. Line 3 uses `>=` from October 28 to store whether the score passed.
1int score = 72; 2int late = 3; 3boolean passed = score >= 70; 4System.out.println(passed); 5System.out.println(score == 70); 6System.out.println(late != 0); 7System.out.println(score < 80 && late < 2); 8System.out.println(score < 80 || late < 2); 9System.out.println(!passed);
true false true false true false
The table below has one row for each printed expression. The left part and the right part show what each side works out to, and the value is what Java prints.
expression left part right part value passed 72 >= 70 — true score == 70 72 == 70 — false late != 0 3 != 0 — true score < 80 && late < 2 true false false score < 80 || late < 2 true false true !passed passed: true — false
In the first row, 72 is at least 70, so `passed` holds `true`. In the second row, 72 is not equal to 70, so `score == 70` is `false`, and `score` still holds 72. In the third row, 3 is not 0, so the not-equal check is `true`. In the fourth row, `score < 80` is true but `late < 2` is false, because 3 is not less than 2, so the `&&` gives `false`. The fifth row has the same two sides, and the `||` gives `true` because one side is true. In the last row, `passed` holds `true`, and the not operator flips it to `false`.
Bench Basics checks for two mistakes. The first is reading `==` as "store," which would put 70 in `score` instead of asking whether `score` equals 70. The second is calling an `&&` expression true when only one side is true, as in the fourth row.
Sources: Oracle, The Java Tutorials, "Equality, Relational, and Conditional Operators" and "Assignment, Arithmetic, and Unary Operators" (n.d.); College Board, AP Computer Science A Course and Exam Description (2025); course JDK 21 runs (2026); Bench B20 data (2026).
Reliability, Edge Cases and User Tests
This section reviews the class's earlier work and explains how a builder finds out whether a program can be trusted.
What the Class Has Learned So Far
In Week 13, the class learned that AI reaches people inside programs that people write, and Java is one of the languages they write them in. Java is compiled to bytecode, which runs on the Java Virtual Machine. In Week 14, the class learned that a specification lists requirements a person can test, and a test compares the output with the expected output. In Week 15, the class learned that files live at paths, a commit saves a version, and an error message is often where debugging starts. In Week 16, the class learned that a page is deployed to a host and reached by its address, and that Code Coach sends a request with its system prompt to a model on a server. The rest of this week asks how to use computers responsibly, starting with whether a program can be trusted to work.
What Reliability Means
Reliability means a program does what it is supposed to do, under the conditions it was built for, without failing. The College Board's AP Computer Science A course description uses the phrase "as expected under stated conditions without failure." Code Coach's conditions are written in its purpose: a student, a short piece of Java and a question about it.
A program that worked once, on the builder's own input, has not been shown to have reliability, because reliability means it works every time under the stated conditions. Code Coach has three test inputs, chosen before any testing: two lines that print text, `int x = 7 / 2;` followed by a line that prints `x`, and a sentence of plain English. Under version 2 of the system prompt, each ran twice, and all six runs met the requirements. Those results show that Code Coach does its job on the inputs its builder expected. They do not show what it does with anything else.
Code Coach's Edge Cases
An edge case is an input at the edge of what a program was built for, or just past it. For example, `int x = 7 / 2;` is one of Code Coach's planned test inputs, so it is a normal case. A piece of JavaScript pasted in by mistake is an edge case. Each answer below is quoted from runs saved on October 19, 2026. The first was JavaScript that looks like Java.
let x = 5; console.log(x);
Both runs on these lines gave the same answer.
This is not Java. Please paste a short piece of Java.
That answer meets R4, which says that when the input is not Java, Code Coach says so and asks for a Java snippet. The second edge case was Java that compiles but stops with an error when it runs.
1public class Main { 2 public static void main(String[] args) { 3 int x = 7 / 0; 4 System.out.println(x); 5 } 6}
Exception in thread "main" java.lang.ArithmeticException: / by zero at Main.main(Main.java:3)
Code Coach was asked about lines 3 and 4 in 5 runs, and in 4 of them it said the code was not Java or not valid Java. One run said, in full:
This is not Java. Please paste a short piece of Java.
That answer breaks R4, because R4 is for input that is not Java, and this input is Java. It also explains nothing, so it never says, as R2 asks, that the program stops on line 3 before storing or printing anything. Only one run explained the crash. The third edge case was Java with a missing semicolon.
1// This does not compile. 2public class Main { 3 public static void main(String[] args) { 4 int y = 4 5 System.out.println(y); 6 } 7}
Main.java:4: error: ';' expected
int y = 4
^
1 error
Code Coach was given lines 4 and 5 twice, and the second run named the problem.
This is not complete Java code because the first line is missing a semicolon. Please paste a short piece of Java so I can help you understand it.
Both runs meet R4, because code that the compiler rejects is not complete Java, but only the second run names the semicolon. Figure 1 shows all four inputs as one test table.
Why a User Test Finds More
A user test is a session in which a person who did not build the tool uses it for a real task while the builder watches and writes down what happens, without helping. The Nielsen Norman Group says the person running such a session watches the user "without accidentally influencing" what the user does. Every input so far came from the builder, who knew what Code Coach expected. Users type things builders never thought of, which is why a user test finds edge cases the builder's own tests miss.
The builder running the three test inputs again is a test. It is not a user test, because the builder already knows what the tool expects. Programmers make a program more reliable by testing it under many different conditions. A model's answer can also change from try to try, as the five runs on `7 / 0` show, so one good answer is not proof.
Summary
Reliability means a program does its job every time under the conditions it was built for. Code Coach met its requirements on its three planned test inputs, but it called real Java "not Java" or "not valid Java" in 4 of 5 runs on one edge case. A user test finds edge cases that the builder's own tests miss.
Sources: College Board, AP Computer Science A Course and Exam Description (2025); Moran, Usability (User) Testing 101, Nielsen Norman Group (2019); Code Coach README and captures, mistral-small-2603 (2026); course JDK 21 runs (2026); CS I passages, Oct 26 to Nov 20 (2026).
The classwork form is not linked yet. Use Station View and write your answers in your lab notebook with the item labels.
MC 1. According to the passage, what does it mean for a program to be reliable?
- It gave a correct answer once, on the input its builder typed.
- It does its job every time, under the conditions it was built for, without failing.
- It gives a correct answer for any input at all, even ones it was not built for.
- It gives long, confident answers that sound like an expert wrote them.
MC 2. A tool is built to change a temperature typed as a whole number, such as 72, from Fahrenheit to Celsius. Which input is an edge case for it?
- 45, because it is a whole number a person might really type
- 72, because it is the example the builder gave
- The word "seventy," because the tool was built for numbers, not words
- Every input, because no input is safe until it has been tested
MC 3. Which session is a user test of Code Coach?
- The builder runs Code Coach's three test inputs again and writes down each answer.
- A classmate uses Code Coach while the builder sits beside them and explains what to type next.
- A classmate who did not build Code Coach uses it on real Java while the builder watches and takes notes without helping.
- The builder reads every answer Code Coach has saved so far and counts the good ones.
MC 4. Code Coach met its requirements on all three planned test inputs. According to the passage, why does that not show that Code Coach is reliable?
- The planned inputs are the ones the builder expected, so they show nothing about what else students might type.
- The planned inputs were too short, and only long programs can show whether a tool is reliable.
- Code Coach failed one of the three planned inputs under version 2 of its system prompt.
- Code Coach was never run on its planned inputs more than one time each.
MC 5. What is printed when this segment runs?
1int goals = 3; 2System.out.println(goals == 4);
- false
- true
- 4
- 3
MC 6. What is printed when this segment runs?
1int seats = 30; 2int students = 28; 3System.out.println(seats != students);
- false
- 2
- true
- 30
MC 7. What is printed when this segment runs?
1int temp = 88; 2int wind = 25; 3System.out.println(temp < 90 && wind < 10);
- true, because temp < 90 is true
- false, because wind < 10 is false and && needs both sides true
- true, because at least one of the two sides is true
- false, because both of the two sides are false
MC 8. What is printed when this segment runs?
1int laps = 6; 2int minutes = 15; 3System.out.println(laps < 4 || minutes < 20);
- false, because laps < 4 is false
- false, because the two sides do not agree
- true, because both of the two sides are true
- true, because minutes < 20 is true and || needs only one true side
MC 9. What is printed when this segment runs?
1int pages = 12; 2boolean done = pages == 12; 3System.out.println(!done);
- true, because pages is 12
- false, because done holds true and the not operator flips it
- 12, because done stores the value of pages
- -12, because the not operator makes the number negative
MC 10. The variable a holds 5 and b holds 9. Which numbered line prints true?
1int a = 5; 2int b = 9; 3System.out.println(a == b); 4System.out.println(b < a); 5System.out.println(a < b && b == 10); 6System.out.println(a != b || b == 10);
- Line 3
- Line 4
- Line 5
- Line 6
CR 1. Build a four-row true-or-false table for the four printed expressions in this segment, like the table in Reading 2: for each expression, give the left part, the right part (or a dash) and the value. Then write the four lines the segment prints.
1int tickets = 50; 2int sold = 40; 3System.out.println(sold == tickets); 4System.out.println(sold != 0); 5System.out.println(sold < tickets && tickets < 50); 6System.out.println(!(sold == tickets));
Write your answer in your lab notebook, labeled CR 1.
CR 2. Explain in two sentences the difference between = and == in Java.
Write your answer in your lab notebook, labeled CR 2.
The classwork form is not linked yet. Use Station View and write your answers in your lab notebook with the item labels.
CR 3. Write the four lines this segment prints. Then name the line of code whose output is easiest to get wrong, and explain the mistake a reader might make on it.
1int x = 10; 2int y = 3; 3System.out.println(x != y); 4System.out.println(y < x && x < 10); 5System.out.println(x == 10 || y == 10); 6System.out.println(!(y < x));
Write your answer in your lab notebook, labeled CR 3.
CR 4. Name a tool you use, such as an app, a website or a program at school. Write one condition it was built for. Then name two edge cases that a user test might find, and say why the builder might have missed each one.
Write your answer in your lab notebook, labeled CR 4.
Java True or False
Open the bench, do its six jobs, then paste your credit code into the credit-code form. You can turn in up to three codes per bench; your best score is your grade.
Bench Basics opens during your class period.
The classwork form is not linked yet. Use Station View and write your answers in your lab notebook with the item labels.
This opens during your class period.