<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">

<channel>
    <title>Learn AP Comp Sci Problem-of-the-Day</title>
    <link>https://www.learnapcompsci.com/</link>
    <description>Daily AP-style multiple choice problems in Computer Science</description>
    <atom:link href="https://www.learnapcompsci.com/feed.xml" rel="self" type="application/rss+xml" />
<item>
                <title>New Problem of the Day!</title>
                <link>https://www.learnapcompsci.com/problem.php?pc=dee988c8</link>
                <description>
                    <![CDATA[<!--startproblem--><p>Friday, November 6, 2026</p><hr /><p><b>Problem:</b></p><p>Which of the following loops will print out the numbers 1-11, inclusive?</p><ol type='I'><li><br /><pre>int i = 1;<br />while (i < 12)<br />{<br />    System.out.println(i);<br />    i++;<br />}</pre></li><li><br /><pre>int i = 1;<br />while (i <= 11)<br />{<br />    System.out.println(i);<br />    i++;<br />}</pre></li><li><br /><pre>int i = 0;<br />while (i < 11)<br />{<br />    i++;<br />    System.out.println(i);<br />}</pre></li></ol><ol type='a'><li>I only</li><li>I and II only</li><li>I and III only</li><li>I, II, and II</li></ol><!--pc=dee988c8--><!--endproblem--><p>See the solution <a href='https://www.learnapcompsci.com/problem.php?pc=dee988c8'>here</a>.</p>]]>
                </description>
                <pubDate>Fri, 06 Nov 2026 08:57:01 -0800</pubDate>
                <guid isPermaLink="false">problem-dee988c8</guid>
            </item>
<item>
                <title>New Problem of the Day!</title>
                <link>https://www.learnapcompsci.com/problem.php?pc=82268e9c</link>
                <description>
                    <![CDATA[<!--startproblem--><p>Thursday, November 5, 2026</p><hr /><p><b>Problem:</b></p><p>A <code>for</code> loop is written with the header</p><pre>for (int i = a; i < b; i++)</pre><p>... where <code>int</code> variables <code>a</code> and <code>b</code> have been assigned values, with <code>a&lt;=b</code>. Which characteristics below correctly describe this loop?</p><table border='0' style='text-align: center'><tr><td>&nbsp;</td><td style='background: #eee; border: solid 1px #000; padding: 0 2em;'><b>initial value of i</b></td><td style='background: #eee; border: solid 1px #000; padding: 0 2em;'><b>final value of i</b></td><td style='background: #eee; border: solid 1px #000; padding: 0 2em;'><b>number of times the loop repeats</b></td></tr><tr><td>a.</td><td>a</td><td>b</td><td>b - a</td></tr><tr><td>b.</td><td>a</td><td>b - 1</td><td>b - a + 1</tr><tr><td>c.<td>a</td></td><td>b</td><td>b - a + 1</td></tr><tr><td>d.</td><td>a</td><td>b - 1</td><td>b - a</td></tr></table><!--pc=82268e9c--><!--endproblem--><p>See the solution <a href='https://www.learnapcompsci.com/problem.php?pc=82268e9c'>here</a>.</p>]]>
                </description>
                <pubDate>Thu, 05 Nov 2026 08:57:02 -0800</pubDate>
                <guid isPermaLink="false">problem-82268e9c</guid>
            </item>
<item>
                <title>New Problem of the Day!</title>
                <link>https://www.learnapcompsci.com/problem.php?pc=3132935b</link>
                <description>
                    <![CDATA[<!--startproblem--><p>Wednesday, November 4, 2026</p><hr /><p><b>Problem:</b></p><p>Consider the following method, which is intended to count the number of double-letter occurrences in a string.</p><pre>/**<br /> * returns the number of double-letter occurrences in a string<br /> * Examples: &quot;Ramadan&quot; returns 0, repeated letters aren't sequential<br /> *           &quot;Christmas&quot; return 0<br /> *           &quot;Hannukah&quot; return 1 for the double &quot;n&quot;<br /> *           &quot;Halloween&quot; returns 2 for the doubled &quot;l&quot; and doubled &quot;e&quot;<br /> */<br />public static int doubleLetterCounter(String str)<br />{<br />    <br />    <i>/* missing code */</i><br />    <br />}</pre><p>Which of the following could be used to replace <code><i>/* missing code */</i></code> so that the method will work as intended?</p><ol type='a'><li><br /><pre>int count = 0;<br />for (int i = 0; i < str.length(); i++)<br />{<br />    if (str.substring(i - 1, i).equals(str.substring(i, i + 1)))<br />        count++;<br />}<br />return count;</pre></li><li><br /><pre>int count = 0;<br />for (int i = 0; i < str.length(); i++)<br />{<br />    if (str.substring(i, i + 1).equals(str.substring(i + 1, i + 2)))<br />        count++;<br />}<br />return count;</pre></li><li><br /><pre>int count = 0;<br />for (int i = 1; i < str.length(); i++)<br />{<br />    if (str.substring(i - 1, i).equals(str.substring(i, i + 1)))<br />        count++;<br />}<br />return count;</pre></li><li><br /><pre>int count = 0;<br />for (int i = 1; i < str.length() - 1; i++)<br />{<br />    if (str.substring(i - 1, i).equals(str.substring(i, i + 1)))<br />        count++;<br />}<br />return count;</pre></li></ol><!--pc=3132935b--><!--endproblem--><p>See the solution <a href='https://www.learnapcompsci.com/problem.php?pc=3132935b'>here</a>.</p>]]>
                </description>
                <pubDate>Wed, 04 Nov 2026 08:57:01 -0800</pubDate>
                <guid isPermaLink="false">problem-3132935b</guid>
            </item>
<item>
                <title>New Problem of the Day!</title>
                <link>https://www.learnapcompsci.com/problem.php?pc=65b22ddd</link>
                <description>
                    <![CDATA[<!--startproblem--><p>Tuesday, November 3, 2026</p><hr /><p><b>Problem:</b></p><p>The boolean variable <code>social</code> is set to <code>true</code> when the user feels like being around other people, and otherwise is <code>false</code>. And the boolean variable <code>active</code> is set to <code>true</code> when the user feels like a more physical activity, but is otherwise <code>false</code>. A user who is feeling like being active might &quot;play soccer with friends&quot; or &quot;hike alone&quot;; otherwise, they might &quot;hang out at cafe with friends&quot; or &quot;read (alone)&quot;. Which series of boolean statements will print the correct activity for a user based on the values of <code>social</code> and <code>active</code>?</p><ol type='a'><li><br /><pre>if (!active)<br />    if (social)<br />        System.out.println(&quot;hang out at cafe with friends&quot;);<br />    else<br />        System.out.println(&quot;read (alone)&quot;);<br />else<br />    if (social)<br />        System.out.println(&quot;go hiking alone&quot;);<br />    else<br />        System.out.println(&quot;play soccer with friends&quot;);</pre></li><li><br /><pre>if (!active)<br />    if (social)<br />        System.out.println(&quot;hang out at cafe with friends&quot;);<br />    else<br />        System.out.println(&quot;read (alone)&quot;);<br />else<br />    if (!social)<br />        System.out.println(&quot;go hiking alone&quot;);<br />    else<br />        System.out.println(&quot;play soccer with friends&quot;);</pre></li><li><br /><pre>if (active)<br />    if (social)<br />        System.out.println(&quot;hang out at cafe with friends&quot;);<br />    else<br />        System.out.println(&quot;go hiking alone&quot;);<br />else<br />    if (social)<br />        System.out.println(&quot;play soccer with friends&quot;);<br />    else<br />        System.out.println(&quot;read (alone)&quot;);</pre></li><li><br /><pre>if (social)<br />    if (active)<br />        System.out.println(&quot;hang out at cafe with friends&quot;);<br />    else<br />        System.out.println(&quot;go hiking alone&quot;);<br />else<br />    if (active)<br />        System.out.println(&quot;play soccer with friends&quot;);<br />    else<br />        System.out.println(&quot;read (alone)&quot;);</pre></li></ol><!--pc=65b22ddd--><!--endproblem--><p>See the solution <a href='https://www.learnapcompsci.com/problem.php?pc=65b22ddd'>here</a>.</p>]]>
                </description>
                <pubDate>Tue, 03 Nov 2026 08:57:02 -0800</pubDate>
                <guid isPermaLink="false">problem-65b22ddd</guid>
            </item>
<item>
                <title>New Problem of the Day!</title>
                <link>https://www.learnapcompsci.com/problem.php?pc=e9918f6e</link>
                <description>
                    <![CDATA[<!--startproblem--><p>Monday, November 2, 2026</p><hr /><p><b>Problem:</b></p><p>A programming version of the game of <a href=&quot;https://en.wikipedia.org/wiki/Fizz_buzz&quot;>FizzBuzz</a> involves counting from 0 (inclusive) to 100 (exclusive). The code should print on separate lines each number, unless the number is evenly divisible by 3, in which case the program should print &quot;Fizz&quot;, or if the number is evenly divisible by 5, in which case the program should print &quot;Buzz&quot;. If the number is evenly divisible by both 3 and 5, it should print &quot;FizzBuzz&quot;. Which of the following loops will produce the correct output?</p><ol type=&quot;I&quot;><li><br /><pre>for (int i = 0; i < 100; i++)<br />{<br />    if (i % 3 == 0)<br />        if (i % 5 == 0)<br />            System.out.println(&quot;FizzBuzz&quot;);<br />        else<br />            System.out.println(&quot;Fizz&quot;);<br />    else if (i % 5 == 0)<br />        System.out.println(&quot;Buzz&quot;);<br />    else<br />        System.out.println(i);<br />}</pre></li><li><br /><pre>for (int i = 0; i < 100; i++)<br />{<br />    if (i % 3 == 0 && i % 5 == 0)<br />        System.out.println(&quot;FizzBuzz&quot;);<br />    else if (i % 3 == 0)<br />        System.out.println(&quot;Fizz&quot;);<br />    else if (i % 5 == 0)<br />        System.out.println(&quot;Buzz&quot;);<br />    else<br />        System.out.println(i);<br />}</pre></li><li><br /><pre>for (int i = 0; i < 100; i++)<br />{<br />    if (!(i % 3 == 0 || i % 5 == 0))<br />        System.out.println(i);<br />    else <br />    {<br />        if (i % 3 == 0)<br />            System.out.print(&quot;Fizz&quot;);<br />        if (i % 5 == 0)<br />            System.out.print(&quot;Buzz&quot;);<br />        System.out.println();<br />    }<br />}</pre></li></ol><ol type='a'><li>I only</li><li>II only</li><li>I and II only</li><li>I, II, and III</li></ol><!--pc=e9918f6e--><!--endproblem--><p>See the solution <a href='https://www.learnapcompsci.com/problem.php?pc=e9918f6e'>here</a>.</p>]]>
                </description>
                <pubDate>Mon, 02 Nov 2026 08:57:02 -0800</pubDate>
                <guid isPermaLink="false">problem-e9918f6e</guid>
            </item>
<item>
                <title>New Problem of the Day!</title>
                <link>https://www.learnapcompsci.com/problem.php?pc=99425e0f</link>
                <description>
                    <![CDATA[<!--startproblem--><p>Friday, October 30, 2026</p><hr /><p><b>Problem:</b></p><p>Consider the following method.</p><pre>/**<br /> * Identifies names that begin with A<br /> * @param name a string that *may* be null!<br /> */<br />public static void initial(String name)<br />{<br />    if ( <i>/* missing code */</i> )</br>        System.out.println(&quot;Begins with A&quot;);<br />    else<br />         System.out.println(&quot;Doesn't begin with an A&quot;);<br />}</pre><p>Which of the following boolean expressions can be used to replace the <code><i>/* missing code */</i></code> so that the method works as intended?</p><ol type='I'><li><br /><pre>name.substring(0,1).equals(&quot;A&quot;) && name != null</pre></li><li><br /><pre>name != null && name.substring(0,1).equals(&quot;A&quot;)</pre></li></ol><ol type='a'><li>I only</li><li>II only</li><li>Both I and II</li><li>Neither I nor II</li></ol><!--pc=99425e0f--><!--endproblem--><p>See the solution <a href='https://www.learnapcompsci.com/problem.php?pc=99425e0f'>here</a>.</p>]]>
                </description>
                <pubDate>Fri, 30 Oct 2026 08:57:01 -0700</pubDate>
                <guid isPermaLink="false">problem-99425e0f</guid>
            </item>
<item>
                <title>New Problem of the Day!</title>
                <link>https://www.learnapcompsci.com/problem.php?pc=0d648dbc</link>
                <description>
                    <![CDATA[<!--startproblem--><p>Thursday, October 29, 2026</p><hr /><p><b>Problem:</b></p><p>A game program is designed so that it prints the message <code>&quot;Let's go!&quot;</code> if the user wants to play again. The <code>String</code> variable <code>playAgain</code> has a value of <code>&quot;y&quot;</code> if the user wants to play the game again. The programmer also wants the program to run the game again (and print the message) if <code>playAgain</code> has a value of <code>&quot;&quot;</code> (the empty string). If <code>playAgain</code> doesn't have a value of <code>&quot;y&quot;</code> or <code>&quot;&quot;</code>, the program should print the message <code>&quot;Goodbye!&quot;</code>. Which of these conditional statements will correctly print the message <code>&quot;Let's go!&quot;</code> based on the value of <code>playAgain</code>?</p><ol type='a'><li><br /><pre>if (playAgain.substring(0,1).equals(&quot;y&quot;) || playAgain.length() == 0)<br />    System.out.println(&quot;Let's go!&quot;);<br />else<br />    System.out.println(&quot;Goodbye!&quot;);</pre></li><li><br /><pre>if (playAgain.length() == 0 || playAgain.substring(0,1).equals(&quot;y&quot;))<br />    System.out.println(&quot;Let's go!&quot;);<br />else<br />    System.out.println(&quot;Goodbye!&quot;);</pre></li><li><br /><pre>if (playAgain.length() != 0 || !playAgain.substring(0,1).equals(&quot;n&quot;))<br />    System.out.println(&quot;Let's go!&quot;);<br />else<br />    System.out.println(&quot;Goodbye!&quot;);</pre></li><li><br /><pre>if (!playAgain.substring(0,1).equals(&quot;n&quot;) || playAgain.length() != 0)<br />    System.out.println(&quot;Goodbye!&quot;);<br />else<br />    System.out.println(&quot;Let's go!&quot;);</pre></li></ol><!--pc=0d648dbc--><!--endproblem--><p>See the solution <a href='https://www.learnapcompsci.com/problem.php?pc=0d648dbc'>here</a>.</p>]]>
                </description>
                <pubDate>Thu, 29 Oct 2026 08:57:01 -0700</pubDate>
                <guid isPermaLink="false">problem-0d648dbc</guid>
            </item>
<item>
                <title>New Problem of the Day!</title>
                <link>https://www.learnapcompsci.com/problem.php?pc=5ecddb3f</link>
                <description>
                    <![CDATA[<!--startproblem--><p>Wednesday, October 28, 2026</p><hr /><p><b>Problem:</b></p><p>Three students are having a discussion about the order of operations in Boolean logic. One says that <code>&&</code> is evaluated before <code>||</code>, the second states that <code>||</code> is evaluated before <code>&&</code>, and the third says that <code>&&</code> and <code>||</code> ) have the same priority and are simply evaluated in order, left to right.</p><p>To demonstrate the validity of her statement, one of the students runs a program to evaluate the expression <code>true || true && false</code>, which produces the result <code>true</code>. Which Boolean order of operations is correct?</p><ol type='a'><li><code>&&</code> is evaluated before <code>||</code></li><li><code>||</code> is evaluated before <code>&&</code></li><li><code>&&</code> and <code>||</code> have the same priority, and are evaluated in order, left to right</li><li>none of these</li></ol><!--pc=5ecddb3f--><!--endproblem--><p>See the solution <a href='https://www.learnapcompsci.com/problem.php?pc=5ecddb3f'>here</a>.</p>]]>
                </description>
                <pubDate>Wed, 28 Oct 2026 08:57:02 -0700</pubDate>
                <guid isPermaLink="false">problem-5ecddb3f</guid>
            </item>
<item>
                <title>New Problem of the Day!</title>
                <link>https://www.learnapcompsci.com/problem.php?pc=fa97db84</link>
                <description>
                    <![CDATA[<!--startproblem--><p>Tuesday, October 27, 2026</p><hr /><p><b>Problem:</b></p><p>The complex boolean expression shown here includes <code>int</code> values <code>n1</code>, <code>n2</code>, and <code>n3</code>.</p><pre>!(n1 &gt;= n2 || !(n3 &lt; 7))</pre><p>Which of the following expressions represents a valid simplification of the expression above?</p><ol type='a'><li><code>!n1 &gt;= !n2 && !n3 &gt;= 7</code></li><li><code>n1 &lt; n2 || n3 &lt; 7</code></li><li><code>n1 &lt; n2 || n3 &gt; 7</code></li><li><code>n1 &lt; n2 && n3 &lt; 7</code></li></ol><!--pc=fa97db84--><!--endproblem--><p>See the solution <a href='https://www.learnapcompsci.com/problem.php?pc=fa97db84'>here</a>.</p>]]>
                </description>
                <pubDate>Tue, 27 Oct 2026 08:57:01 -0700</pubDate>
                <guid isPermaLink="false">problem-fa97db84</guid>
            </item>
<item>
                <title>New Problem of the Day!</title>
                <link>https://www.learnapcompsci.com/problem.php?pc=4f87f9d7</link>
                <description>
                    <![CDATA[<!--startproblem--><p>Monday, October 26, 2026</p><hr /><p><b>Problem:</b></p><p>Two <code>int</code> variables have been initialized as shown here.<pre>int x = 3;<br />int y = 7;</pre><p>Which of the following code segments will produce the output <code>2,8</code> ?</p><ol type='a'><li><br /><pre>if (!(x - 3 &lt;= 0 && y + 2 &lt;= 9))<br />{<br />    x = x - 1;<br />    y = y + 1;    <br />}<br />System.out.println(x + &quot;,&quot; + y);</pre></li><li><br /><pre>if (!(!(x - 3 &gt; 0) && y + 2 &lt; 9))<br />{<br />    x = x - 1;<br />    y = y + 1;    <br />}<br />System.out.println(x + &quot;,&quot; + y);</pre></li><li><br /><pre>if (!(x - 3 &gt;= 0) || y + 2 &gt; 9)<br />{<br />    x = x - 1;<br />    y = y + 1;   <br />}<br />System.out.println(x + &quot;,&quot; + y);</pre></li><li><br /><pre>if (!(x - 3 &gt;= 0 && !(y + 2 &lt; 9))<br /><br />{<br />    x = x - 1;<br />    y = y + 1;<br />}<br />System.out.println(x + &quot;,&quot; + y);</pre></li></ol><!--pc=4f87f9d7--><!--endproblem--><p>See the solution <a href='https://www.learnapcompsci.com/problem.php?pc=4f87f9d7'>here</a>.</p>]]>
                </description>
                <pubDate>Mon, 26 Oct 2026 11:11:20 -0700</pubDate>
                <guid isPermaLink="false">problem-4f87f9d7</guid>
            </item>
<item>
                <title>New Problem of the Day!</title>
                <link>https://www.learnapcompsci.com/problem.php?pc=03f60d30</link>
                <description>
                    <![CDATA[<!--startproblem--><p>Friday, October 23, 2026</p><hr /><p><b>Problem:</b></p><p>Consider the code fragment <pre>double balance = 13.95;<br />// dollars is intended to hold the dollar part of the balance<br />int dollars = balance;</pre><p>What happens as a result of compiling and/or running this code?</p><ol type='a'><li>The code compiles and runs, setting <code>dollars</code> to the value <code>13</code>.</li><li>The code compiles and runs, setting <code>dollars</code> to the value <code>14</code>.</li><li>The code compiles and runs setting <code>dollars</code> to the value <code>13.00</code>.</li><li>The code doesn't compile.</li></ol><!--pc=03f60d30--><!--endproblem--><p>See the solution <a href='https://www.learnapcompsci.com/problem.php?pc=03f60d30'>here</a>.</p>]]>
                </description>
                <pubDate>Fri, 23 Oct 2026 08:57:02 -0700</pubDate>
                <guid isPermaLink="false">problem-03f60d30</guid>
            </item>
<item>
                <title>New Problem of the Day!</title>
                <link>https://www.learnapcompsci.com/problem.php?pc=d3261f28</link>
                <description>
                    <![CDATA[<!--startproblem--><p>Thursday, October 22, 2026</p><hr /><p><b>Problem:</b></p><p>The Java instruction <pre>System.out.println(100 * 8.3);</pre> is executed, producing the result <code>830.0000000000001</code> rather than the expected value of <code>830.0</code>. This is because</p><ol type='a'><li>Multiplying an <code>int</code> value and a <code>double</code> value is not allowed</li><li>There was an overflow error</li><li>There was a rounding error</li><li>There was a math error in the central processing unit</li></ol><!--pc=d3261f28--><!--endproblem--><p>See the solution <a href='https://www.learnapcompsci.com/problem.php?pc=d3261f28'>here</a>.</p>]]>
                </description>
                <pubDate>Thu, 22 Oct 2026 08:57:02 -0700</pubDate>
                <guid isPermaLink="false">problem-d3261f28</guid>
            </item>
<item>
                <title>New Problem of the Day!</title>
                <link>https://www.learnapcompsci.com/problem.php?pc=9c63f7be</link>
                <description>
                    <![CDATA[<!--startproblem--><p>Wednesday, October 21, 2026</p><hr /><p><b>Problem:</b></p><p>The class <code>ElectronicDevice</code> has a String instance variable <code>name</code> to describe the device, as well as a boolean instance variable <code>turnedOn</code> to describe whether the device is &quot;on&quot; or &quot;off&quot;&mdash;for a device that is &quot;on,&quot; the variable <code>turnedOn</code> is <code>true</code>. The following public methods have been defined for the class:</p><ul><li><code>String getName()</code></li><li><code>void turnOn()</code></li><li><code>void turnOff()</code></li><li><code>boolean isTurnedOn()</code></li></ul><p>Based on the method names, which would presumably be <i>accessor methods</i>, and which would be <i>mutator methods</i>?</p><table border='0' style='text-align: center'><tr><td style='padding: 0 2em;'>&nbsp;</td><td style='background: #eee; border: solid 1px #000; padding: 0 2em;'><b>Accessor methods</b></td><td style='background: #eee; border: solid 1px #000; padding: 0 2em;'><b>Mutator methods</b></td></tr><tr><td>a.</td><td><code>getName()</code></td><td><code>turnOn(), turnOff(), isTurnedOn()</code></td></tr><tr><td>b.</td><td><code>turnOn(), turnOff()</code></td><td><code>getName(), isTurnedOn()</code></td></tr><tr><td>c.</td><td><code>getName(), isTurnedOn()</code></td><td><code>turnOn(), turnOff()</code></td></tr><tr><td>d.</td><td><code>turnOn(), turnOff(), isTurnedOn()</code></td><td><code>getName()</code></td></tr></table><!--pc=9c63f7be--><!--endproblem--><p>See the solution <a href='https://www.learnapcompsci.com/problem.php?pc=9c63f7be'>here</a>.</p>]]>
                </description>
                <pubDate>Wed, 21 Oct 2026 08:57:02 -0700</pubDate>
                <guid isPermaLink="false">problem-9c63f7be</guid>
            </item>
<item>
                <title>New Problem of the Day!</title>
                <link>https://www.learnapcompsci.com/problem.php?pc=6ddd82c7</link>
                <description>
                    <![CDATA[<!--startproblem--><p>Tuesday, October 20, 2026</p><hr /><p><b>Problem:</b></p><p>The boolean variable <code>isWorkDay</code> is <code>true</code> on days I have to work, and the boolean variable <code>isDirty</code> is <code>true</code> when my favorite shirt needs to be washed. I'll wear my favorite shirt on a work day, but only if it's clean. Otherwise, on non-work days, I'll wear it even if it's dirty. Which statement below will evaluate as <code>true</code> when I can wear my favorite shirt?</p><ol type='a'><li><code>(!isWorkDay && !isDirty) || isWorkDay</code></li><li><code>(!isWorkDay || !isDirty) && isWorkDay</code></li><li><code>!isWorkDay || (isWorkDay && !isDirty)</code></li><li><code>!isWorkDay || (isWorkDay || !isDirty)</code></li></ol><!--pc=6ddd82c7--><!--endproblem--><p>See the solution <a href='https://www.learnapcompsci.com/problem.php?pc=6ddd82c7'>here</a>.</p>]]>
                </description>
                <pubDate>Tue, 20 Oct 2026 08:57:01 -0700</pubDate>
                <guid isPermaLink="false">problem-6ddd82c7</guid>
            </item>
<item>
                <title>New Problem of the Day!</title>
                <link>https://www.learnapcompsci.com/problem.php?pc=2579fc4e</link>
                <description>
                    <![CDATA[<!--startproblem--><p>Friday, October 16, 2026</p><hr /><p><b>Problem:</b></p><p>The Boolean expression <code>!(A && B)</code> can be analyzed for any boolean values of <code>A</code> and <code>B</code> by using a <i>truth table</i>. The partially-filled truth table shown here indicates the four combinations of <code>A</code> and <code>B</code> inputs for that expression, which is given in the final column.</p><table style='border-collapse: collapse;'><tr><td style='border: 1px solid #000; padding: 0.5em 1em; text-align: center;'><code><b>A</b></code></td><td style='border: 1px solid #000; padding: 0.5em 1em; text-align: center;'><code><b>B</b></code></td><td style='border: 1px solid #000; padding: 0.5em 1em; text-align: center;'><code><b>A && B</b></code></td><td style='border: 1px solid #000; padding: 0.5em 1em; text-align: center;'><code><b>!(A && B)</b></code></td></tr><tr><td style='border: 1px solid #000; padding: 0.5em 1em;'><code>false</code></td><td style='border: 1px solid #000; padding: 0.5em 1em;'><code>false</code></td><td style='border: 1px solid #000; padding: 0.5em 1em;'><code>&nbsp;</code></td><td style='border: 1px solid #000; padding: 0.5em 1em;'><code>&nbsp;</code></td></tr><tr><td style='border: 1px solid #000; padding: 0.5em 1em;'><code>false</code></td><td style='border: 1px solid #000; padding: 0.5em 1em;'><code>true</code></td><td style='border: 1px solid #000; padding: 0.5em 1em;'><code>&nbsp;</code></td><td style='border: 1px solid #000; padding: 0.5em 1em;'><code>&nbsp;</code></td></tr><tr><td style='border: 1px solid #000; padding: 0.5em 1em;'><code>true</code></td><td style='border: 1px solid #000; padding: 0.5em 1em;'><code>false</code></td><td style='border: 1px solid #000; padding: 0.5em 1em;'><code>&nbsp;</code></td><td style='border: 1px solid #000; padding: 0.5em 1em;'><code>&nbsp;</code></td></tr><tr><td style='border: 1px solid #000; padding: 0.5em 1em;'><code>true</code></td><td style='border: 1px solid #000; padding: 0.5em 1em;'><code>true</code></td><td style='border: 1px solid #000; padding: 0.5em 1em;'><code>&nbsp;</code></td><td style='border: 1px solid #000; padding: 0.5em 1em;'><code>&nbsp;</code></td></tr></table><p>Which of these represent the right-most two columns of the truth table based on the given inputs above?</p><ol type='a'><li><table style='border-collapse: collapse;'><tr><td style='border: 1px solid #000; padding: 0.5em 1em; text-align: center;'><code><b>A && B</b></code></td><td style='border: 1px solid #000; padding: 0.5em 1em; text-align: center;'><code><b>!(A && B)</b></code></td></tr><tr><td style='border: 1px solid #000; padding: 0.5em 1em;'><code>false</code></td><td style='border: 1px solid #000; padding: 0.5em 1em;'><code>true</code></td></tr><tr><td style='border: 1px solid #000; padding: 0.5em 1em;'><code>false</code></td><td style='border: 1px solid #000; padding: 0.5em 1em;'><code>true</code></td></tr><tr><td style='border: 1px solid #000; padding: 0.5em 1em;'><code>false</code></td><td style='border: 1px solid #000; padding: 0.5em 1em;'><code>true</code></td></tr><tr><td style='border: 1px solid #000; padding: 0.5em 1em;'><code>true</code></td><td style='border: 1px solid #000; padding: 0.5em 1em;'><code>false</code></td></tr></table></li><li><table style='border-collapse: collapse;'><tr><td style='border: 1px solid #000; padding: 0.5em 1em; text-align: center;'><code><b>A && B</b></code></td><td style='border: 1px solid #000; padding: 0.5em 1em; text-align: center;'><code><b>!(A && B)</b></code></td></tr><tr><td style='border: 1px solid #000; padding: 0.5em 1em;'><code>false</code></td><td style='border: 1px solid #000; padding: 0.5em 1em;'><code>true</code></td></tr><tr><td style='border: 1px solid #000; padding: 0.5em 1em;'><code>false</code></td><td style='border: 1px solid #000; padding: 0.5em 1em;'><code>false</code></td></tr><tr><td style='border: 1px solid #000; padding: 0.5em 1em;'><code>false</code></td><td style='border: 1px solid #000; padding: 0.5em 1em;'><code>false</code></td></tr><tr><td style='border: 1px solid #000; padding: 0.5em 1em;'><code>true</code></td><td style='border: 1px solid #000; padding: 0.5em 1em;'><code>false</code></td></tr></table></li><li><table style='border-collapse: collapse;'><tr><td style='border: 1px solid #000; padding: 0.5em 1em; text-align: center;'><code><b>A && B</b></code></td><td style='border: 1px solid #000; padding: 0.5em 1em; text-align: center;'><code><b>!(A && B)</b></code></td></tr><tr><td style='border: 1px solid #000; padding: 0.5em 1em;'><code>false</code></td><td style='border: 1px solid #000; padding: 0.5em 1em;'><code>true</code></td></tr><tr><td style='border: 1px solid #000; padding: 0.5em 1em;'><code>true</code></td><td style='border: 1px solid #000; padding: 0.5em 1em;'><code>false</code></td></tr><tr><td style='border: 1px solid #000; padding: 0.5em 1em;'><code>true</code></td><td style='border: 1px solid #000; padding: 0.5em 1em;'><code>false</code></td></tr><tr><td style='border: 1px solid #000; padding: 0.5em 1em;'><code>true</code></td><td style='border: 1px solid #000; padding: 0.5em 1em;'><code>false</code></td></tr></table></li><li><table style='border-collapse: collapse;'><tr><td style='border: 1px solid #000; padding: 0.5em 1em; text-align: center;'><code><b>A && B</b></code></td><td style='border: 1px solid #000; padding: 0.5em 1em; text-align: center;'><code><b>!(A && B)</b></code></td></tr><tr><td style='border: 1px solid #000; padding: 0.5em 1em;'><code>false</code></td><td style='border: 1px solid #000; padding: 0.5em 1em;'><code>true</code></td></tr><tr><td style='border: 1px solid #000; padding: 0.5em 1em;'><code>true</code></td><td style='border: 1px solid #000; padding: 0.5em 1em;'><code>false</code></td></tr><tr><td style='border: 1px solid #000; padding: 0.5em 1em;'><code>true</code></td><td style='border: 1px solid #000; padding: 0.5em 1em;'><code>true</code></td></tr><tr><td style='border: 1px solid #000; padding: 0.5em 1em;'><code>true</code></td><td style='border: 1px solid #000; padding: 0.5em 1em;'><code>false</code></td></tr></table></li></ol><!--pc=2579fc4e--><!--endproblem--><p>See the solution <a href='https://www.learnapcompsci.com/problem.php?pc=2579fc4e'>here</a>.</p>]]>
                </description>
                <pubDate>Fri, 16 Oct 2026 08:57:02 -0700</pubDate>
                <guid isPermaLink="false">problem-2579fc4e</guid>
            </item>
<item>
                <title>New Problem of the Day!</title>
                <link>https://www.learnapcompsci.com/problem.php?pc=400c7077</link>
                <description>
                    <![CDATA[<!--startproblem--><p>Thursday, October 15, 2026</p><hr /><p><b>Problem:</b></p><p>A <i>Halloween monster</i> can be described in terms of its <i>size</i> (small or large) and whether or not it is <i>scary</i>. The boolean variable <code>small</code> is <code>true</code> if the monster is small, and <code>false</code> if it is large. The boolean variable <code>scary</code> is <code>true</code> if the monster is scary, and <code>false</code> if the monster is not scary.</p><p>Which boolean expression will evaluate as <code>true</code> for a Halloween monster that is both scary and large?</p><ol type='a'><li><code>!small || scary</code></li><li><code>!( !small || !scary)</code></li><li><code>!( !(!small && scary))</code></li><li><code>!(small && scary)</code></li></ol><!--pc=400c7077--><!--endproblem--><p>See the solution <a href='https://www.learnapcompsci.com/problem.php?pc=400c7077'>here</a>.</p>]]>
                </description>
                <pubDate>Thu, 15 Oct 2026 08:57:02 -0700</pubDate>
                <guid isPermaLink="false">problem-400c7077</guid>
            </item>
<item>
                <title>New Problem of the Day!</title>
                <link>https://www.learnapcompsci.com/problem.php?pc=6402446a</link>
                <description>
                    <![CDATA[<!--startproblem--><p>Wednesday, October 14, 2026</p><hr /><p><b>Problem:</b></p><p>Boolean expressions can be analyzed using a <i>truth table</i>, which summarizes all the possible values for the inputs to an expression, along with their corresponding outputs. Here, for example, is the truth table for the <code>&&</code> operation:</p><table style='border-collapse: collapse;'><tr><td style='border: 1px solid #000; padding: 0.5em 1em; text-align: center;'><code><b>A</b></code></td><td style='border: 1px solid #000; padding: 0.5em 1em; text-align: center;'><code><b>B</b></code></td><td style='border: 1px solid #000; padding: 0.5em 1em; text-align: center;'><code><b>A && B</b></code></td></tr><tr><td style='border: 1px solid #000; padding: 0.5em 1em;'><code>false</code></td><td style='border: 1px solid #000; padding: 0.5em 1em;'><code>false</code></td><td style='border: 1px solid #000; padding: 0.5em 1em;'><code>false</code></td></tr><tr><td style='border: 1px solid #000; padding: 0.5em 1em;'><code>false</code></td><td style='border: 1px solid #000; padding: 0.5em 1em;'><code>true</code></td><td style='border: 1px solid #000; padding: 0.5em 1em;'><code>false</code></td></tr><tr><td style='border: 1px solid #000; padding: 0.5em 1em;'><code>true</code></td><td style='border: 1px solid #000; padding: 0.5em 1em;'><code>false</code></td><td style='border: 1px solid #000; padding: 0.5em 1em;'><code>false</code></td></tr><tr><td style='border: 1px solid #000; padding: 0.5em 1em;'><code>true</code></td><td style='border: 1px solid #000; padding: 0.5em 1em;'><code>true</code></td><td style='border: 1px solid #000; padding: 0.5em 1em;'><code>true</code></td></tr></table><p>In the example above, the outputs in the last column are listed from top-to-bottom as <code>false, false, false, true</code>. Which would be the outputs of the truth table for the boolean expression <code>A || !B</code> ?</p><ol type='a'><li><code>true, false, false, true</code></li><li><code>false, true, false, true</code></li><li><code>true, false, true, true</code></li><li><code>true, true, false, false</code></li></ol><!--pc=6402446a--><!--endproblem--><p>See the solution <a href='https://www.learnapcompsci.com/problem.php?pc=6402446a'>here</a>.</p>]]>
                </description>
                <pubDate>Wed, 14 Oct 2026 08:57:01 -0700</pubDate>
                <guid isPermaLink="false">problem-6402446a</guid>
            </item>
<item>
                <title>New Problem of the Day!</title>
                <link>https://www.learnapcompsci.com/problem.php?pc=bef41c28</link>
                <description>
                    <![CDATA[<!--startproblem--><p>Tuesday, October 13, 2026</p><hr /><p><b>Problem:</b></p><p>In Java, <i>identifiers</i> are used to refer to <i>classes</i>, <i>methods</i>, <i>variables</i>, and <i>constants</i>. By custom, identifiers are created according to which strategy?</p><table><tr><td style='width: 5%;'></td><td style='width: 20%; text-align: center;'><b>classes</b></td><td style='width: 20%; text-align: center;'><b>methods</b></td><td style='width: 20%; text-align: center;'><b>variables</b></td><td style='width: 20%; text-align: center;'><b>constants</b></td></tr><tr><td>a.</td><td>begin with uppercase letter</td><td>begin with uppercase letter</td><td>begin with uppercase letter</td><td>all uppercase letters</td></tr><tr><td>b.</td><td>begin with uppercase letter</td><td>begin with uppercase letter</td><td>begin with lowercase letter</td><td>all uppercase letters</td></tr><tr><td>c.</td><td>begin with uppercase letter</td><td>begin with lowercase letter</td><td>begin with lowercase letter</td><td>begin with lowercase letter</td></tr><tr><td>d.</td><td>begin with uppercase letter</td><td>begin with lowercase letter</td><td>begin with lowercase letter</td><td>all uppercase letters</td></tr></table><!--pc=bef41c28--><!--endproblem--><p>See the solution <a href='https://www.learnapcompsci.com/problem.php?pc=bef41c28'>here</a>.</p>]]>
                </description>
                <pubDate>Tue, 13 Oct 2026 08:57:01 -0700</pubDate>
                <guid isPermaLink="false">problem-bef41c28</guid>
            </item>
<item>
                <title>New Problem of the Day!</title>
                <link>https://www.learnapcompsci.com/problem.php?pc=5c1b45e3</link>
                <description>
                    <![CDATA[<!--startproblem--><p>Monday, October 12, 2026</p><hr /><p><b>Problem:</b></p><p>Java code is written in text-based <i>source files</i> using a text editor or an integrated development environment, and then compiled into bytecode that can be run on the computer. What instruction should be given at the command-line (in a Terminal) to run a <code>HelloWorld.class</code> bytecode file?</p><ol type='a'><li><code>javac HelloWorld.java</code></li><li><code>javac HelloWorld</code></li><li><code>java HelloWorld.java</code></li><li><code>java HelloWorld</code></li><li><code>java HelloWorld.class</code></li></ol><!--pc=5c1b45e3--><!--endproblem--><p>See the solution <a href='https://www.learnapcompsci.com/problem.php?pc=5c1b45e3'>here</a>.</p>]]>
                </description>
                <pubDate>Mon, 12 Oct 2026 18:19:49 -0700</pubDate>
                <guid isPermaLink="false">problem-5c1b45e3</guid>
            </item>
<item>
                <title>New Problem of the Day!</title>
                <link>https://www.learnapcompsci.com/problem.php?pc=e8d2d645</link>
                <description>
                    <![CDATA[<!--startproblem--><p>Friday, October 9, 2026</p><hr /><p><b>Problem:</b></p><p>A Java program contains the following line of code.</p><p><code>int age = 17.3;</code></p><p>This line is an example of</p><ol type='a'><li>a syntax error</li><li>a run-time error</li><li>a logic error</li><li>There are no errors in this code.</li></ol><!--pc=e8d2d645--><!--endproblem--><p>See the solution <a href='https://www.learnapcompsci.com/problem.php?pc=e8d2d645'>here</a>.</p>]]>
                </description>
                <pubDate>Fri, 09 Oct 2026 08:57:01 -0700</pubDate>
                <guid isPermaLink="false">problem-e8d2d645</guid>
            </item>
<item>
                <title>New Problem of the Day!</title>
                <link>https://www.learnapcompsci.com/problem.php?pc=4eb2691f</link>
                <description>
                    <![CDATA[<!--startproblem--><p>Thursday, October 8, 2026</p><hr /><p><b>Problem:</b></p><p>One common system for controlling traffic flow involves three lights--a red light, yellow light, and green light--to indicate three traffic conditions, or <i>states</i>: &quot;stop&quot;, &quot;caution&quot;, and &quot;go.&quot; A computer scientist waiting in a car at one of these lights realizes that the system, by allowing for more than a single light to be turned on at the same time, could actually be used to indicate as many as 8 different conditions:</p><ol><li>no lights on</li><li>red light only on</li><li>yellow light only on</li><li>red and yellow light on</li><li>etc.</li><li>red, yellow, and green lights all on</li></ol><p>Based on this realization, what minimum number of lights would be necessary for a traffic light to indicate the three conditions &quot;stop&quot;, &quot;caution&quot;, and &quot;go.&quot;? And what maximum number of states could be indicated with a system of five traffic lights (for example red, orange, yellow, green, blue)?</p><table border='0' style='text-align: center'><tr><td></td><td style='background: #eee; border: solid 1px #000; padding: 0 2em;'><b>Minimum lights needed to indicate 3 states</b></td><td style='background: #eee; border: solid 1px #000; padding: 0 2em;'><b>Number of states possible with 5 lights</b></td></tr><tr><td>a.</td><td>2</td><td>5</td></tr><tr><td>b.</td><td>2</td><td>31</td></tr><tr><td>c.</td><td>3</td><td>31</td></tr><tr><td>d.</td><td>2</td><td>32</td></tr><tr><td>e.</td><td>3</td><td>32</td></tr></table><!--pc=4eb2691f--><!--endproblem--><p>See the solution <a href='https://www.learnapcompsci.com/problem.php?pc=4eb2691f'>here</a>.</p>]]>
                </description>
                <pubDate>Thu, 08 Oct 2026 08:57:01 -0700</pubDate>
                <guid isPermaLink="false">problem-4eb2691f</guid>
            </item>
<item>
                <title>New Problem of the Day!</title>
                <link>https://www.learnapcompsci.com/problem.php?pc=7591a6cf</link>
                <description>
                    <![CDATA[<!--startproblem--><p>Wednesday, October 7, 2026</p><hr /><p><b>Problem:</b></p><p>The <code>FinanceUtilities</code> class contains code that works with prices in dollars and cents: <code>2.37</code> represents two dollars and thirty-seven cents. Below is a partial code listing for the class.</p><pre>public class FinanceUtilities<br />{<br />    public static final double DELTA = 0.01;<br />    <br />    // Code not shown<br />    <br />    public static boolean closeEnough(double n1, double n2)<br />    {<br />        return Math.abs(n1 - n2) < DELTA;<br />    }<br />}</pre><p>What boolean values will be returned after the following calls to the static method <code>closeEnough</code> ?</p><pre>closeEnough(2.03, 2.01)<br />closeEnough(2.045, 2.032)<br />closeEnough(1.013, 1.018)<br />closeEnough(1.02, 1.02)</pre><ol type='a'><li><code>true, false, true, true</code></li><li><code>false, true, true, true</code></li><li><code>false, false, true, true</code></li><li><code>false, true, true, false</code></li></ol><!--pc=7591a6cf--><!--endproblem--><p>See the solution <a href='https://www.learnapcompsci.com/problem.php?pc=7591a6cf'>here</a>.</p>]]>
                </description>
                <pubDate>Wed, 07 Oct 2026 08:57:01 -0700</pubDate>
                <guid isPermaLink="false">problem-7591a6cf</guid>
            </item>
<item>
                <title>New Problem of the Day!</title>
                <link>https://www.learnapcompsci.com/problem.php?pc=c677b6b6</link>
                <description>
                    <![CDATA[<!--startproblem--><p>Tuesday, October 6, 2026</p><hr /><p><b>Problem:</b></p><p>In Java, multiplying the <code>double</code> value for one million times itself yields the following correct result:</p><pre>double val = 1000000.0;<br />System.out.println(val * val);<br /><br />--&gt; produces the double result 1.0E12</pre><p>Multiplying the <code>int</code> value for one million times itself yields something different:</p><pre>int val2 = 1000000;<br />System.out.println(val2 * val2);<br /><br />--&gt; produces the int result -727379968</pre><p>Which of the following explains the second result?</p><ol type='a'><li>The result is due to decimal-to-binary rounding error</li><li>The result is due to an <code>int</code> overflow error</li><li>The result is due to a syntax error in the Java code</li><li>The result is due to big-number imprecision in the CPU</li></ol><!--pc=c677b6b6--><!--endproblem--><p>See the solution <a href='https://www.learnapcompsci.com/problem.php?pc=c677b6b6'>here</a>.</p>]]>
                </description>
                <pubDate>Tue, 06 Oct 2026 08:57:02 -0700</pubDate>
                <guid isPermaLink="false">problem-c677b6b6</guid>
            </item>
<item>
                <title>New Problem of the Day!</title>
                <link>https://www.learnapcompsci.com/problem.php?pc=e1085283</link>
                <description>
                    <![CDATA[<!--startproblem--><p>Monday, October 5, 2026</p><hr /><p><b>Problem:</b></p><p>The <code>static boolean</code> method <code>bothEvenOrOdd</code> takes two integers <code>a</code> and <code>b</code> as parameters and returns <code>true</code> if both integers are even or both integers are odd&mdash;otherwise, it returns <code>false</code>. Which of the following methods will <i>not</i> perform correctly?</p><ol type='a'><li><br /><pre>public static boolean bothEvenOrOdd(int a, int b)<br />{<br />    return ( a + b ) % 2 == 0;<br />}</pre></li><li><br /><pre>public static boolean bothEvenOrOdd(int a, int b)<br />{<br />    return ((a % 2) + (b % 2)) % 2 == 0;<br />}</pre></li><li><br /><pre>public static boolean bothEvenOrOdd(int a, int b)<br />{<br />    return a % 2 == b % 2;<br />}</pre></li><li><br /><pre>public static boolean bothEvenOrOdd(int a, int b)<br />{<br />    if (a % 2 == 0 && b % 2 == 0) <br />        return true;<br />    else<br />        return false;<br />}</pre></li></ol><!--pc=e1085283--><!--endproblem--><p>See the solution <a href='https://www.learnapcompsci.com/problem.php?pc=e1085283'>here</a>.</p>]]>
                </description>
                <pubDate>Mon, 05 Oct 2026 11:42:00 -0700</pubDate>
                <guid isPermaLink="false">problem-e1085283</guid>
            </item>
<item>
                <title>New Problem of the Day!</title>
                <link>https://www.learnapcompsci.com/problem.php?pc=d349246e</link>
                <description>
                    <![CDATA[<!--startproblem--><p>Friday, October 2, 2026</p><hr /><p><b>Problem:</b></p><p>Computer programs often have errors in them. Which of the following is an acceptable debugging strategy for identifying the source of an error in a program?</p><ol type='I'><li>Inserting <code>println</code> statements that print out the values of variables at given checkpoints</li><li>Using a debugger in an Integrated Development Environment to analyze the code as it executes</li><li>Going through the code &quot;by hand&quot; one instruction at a time, writing down values for variables and tracking the program's execution</li></ol><ol type='a'><li>II only</li><li>I and II only</li><li>II and III only</li><li>I, II, and III</li></ol><!--pc=d349246e--><!--endproblem--><p>See the solution <a href='https://www.learnapcompsci.com/problem.php?pc=d349246e'>here</a>.</p>]]>
                </description>
                <pubDate>Fri, 02 Oct 2026 08:57:01 -0700</pubDate>
                <guid isPermaLink="false">problem-d349246e</guid>
            </item>
<item>
                <title>New Problem of the Day!</title>
                <link>https://www.learnapcompsci.com/problem.php?pc=d8a48e55</link>
                <description>
                    <![CDATA[<!--startproblem--><p>Thursday, October 1, 2026</p><hr /><p><b>Problem:</b></p><img src='https://www.learnapcompsci.com/problem_assets/cone.png' style='width: 30%; display: block; margin: 0 auto;' /><p>The surface area of a cone is given by the formula<br /><br /><img src='https://www.learnapcompsci.com/problem_assets/cone_surface_formula.png' style='margin-left: 3em; width: 18em;' /><br /><br />where <i>r</i> refers to the radius of the base and <i>h</i> refers to the vertical height of the cone, as shown.</p><p>Which Java instruction will correctly calculate the surface area of a cone?</p><ol type='a'><li><code>double cone_area = Math.PI * r * r + Math.sqrt(h * h + r * r);</code></li><li><code>double cone_area = Math.PI * r * r + Math.sqrt(h * h) + Math.sqrt(r * r);</code></li><li><code>double cone_area = Math.PI * r * (r + Math.sqrt(h * h + r * r));</code></li><li><code>double cone_area = Math.PI * r * (r + Math.sqrt(h * h) + Math.sqrt(r * r));</code></li></ol><!--pc=d8a48e55--><!--endproblem--><p>See the solution <a href='https://www.learnapcompsci.com/problem.php?pc=d8a48e55'>here</a>.</p>]]>
                </description>
                <pubDate>Thu, 01 Oct 2026 08:57:01 -0700</pubDate>
                <guid isPermaLink="false">problem-d8a48e55</guid>
            </item>
<item>
                <title>New Problem of the Day!</title>
                <link>https://www.learnapcompsci.com/problem.php?pc=a7229ea2</link>
                <description>
                    <![CDATA[<!--startproblem--><p>Wednesday, September 30, 2026</p><hr /><p><b>Problem:</b></p><p>Consider the following method.</p><pre>public static int randVals(int a, int b)<br />{<br />    return (int) (Math.random() * (a+1) + b);<br />}</pre><p>Which possible value of <code>x</code> may be returned as a result of the method call <code>randVals(7, 2)</code> ?</p><ol type='a'><li><code>2 <= x <= 8</code></li><li><code>2 <= x <= 9</code></li><li><code>2 <= x < 8</code></li><li><code>2 <= x < 9</code></li></ol><!--pc=a7229ea2--><!--endproblem--><p>See the solution <a href='https://www.learnapcompsci.com/problem.php?pc=a7229ea2'>here</a>.</p>]]>
                </description>
                <pubDate>Wed, 30 Sep 2026 08:57:01 -0700</pubDate>
                <guid isPermaLink="false">problem-a7229ea2</guid>
            </item>
<item>
                <title>New Problem of the Day!</title>
                <link>https://www.learnapcompsci.com/problem.php?pc=6448fed0</link>
                <description>
                    <![CDATA[<!--startproblem--><p>Tuesday, September 29, 2026</p><hr /><p><b>Problem:</b></p><p>Consider the following method.</p><pre>public static void triple(int n)<br>{<br />    System.out.print(&quot; &quot; + n);<br />    n = n * 3;<br />    System.out.print(&quot; &quot; + n);<br />}</pre><p>Which of the following is printed as a result of executing this code segment?</p><pre>    int n = 2;<br />    triple(n);<br />    System.out.print(&quot; &quot; + n);</pre><ol type='a'><li><code>2 6 2</code></li><li><code>2 6 6</code></li><li><code>2 2 6</code></li><li><code>6 6 2</code></li></ol><!--pc=6448fed0--><!--endproblem--><p>See the solution <a href='https://www.learnapcompsci.com/problem.php?pc=6448fed0'>here</a>.</p>]]>
                </description>
                <pubDate>Tue, 29 Sep 2026 08:57:01 -0700</pubDate>
                <guid isPermaLink="false">problem-6448fed0</guid>
            </item>
<item>
                <title>New Problem of the Day!</title>
                <link>https://www.learnapcompsci.com/problem.php?pc=9446c61d</link>
                <description>
                    <![CDATA[<!--startproblem--><p>Monday, September 28, 2026</p><hr /><p><b>Problem:</b></p><p>A collection of addresses is given in the form shown here:</p><pre>375 Via los Miradores Ave, Redondo Beach, CA 90277<br />1414 W Union St, Pasadena, CA 91003<br />23412 N Lake Ave, Denver, CO 80204</pre><p>There are a few different expressions that can be used to match patterns in a line of text.</p><ul><li><code>^</code> matches the beginning of a line</li><li><code>$</code> matches the end of a line</li><li><code>\d</code> matches a single numeric digit</li><li><code>\d+</code> matches a sequence of at least one numeric digit, maybe more</li></ul><p>Which pattern will match only the numeric street numbers at the beginning of each address above?</p><ol type='a'><li><code>^\d$</code></li><li><code>\d\d\d\d\d</code></li><li><code>^\d+</code></li><li><code>\d+</code></li></ol><!--pc=9446c61d--><!--endproblem--><p>See the solution <a href='https://www.learnapcompsci.com/problem.php?pc=9446c61d'>here</a>.</p>]]>
                </description>
                <pubDate>Mon, 28 Sep 2026 08:57:01 -0700</pubDate>
                <guid isPermaLink="false">problem-9446c61d</guid>
            </item>
<item>
                <title>New Problem of the Day!</title>
                <link>https://www.learnapcompsci.com/problem.php?pc=1c6aab66</link>
                <description>
                    <![CDATA[<!--startproblem--><p>Friday, September 25, 2026</p><hr /><p><b>Problem:</b></p><p>A collection of addresses is given in the form shown here:</p><pre>375 Via los Miradores Ave, Redondo Beach, CA 90277<br />1414 W Union St, Pasadena, CA 91003<br />23412 N Lake Ave, Denver, CO 80204</pre><p>A dot <code>.</code> matches any character. a <code>^</code> matches the beginning of a line, and a <code>$</code> matches the end of a line. Which pattern will match just the 5 digit zipcodes in the list of addresses above?</p><ol type='a'><li><code>^.....$</code></li><li><code>.....</code></li><li><code>.....$</code></li><li><code>^.....</code></li></ol><!--pc=1c6aab66--><!--endproblem--><p>See the solution <a href='https://www.learnapcompsci.com/problem.php?pc=1c6aab66'>here</a>.</p>]]>
                </description>
                <pubDate>Fri, 25 Sep 2026 08:57:02 -0700</pubDate>
                <guid isPermaLink="false">problem-1c6aab66</guid>
            </item>
<item>
                <title>New Problem of the Day!</title>
                <link>https://www.learnapcompsci.com/problem.php?pc=ceade59a</link>
                <description>
                    <![CDATA[<!--startproblem--><p>Thursday, September 24, 2026</p><hr /><p><b>Problem:</b></p><p>The decimal number <code>237</code> is equivalent to the boolean number:</p><ol type='a'><li><code>111111</code></li><li><code>11101101</code></li><li><code>11110101</code></li><li><code>11101011</code></li></ol><!--pc=ceade59a--><!--endproblem--><p>See the solution <a href='https://www.learnapcompsci.com/problem.php?pc=ceade59a'>here</a>.</p>]]>
                </description>
                <pubDate>Thu, 24 Sep 2026 08:57:01 -0700</pubDate>
                <guid isPermaLink="false">problem-ceade59a</guid>
            </item>
<item>
                <title>New Problem of the Day!</title>
                <link>https://www.learnapcompsci.com/problem.php?pc=efc97f2a</link>
                <description>
                    <![CDATA[<!--startproblem--><p>Wednesday, September 23, 2026</p><hr /><p><b>Problem:</b></p><p>The formula for determining the temperature in degrees Fahrenheit based on a given temperature in degrees Celsius is</p><img src='https://www.learnapcompsci.com/problem_assets/fahrenheit.png' style='width:8em; margin-left: 2em;' /><p>Which of the following instructions, given the <code>double</code> value <code>C</code>, correctly performs that calculation?</p><ol type='a'><li><code>double F = 9 / 5 * C + 32;</code></li><li><code>double F = 9.0  / 5 * (C + 32);</code></li><li><code>double F = 9.0 / 5 * C + 32;</code></li><li><code>double F = 9.0 / (5 * C) + 32;</code></li></ol><!--pc=efc97f2a--><!--endproblem--><p>See the solution <a href='https://www.learnapcompsci.com/problem.php?pc=efc97f2a'>here</a>.</p>]]>
                </description>
                <pubDate>Wed, 23 Sep 2026 08:57:01 -0700</pubDate>
                <guid isPermaLink="false">problem-efc97f2a</guid>
            </item>
<item>
                <title>New Problem of the Day!</title>
                <link>https://www.learnapcompsci.com/problem.php?pc=a8265225</link>
                <description>
                    <![CDATA[<!--startproblem--><p>Tuesday, September 22, 2026</p><hr /><p><b>Problem:</b></p><p>Consider the following three lines of text:</p><pre>213-234-4522<br />455-8765-3453<br />762-3452-876</pre><p>Only the first line represents the correct 10-digit format for a phone number.</p><p>If a dot <code>.</code> represents any single character, and a &quot;dot-asterisk&quot; <code> .* </code> represents any number of characters, which of the following patterns matches only the first line above?</p><ol type='a'><li><code>***.***.****</code></li><li><code>...-...-....</code></li><li><code>.*-.*-.*</code></li><li><code>.*</code></li></ol><!--pc=a8265225--><!--endproblem--><p>See the solution <a href='https://www.learnapcompsci.com/problem.php?pc=a8265225'>here</a>.</p>]]>
                </description>
                <pubDate>Tue, 22 Sep 2026 08:57:02 -0700</pubDate>
                <guid isPermaLink="false">problem-a8265225</guid>
            </item>
<item>
                <title>New Problem of the Day!</title>
                <link>https://www.learnapcompsci.com/problem.php?pc=1a32500f</link>
                <description>
                    <![CDATA[<!--startproblem--><p>Monday, September 21, 2026</p><hr /><p><b>Problem:</b></p><p>A grid can be represented by a single list of values, given in order as shown:</p><table style='border-collapse: collapse;'><tr><td style='border: solid 1px gray; padding: 0.5em;'>0</td><td style='border: solid 1px gray; padding: 0.5em;'>1</td><td style='border: solid 1px gray; padding:0.5em;'>2</td><td style='border: solid 1px gray; padding: 0.5em;'>3</td></tr><tr><td style='border: solid 1px gray; padding: 0.5em;'>4</td><td style='border: solid 1px gray; padding: 0.5em;'>5</td><td style='border: solid 1px gray; padding: 0.5em;'>6</td><td style='border: solid 1px gray; padding: 0.5em;'>7</td></tr><tr><td style='border: solid 1px gray; padding: 0.5em;'>8</td><td style='border: solid 1px gray; padding: 0.5em;'>9</td><td style='border: solid 1px gray; padding: 0.5em;'>10</td><td style='border: solid 1px gray; padding: 0.5em;'>11</td></tr><tr><td style='border: solid 1px gray; padding: 0.5em;'>12</td><td style='border: solid 1px gray; padding: 0.5em;'>13</td><td style='border: solid 1px gray; padding: 0.5em;'>14</td><td style='border: solid 1px gray; padding: 0.5em;'>15</td></tr></table><p>So the 4&times;4 grid</p><pre>0001<br />0210<br />2110<br />2202</pre><p>could be written as</p><p><code>0001021021102202</code></p><p>Now consider a tic-tac-toe game played on a 3&times;3 grid, where <code>X</code> represents a square marked by one player, <code>0</code> represents a square taken by the other player, and a dot <code>.</code> represents a square that hasn't been played yet. A player wins by marking three in a row (vertically, horizontally, or diagonally). Which of the following strings represent a game won by player <code>X</code>?</p><ol type='a'><li><code>XO.XOO.OX</code></li><li><code>.XOXO..XO</code></li><li><code>OX.OOXOX.</code></li><li><code>..XOXOXOO</code></li></ol><!--pc=1a32500f--><!--endproblem--><p>See the solution <a href='https://www.learnapcompsci.com/problem.php?pc=1a32500f'>here</a>.</p>]]>
                </description>
                <pubDate>Mon, 21 Sep 2026 08:57:02 -0700</pubDate>
                <guid isPermaLink="false">problem-1a32500f</guid>
            </item>
<item>
                <title>New Problem of the Day!</title>
                <link>https://www.learnapcompsci.com/problem.php?pc=7cf16ca7</link>
                <description>
                    <![CDATA[<!--startproblem--><p>Friday, September 18, 2026</p><hr /><p><b>Problem:</b></p><p>The formula for determining the temperature in degrees Celsius based on a given value in degrees Fahrenheit is</p><img src='https://www.learnapcompsci.com/problem_assets/celsius.png' style='width:8em; margin-left: 2em;' /><p>Which of the following instructions, given the <code>double</code> value <code>F</code>, correctly performs that calculation?</p><ol type='a'><li><code>double C = 5/9 * F - 32;</code></li><li><code>double C = (5/9) * (F - 32);</code></li><li><code>double C = double(5/9) * (F - 32);</code></li><li><code>double C = 5.0/9 * (F - 32);</code></li></ol></p><!--pc=7cf16ca7--><!--endproblem--><p>See the solution <a href='https://www.learnapcompsci.com/problem.php?pc=7cf16ca7'>here</a>.</p>]]>
                </description>
                <pubDate>Fri, 18 Sep 2026 08:57:02 -0700</pubDate>
                <guid isPermaLink="false">problem-7cf16ca7</guid>
            </item>
<item>
                <title>New Problem of the Day!</title>
                <link>https://www.learnapcompsci.com/problem.php?pc=1ccaaf40</link>
                <description>
                    <![CDATA[<!--startproblem--><p>Thursday, September 17, 2026</p><hr /><p><b>Problem:</b></p><p>An inventory control system tracks the serial numbers of items. Each serial number is a five digit number followed by a letter:</p><ol type='a'><li><code>24356A</code></li><li><code>17745D</code></li><li><code>54999B</code></li><li><code>77503C</code></li></ol><p>Occasionally numbers are incorrectly written. To catch errors, all legal serial numbers follow this rule: the sum of the five individual digits mod 5 identifies the trailing letter that will be included with that serial number, where 0 = A, 1 = B, 2 = C, etc. </p><p>Of the four serial numbers given above, which one is not a legal value according to the system described?</p><!--pc=1ccaaf40--><!--endproblem--><p>See the solution <a href='https://www.learnapcompsci.com/problem.php?pc=1ccaaf40'>here</a>.</p>]]>
                </description>
                <pubDate>Thu, 17 Sep 2026 08:57:02 -0700</pubDate>
                <guid isPermaLink="false">problem-1ccaaf40</guid>
            </item>
<item>
                <title>New Problem of the Day!</title>
                <link>https://www.learnapcompsci.com/problem.php?pc=6391e63b</link>
                <description>
                    <![CDATA[<!--startproblem--><p>Wednesday, September 16, 2026</p><hr /><p><b>Problem:</b></p><p>When the source code for a Java program is ready to be run</p><ol type='a'><li>the source code is run directly on the computer, just as it is</li><li>the source code is compiled into machine code first, and then that code is executed</li><li>the source code is run by an interpreter</li><li>the source code is compiled into bytecode first, and then that bytecode is interpreted</li></ol><!--pc=6391e63b--><!--endproblem--><p>See the solution <a href='https://www.learnapcompsci.com/problem.php?pc=6391e63b'>here</a>.</p>]]>
                </description>
                <pubDate>Wed, 16 Sep 2026 08:57:02 -0700</pubDate>
                <guid isPermaLink="false">problem-6391e63b</guid>
            </item>
<item>
                <title>New Problem of the Day!</title>
                <link>https://www.learnapcompsci.com/problem.php?pc=81d26349</link>
                <description>
                    <![CDATA[<!--startproblem--><p>Tuesday, September 15, 2026</p><hr /><p><b>Problem:</b></p><p>Data types commonly used in Java programs include the <code>int</code>, <code>double</code>, and <code>String</code> types. Which of the following declaration/assignment statements would cause an error during compiling?</p><ol type='I'><li><code>int age = 17.0;</code></li><li><code>double shoeSize = 14;</code></li><li><code>String weight = &quot;105&quot;;</code></li></ol><ol type='a'><li>I only</li><li>II only</li><li>III only</li><li>I and II</li><li>I and III</li></ol><!--pc=81d26349--><!--endproblem--><p>See the solution <a href='https://www.learnapcompsci.com/problem.php?pc=81d26349'>here</a>.</p>]]>
                </description>
                <pubDate>Tue, 15 Sep 2026 08:57:01 -0700</pubDate>
                <guid isPermaLink="false">problem-81d26349</guid>
            </item>
<item>
                <title>New Problem of the Day!</title>
                <link>https://www.learnapcompsci.com/problem.php?pc=6847704f</link>
                <description>
                    <![CDATA[<!--startproblem--><p>Monday, September 14, 2026</p><hr /><p><b>Problem:</b></p><p>The term <i>bit</i> refers to a &quot;binary digit&quot;, a value of 0 or 1 in the binary system. The term <i>byte</i> refers to a sequence of eight bits. The maximum decimal value that can be represented by eight bits is:</p><ol type='a'><li>7</li><li>8</li><li>16</li><li>255</li><li>256</li></ol><!--pc=6847704f--><!--endproblem--><p>See the solution <a href='https://www.learnapcompsci.com/problem.php?pc=6847704f'>here</a>.</p>]]>
                </description>
                <pubDate>Mon, 14 Sep 2026 08:57:02 -0700</pubDate>
                <guid isPermaLink="false">problem-6847704f</guid>
            </item>
<item>
                <title>New Problem of the Day!</title>
                <link>https://www.learnapcompsci.com/problem.php?pc=516af672</link>
                <description>
                    <![CDATA[<!--startproblem--><p>Friday, September 11, 2026</p><hr /><p><b>Problem:</b></p><p>In a <i>Number Guessing Game</i>, the guesser tries to guess a "secret number," a value between 1 and 20, inclusive. After each wrong guess, the guesser receives feedback: "too high" if their guess was greater than the secret number, or "too low" if their guess was less than the secret number.</p><p>Assuming the guesser tries to optimize their guessing strategy, what is the maximum number of guesses they would need to be allowed so that they could be sure of guessing the secret number?</p><ol type='a'><li>1</li><li>4</li><li>5</li><li>20</li></ol><!--pc=516af672--><!--endproblem--><p>See the solution <a href='https://www.learnapcompsci.com/problem.php?pc=516af672'>here</a>.</p>]]>
                </description>
                <pubDate>Fri, 11 Sep 2026 08:57:01 -0700</pubDate>
                <guid isPermaLink="false">problem-516af672</guid>
            </item>
<item>
                <title>New Problem of the Day!</title>
                <link>https://www.learnapcompsci.com/problem.php?pc=8d5cb298</link>
                <description>
                    <![CDATA[<!--startproblem--><p>Thursday, September 10, 2026</p><hr /><p><b>Problem:</b></p><p>A robotic rover on the surface of Mars has a steering system that has malfunctioned so that it can't turn left--it can only go forward (F) or turn right (R). The rover is currently facing north, as shown. What series of commands should be issued so that the rover can follow the path indicated here to arrive at the finish?</p><img src='https://www.learnapcompsci.com/problem_assets/rover_map.png' class='half_center' /><ol type='a'><li><code>F R R R F R F F R F</code></li><li><code>F R F R R R F F R R R F</code></li><li><code>F R R R F R R F</code></li><li>The rover can't follow that path</li></ol><!--pc=8d5cb298--><!--endproblem--><p>See the solution <a href='https://www.learnapcompsci.com/problem.php?pc=8d5cb298'>here</a>.</p>]]>
                </description>
                <pubDate>Thu, 10 Sep 2026 08:57:01 -0700</pubDate>
                <guid isPermaLink="false">problem-8d5cb298</guid>
            </item>
<item>
                <title>New Problem of the Day!</title>
                <link>https://www.learnapcompsci.com/problem.php?pc=73cd0600</link>
                <description>
                    <![CDATA[<!--startproblem--><p>Wednesday, September 9, 2026</p><hr /><p><b>Problem:</b></p><p>A web browser on a computer, when given the address for a website, is able to connect to the Internet, request a webpage, receive information from the site's server, and display that page in a complicated series of steps that is mostly hidden from the user. This is an example of:</p><ol type='a'><li>a command-line interface</li><li>computational thinking</li><li>full-stack development</li><li>encapsulation</li></ol><!--pc=73cd0600--><!--endproblem--><p>See the solution <a href='https://www.learnapcompsci.com/problem.php?pc=73cd0600'>here</a>.</p>]]>
                </description>
                <pubDate>Wed, 09 Sep 2026 08:57:01 -0700</pubDate>
                <guid isPermaLink="false">problem-73cd0600</guid>
            </item>
<item>
                <title>New Problem of the Day!</title>
                <link>https://www.learnapcompsci.com/problem.php?pc=061e9bd4</link>
                <description>
                    <![CDATA[<!--startproblem--><p>Tuesday, September 8, 2026</p><hr /><p><b>Problem:</b></p><p>The directory (folder) that contains all of the other files and directories in a filesystem is called:</p><ol type='a'><li>the primary directory</li><li>the main directory</li><li>the fundamental directory</li><li>the root directory</li></ol><!--pc=061e9bd4--><!--endproblem--><p>See the solution <a href='https://www.learnapcompsci.com/problem.php?pc=061e9bd4'>here</a>.</p>]]>
                </description>
                <pubDate>Tue, 08 Sep 2026 08:57:01 -0700</pubDate>
                <guid isPermaLink="false">problem-061e9bd4</guid>
            </item>
<item>
                <title>New Problem of the Day!</title>
                <link>https://www.learnapcompsci.com/problem.php?pc=439ab64f</link>
                <description>
                    <![CDATA[<!--startproblem--><p>Monday, September 7, 2026</p><hr /><p><b>Problem:</b></p><p>The software that allows you to write code using plain text is called:</p><ol type='a'><li>a text editor</li><li>a word processor</li><li>a web browser</li><li>an application</li></ol><!--pc=439ab64f--><!--endproblem--><p>See the solution <a href='https://www.learnapcompsci.com/problem.php?pc=439ab64f'>here</a>.</p>]]>
                </description>
                <pubDate>Mon, 07 Sep 2026 13:58:08 -0700</pubDate>
                <guid isPermaLink="false">problem-439ab64f</guid>
            </item>
<item>
                <title>New Problem of the Day!</title>
                <link>https://www.learnapcompsci.com/problem.php?pc=3b97100d</link>
                <description>
                    <![CDATA[<!--startproblem--><p>Friday, September 4, 2026</p><hr /><p><b>Problem:</b></p><p>The binary number <code>101011</code> is equivalent to the decimal number:</p><ol type='a'><li><code>43</code></li><li><code>13</code></li><li><code>39</code></li><li><code>4</code></li></ol><!--pc=3b97100d--><!--endproblem--><p>See the solution <a href='https://www.learnapcompsci.com/problem.php?pc=3b97100d'>here</a>.</p>]]>
                </description>
                <pubDate>Fri, 04 Sep 2026 10:06:06 -0700</pubDate>
                <guid isPermaLink="false">problem-3b97100d</guid>
            </item>
<item>
        <title>New Problem of the Day!</title>
        <link>https://www.learnapcompsci.com/problem.php?pc=8260ce5b</link>
        <description>
            <![CDATA[<!--startproblem--><p>Friday, September 4, 2026</p><hr /><p><b>Problem:</b></p><figure><img src='https://www.learnapcompsci.com/problem_assets/IMG_8448.JPG' class='half_center'  /><figcaption>An early minicomputer, the DEC PDP-11</figcaption></figure><p>The <i>hardware</i> that makes up a computer typically includes:</p><ol type='I'><li>central processing unit (CPU)</li><li>Input and Output interfaces</li><li>memory (RAM and permanent)</li></ol><ol type='a'><li>I only</li><li>II only</li><li>I and II</li><li>II and III</li><li>I, II, and III</li></ol><!--pc=8260ce5b--><!--endproblem--><p>See the solution <a href='https://www.learnapcompsci.com/problem.php?pc=8260ce5b'>here</a>.</p>]]>
        </description>
        <pubDate>Fri, 04 Sep 2026 10:05:17 -0700</pubDate>
        <guid isPermaLink="false">problem-8260ce5b</guid>
    </item>
</channel>
</rss>
