CodeYard: Learning to Program in Java
Sort by: Curriculum unit & section · Just problems, by category
Show: Everything · Lessons · Worksheets · Problems
- Introduction to Algorithms 1.1 Worksheet 🌶️ An algorithm is an ordered series of steps to solve a problem. Let's say that you are …
- Build the line: declare and initialize temperature 1.1 Worksheet 🌶️ Click the tokens below, in order, to build a line that declares an integer variable named…
- Line trace: swapping two values with temp 1.3 Worksheet 🌶️ Below is a method that swaps two values using a temp variable. Trace a, b, and temp immed…
- Expression and Assignment Tracing 1.4 Worksheet 🌶️🌶️ Practice for evaluating expressions and tracing what each assignment statement actually d…
- Method Signatures and Calling Methods 1.9 Worksheet 🌶️🌶️ A few key ideas this worksheet checks: - Procedural abstraction: you can use a method …
- Predict the Output: Calling Methods 1.9 Worksheet 🌶️🌶️ Before you run any of this code, work it out by hand. Every question here is about what a…
- Method Vocabulary and Contracts 1.9 Worksheet 🌶️ A library, a package, and an API documentation page are three different things — and a Ja…
- Method Calls in Expressions 1.9 Worksheet 🌶️🌶️ A method call inside a larger expression runs first, and its return value takes its place…
- Unit 1 Review: Tough Expressions 1.9 Worksheet 🌶️🌶️ The hardest kind of Unit 1 multiple-choice question: an expression that mixes operators, …
- The Math Class: random() 1.11 Worksheet 🌶️🌶️ `Math.random()` returns a double value that is always greater than or equal to 0.0, and a…
- Unit 1 Review: Methods, Objects, and null 1.14 Worksheet 🌶️🌶️ A review for the end of Unit 1: how a method call is chosen and what it returns, how `==`…
- String Objects, Concatenation, and Indexes 1.15 Worksheet 🌶️ A **String** in Java is not a primitive type like `int` or `double`, it is an **object**,…
- substring: Bounds and Overloads 1.15 Worksheet 🌶️🌶️ `substring` is the method you will reach for constantly, and it is also the easiest one t…
- Find the Index, Then Cut 1.15 Worksheet 🌶️🌶️ Nearly every String task on the AP exam has the same shape: **find** where something is, …
- Comparing Strings: compareTo 1.15 Worksheet 🌶️🌶️ `equals` answers a yes-or-no question: do these two Strings hold the same characters? `co…
- Unit 1 Review: What Do These String Calls Return? 1.15 Worksheet 🌶️🌶️ A review for the end of Unit 1: the String methods that the quiz and the test keep asking…
- Find the Line: Errors in Unit 1 Code 1.17 Worksheet 🌶️🌶️ Reading an error is a skill of its own. Each program below has exactly one thing wrong wi…
- Nested if Statements and Multiway Selection 2.4 Worksheet 🌶️🌶️ An if statement can contain another if statement inside its own body — this is called nes…
- Boolean Operators: Quick Reference 2.5 Worksheet 🌶️ This page reviews the three boolean operators you'll use constantly in conditionals, then…
- Truth Tables and Venn Diagrams 2.5 Worksheet 🌶️ Two ways to see exactly when a compound boolean expression is true: a **truth table** lis…
- Compound Boolean Expressions: Precedence and Short-Circuit Evaluation 2.5 Worksheet 🌶️🌶️ Quick recap from the boolean-operators reference: `!` (not), `&&` (and), and `||` (or) co…
- Equivalent Boolean Expressions 2.6 Worksheet 🌶️ Two boolean expressions are **equivalent** when they produce the exact same result for ev…
- Unit 2 Review: Conditions and Branches 2.6 Worksheet 🌶️🌶️ A review for the end of Unit 2: boolean operators and their precedence, short-circuit eva…
- Trace: palindrome check indices 2.8 Worksheet 🌶️🌶️ Below is the loop from a palindrome checker for the String s = "level" (length 5). Trace …
- Algorithm Shapes: The Sliding Window 2.10 Worksheet 🌶️🌶️🌶️ Challenge Every algorithm you have seen so far either walks a string/array once (one loop) or check…