 <p>You're trying to do this:</p> <pre><code>switch (responsegen) { //... } else //... </code></pre> <p>You can't follow a <code>switch</code> statement with an <code>else</code>. <code>switch</code> uses the <code>default</code> clause within its list of cases as a logical "else". (Which you're using already, so what you're doing doesn't even semantically make sense.)</p> <p>Maybe you meant to attach the <code>else</code> to the preceding <code>if</code> block?:</p> <pre><code>if (answer == (num1 * num2)) { //... switch (responsegen) { //... } // &lt;-- first close the switch block } else // &lt;-- then continue the if block //... </code></pre> <p>As you continue learning about programming, you'll find that using consistent and clean use of whitespace (carriage returns, indentation, etc.) makes things like this <em>a lot</em> easier to find.</p>