CMU CS Academy Unit 2: What You Actually Need to Know
The CMU CS Academy ran for many years as a free intro-to-computing platform, and Unit 2 was where things started getting real. It covered Boolean expressions, conditionals, nested if-else statements, and the basics of loop structures. If you're working through the problems now, you are likely running into the practice exercises and quiz questions that trip up a lot of people. Here is what I found when I went through it recently. The Unit 2 answer key is scattered across a few community resources. The most reliable one I found lives on a GitHub repository maintained by former students who went through the course in the 2018 to 2022 window. It covers every single practice exercise and quiz question. The answers are written in Java since that is the language CMU CS Academy uses for Unit 2. A lot of people copy-paste the solutions without understanding them, which defeats the purpose entirely. I recommend reading each answer and then typing out the logic yourself before you submit anything. One thing worth noting about the Unit 2 material is that the practice problems build incrementally, but the quiz questions sometimes combine multiple concepts in ways the practice set never does. The practice sets teach you how to write a basic if statement. The quiz will ask you to evaluate a nested conditional with mixed Boolean operators and you need to trace through it manually. That gap is real. I ran into it directly when I was helping someone go through the course last year.
Here is the specific problem I encountered. There is a quiz question in Unit 2 that asks you to determine the output of a nested if-else block where the conditions use && and || mixed together without parentheses. The answer key gives the correct output, but the explanation is basically nonexistent. I spent about twenty minutes tracing through that exact block on paper because the order of operations for Boolean operators was tripping us up. The workaround was to rewrite each condition with explicit parentheses to match Java's operator precedence rules. Once I did that, the evaluation path became obvious. I would strongly suggest doing the same whenever a Boolean expression in the quiz looks ambiguous. The core concepts in Unit 2 come down to three things. First is understanding how comparison operators work and why they produce Boolean values. Second is the difference between assignment and equality checks, which sounds trivial but costs people points on almost every quiz. Third is the structure of nested conditionals and how the else clause always pairs with the nearest unmatched if. That last one is not intuitive at first. Another common trap in Unit 2 involves short-circuit evaluation. If you have a condition like x != 0 && something / x > 5, the second part will not execute if x is zero. This matters because the quiz sometimes includes edge cases where a division by zero would crash your program if the short-circuit does not kick in first. The answer key usually marks the safe version as correct, but you need to recognize why it is safe. Without that understanding, you are just memorizing answers and you will get burned when the next unit tests you on actual implementation.
If you are looking for the actual answers, search for the CMU CS Academy solutions repository on GitHub. Look for the Unit 2 folder. The files are organized by exercise number, so finding what you need is straightforward. Some people also post their work on the CMU CS Academy discussion boards. The responses there are hit or miss, but occasionally someone posts a thorough walkthrough that explains the reasoning behind a particular answer. There are some limitations to relying on an answer key. The official CMU CS Academy platform has been taken offline in recent years, and mirror sites are not always kept up to date. The versions that are available sometimes have slightly different question numbers or altered answer choices compared to what the original course had. I encountered this when I was referencing an older key against a preserved copy of the course. Two of the practice problems had been renumbered, so the answers were off by a row. I caught it by comparing the question text itself rather than trusting the numbering. Always verify the question matches before you look at the answer. Another limitation is that the answer key only covers the official practice exercises and quizzes. It does not cover the later projects that combine Unit 2 concepts with Unit 1 material. If you are trying to solve one of those combined challenges and you only studied Unit 2 in isolation, you will run into problems the key does not address. In that case, the best move is to go back and review Unit 1's method definitions and parameter passing before you attempt the integrated problem. The gap in understanding usually comes from Unit 1, not Unit 2.
Get the Full Details

The loop section at the end of Unit 2 is where most people slow down. You need to be comfortable with while loops and the basic for loop structure. The key insight that beginners miss is that a while loop and a for loop are interchangeable in most of these exercises. The quiz will sometimes present a problem where the given solution uses a while loop but a for loop would be cleaner. Knowing how to convert between them will save you time during the coding exercises. I also found it useful to write out the loop invariant for each problem before coding it. That means stating clearly what is true at the start of each iteration. For a simple summing loop, the invariant is that the running total equals the sum of all elements processed so far. Once you state that, writing the code becomes almost mechanical. The answer key follows this same logic for every loop problem, so if you adopt the same approach you will find the key much easier to use as a checking tool rather than a crutch. For anyone working through this unit right now, here is the practical sequence I recommend. First, attempt every practice exercise without looking at any key. Second, check your answers and mark everything you got wrong. Third, go back to the wrong answers and trace through them on paper using the short-circuit and operator precedence rules I mentioned earlier. Fourth, use the answer key only to confirm your final understanding. This takes longer upfront but it prevents the common mistake of treating the key as a substitute for actually learning the material.
The entire Unit 2 section typically takes between four and six hours to complete if you are doing it properly. If you are rushing through and just copying answers, you can finish in under an hour, but you will not retain anything past the quiz. That trade-off is worth being honest about. The material itself is not difficult. It is foundational enough that how you approach it now will affect every unit that comes after.