RunestoneInteractive / RunestoneInteractive/rs

Problem report: https://runestone.academy/assignment/student/doAssignment?assignment_id=291675

Open
#1,525 0 comments 0 reactions 1 assignee View on GitHub

@bhoffman0 is already working on this.

Since Sep 18, 2026.

Content
Dominant language
TypeScript
Stars
69
Forks
117
Avg merge
6d 4h
Merged PRs (30d)
24

Description

A problem was reported through the Runestone "Report a Problem" form.

Field Value
Reporter lsantucci
Email lsantucci@mhrd.org
Course MHHS_APCSA_2027
Page https://runestone.academy/assignment/student/doAssignment?assignment_id=291675
Reported at 2026-09-18T16:59:46.493858
Description

1.5 Casting and Ranges of Values
#13 the answer should be 2 but is not one of the choices
#14 the answer is 5 but it marks it wrong

I've also had students say when they "check me" it show correct but that it doesn't update points (not sure if there's something I'm missing there to make it auto grade those). Thanks!

Browser console log
[log] {"unit1":{"chapter_label":"unit1","chapter_name":"Using Objects and Methods","chapter_num":1,"status":"notstarted","subchapters":[{"activities_required":8,"activity_info":"{}","allow_pairs":"true","base_url":"/ns/books/published/MHHS_APCSA_2027/","chapter_chapter_name":"Casting and Ranges of Values","chapter_chapter_num":5,"chapter_label":"unit1","chapter_name":"Using Objects and Methods","chapter_num":1,"comment":null,"downloads_enabled":"true","enable_compare_me":"true","has_grade":false,"how_graded":"Best Answer","htmlsrc":null,"is_incorrect":false,"is_instructor":"true","is_logged_in":"true","latex_macros":"\n\n\\newcommand{\\lt}{<}\n\\newcommand{\\gt}{>}\n\\newcommand{\\amp}{&}\n","markup_system":"PreTeXt","name":"Using Objects and Methods/Casting and Ranges of Values","points":1,"qnumber":null,"question_type":"page","readings":[],"score":0,"show_points":"true","status":"started","sub_chapter_label":"topic-1-5-casting"},{"activities_required":4,"activity_info":"{}","allow_pairs":"true","base_url":"/ns/books/published/MHHS_APCSA_2027/","chapter_chapter_name":"Compound Assignment Operators","chapter_chapter_num":6,"chapter_label":"unit1","chapter_name":"Using Objects and Methods","chapter_num":1,"comment":null,"downloads_enabled":"true","enable_compare_me":"true","has_grade":false,"how_graded":"Best Answer","htmlsrc":null,"is_incorrect":false,"is_instructor":"true","is_logged_in":"true","latex_macros":"\n\n\\newcommand{\\lt}{<}\n\\newcommand{\\gt}{>}\n\\newcommand{\\amp}{&}\n","markup_system":"PreTeXt","name":"Using Objects and Methods/Compound Assignment Operators","points":1,"qnumber":null,"question_type":"page","readings":[],"score":0,"show_points":"true","status":"started","sub_chapter_label":"topic-1-6-compound-operators"}]}}
[log] [{"activities_required":null,"activity_info":"{}","allow_pairs":"true","base_url":"/ns/books/published/MHHS_APCSA_2027/","chapter_chapter_name":"Casting and Ranges of Values","chapter_chapter_num":5,"chapter_label":"unit1","chapter_name":"Using Objects and Methods","chapter_num":1,"comment":null,"downloads_enabled":"true","enable_compare_me":"true","has_grade":false,"how_graded":"Best Answer","htmlsrc":"<div class=\"runestone \">\n    <ul \n     data-component=\"multiplechoice\"\n     data-question_label=\"id_15mcq1\" data-multipleanswers=\"false\"  id=\"id_15mcq1\"  style=\"visibility: hidden;\">\n    <p><p>What happens when the following code executes?</p><pre class=\"line-numbers\"><code class=\"language-java\">double x = 12.99;\nint y = (int) x;\nSystem.out.println(y);</code></pre></p>\n\n    <li \n    data-component=\"answer\" \n     id=\"id_15mcq1_opt_a\"><p><code>13</code> is printed because casting automatically rounds up when decimals are ≥ 0.5.</p></li><li data-component=\"feedback\"></li>\n    \n    <li \n    data-component=\"answer\" \n     id=\"id_15mcq1_opt_b\"><p>A compile-time error occurs because a double cannot be cast to an int.</p></li><li data-component=\"feedback\"></li>\n    \n    <li \n    data-component=\"answer\" \n    data-correct='yes' id=\"id_15mcq1_opt_c\"><p><code>12</code> is printed because casting a double to an int truncates the decimal part.</p></li><li data-component=\"feedback\"></li>\n    \n    <li \n    data-component=\"answer\" \n     id=\"id_15mcq1_opt_d\"><p><code>12.99</code> is printed because the int cast preserves the original double.</p></li><li data-component=\"feedback\"></li>\n    \n    </ul>\n    </div>","is_incorrect":false,"is_instructor":"true","is_logged_in":"true","latex_macros":"\n\n\\newcommand{\\lt}{<}\n\\newcommand{\\gt}{>}\n\\newcommand{\\amp}{&}\n","markup_system":"PreTeXt","name":"1.5.mcq.1","points":2,"qnumber":null,"question_type":"mchoice","readings":[],"score":0,"show_points":"true","sub_chapter_label":"topic-1-5-casting"},{"activities_required":null,"activity_info":"{}","allow_pairs":"true","base_url":"/ns/books/published/MHHS_APCSA_2027/","chapter_chapter_name":"Casting and Ranges of Values","chapter_chapter_num":5,"chapter_label":"unit1","chapter_name":"Using Objects and Methods","chapter_num":1,"comment":null,"downloads_enabled":"true","enable_compare_me":"true","has_grade":false,"how_graded":"Best Answer","htmlsrc":"<div class=\"runestone \">\n    <ul \n     data-component=\"multiplechoice\"\n     data-question_label=\"id_15mcq2\" data-multipleanswers=\"false\"  id=\"id_15mcq2\"  style=\"visibility: hidden;\">\n    <p><p>Which of the following expressions correctly rounds a positive double value z to the nearest int?</p></p>\n\n    <li \n    data-component=\"answer\" \n    data-correct='yes' id=\"id_15mcq2_opt_a\"><p><code>(int)(z + 0.5)</code></p></li><li data-component=\"feedback\"></li>\n    \n    <li \n    data-component=\"answer\" \n     id=\"id_15mcq2_opt_b\"><p><code>(int)z</code></p></li><li data-component=\"feedback\"></li>\n    \n    <li \n    data-component=\"answer\" \n     id=\"id_15mcq2_opt_c\"><p><code>(int)(z - 0.5)</code></p></li><li data-component=\"feedback\"></li>\n    \n    <li \n    data-component=\"answer\" \n     id=\"id_15mcq2_opt_d\"><p><code>(int)(Math.round(z) - 0.5)</code></p></li><li data-component=\"feedback\"></li>\n    \n    </ul>\n    </div>","is_incorrect":false,"is_instructor":"true","is_logged_in":"true","latex_macros":"\n\n\\newcommand{\\lt}{<}\n\\newcommand{\\gt}{>}\n\\newcommand{\\amp}{&}\n","markup_system":"PreTeXt","name":"1.5.mcq.2","points":2,"qnumber":null,"question_type":"mchoice","readings":[],"score":0,"show_points":"true","sub_chapter_label":"topic-1-5-casting"},{"activities_required":null,"activity_info":"{}","allow_pairs":"true","base_url":"/ns/books/published/MHHS_APCSA_2027/","chapter_chapter_name":"Casting and Ranges of Values","chapter_chapter_num":5,"chapter_label":"unit1","chapter_name":"Using Objects and Methods","chapter_num":1,"comment":null,"downloads_enabled":"true","enable_compare_me":"true","has_grade":false,"how_graded":"Best Answer","htmlsrc":"<div class=\"runestone \">\n    <ul \n     data-component=\"multiplechoice\"\n     data-question_label=\"id_15mcq3\" data-multipleanswers=\"false\"  id=\"id_15mcq3\"  style=\"visibility: hidden;\">\n    <p><p>Consider the code:</p><pre class=\"line-numbers\"><code class=\"language-java\">int a = 4;\ndouble b = 2.5;\ndouble result = a + b;</code></pre><p>What happens when the expression <code>a + b</code> is evaluated?</p></p>\n\n    <li \n    data-component=\"answer\" \n     id=\"id_15mcq3_opt_a\"><p><code>b</code> is truncated to an int, and the result is computed as an int.</p></li><li data-component=\"feedback\"></li>\n    \n    <li \n    data-component=\"answer\" \n     id=\"id_15mcq3_opt_b\"><p>Both <code>a</code> and <code>b</code> are truncated, and the result is an int.</p></li><li data-component=\"feedback\"></li>\n    \n    <li \n    data-component=\"answer\" \n     id=\"id_15mcq3_opt_c\"><p>A run-time error occurs because Java cannot add an int and a double.</p></li><li data-component=\"feedback\"></li>\n    \n    <li \n    data-component=\"answer\" \n    data-correct='yes' id=\"id_15mcq3_opt_d\"><p><code>a</code> is automatically widened to a double, and the result is computed as a double.</p></li><li data-component=\"feedback\"></li>\n    \n    </ul>\n    </div>","is_incorrect":false,"is_instructor":"true","is_logged_in":"true","latex_macros":"\n\n\\newcommand{\\lt}{<}\n\\newcommand{\\gt}{>}\n\\newcommand{\\amp}{&}\n","markup_system":"PreTeXt","name":"1.5.mcq.3","points":2,"qnumber":null,"question_type":"mchoice","readings":[],"score":0,"show_points":"true","sub_chapter_label":"topic-1-5-casting"},{"activities_required":null,"activity_info":"{}","allow_pairs":"true","base_url":"/ns/books/published/MHHS_APCSA_2027/","chapter_chapter_name":"Casting and Ranges of Values","chapter_chapter_num":5,"chapter_label":"unit1","chapter_name":"Using Objects and Methods","chapter_num":1,"comment":null,"downloads_enabled":"true","enable_compare_me":"true","has_grade":false,"how_graded":"Best Answer","htmlsrc":"<div class=\"runestone \">\n    <ul \n     data-component=\"multiplechoice\"\n     data-question_label=\"id_15mcq4\" data-multipleanswers=\"false\"  id=\"id_15mcq4\"  style=\"visibility: hidden;\">\n    <p><p>Which of the following best describes integer overflow in Java?</p></p>\n\n    <li \n    data-component=\"answer\" \n     id=\"id_15mcq4_opt_a\"><p>It occurs when an int expression produces a value outside of the range <code>Integer.MIN_VALUE</code> to <code>Integer.MAX_VALUE</code>.</p></li><li data-component=\"feedback\"></li>\n    \n    <li \n    data-component=\"answer\" \n    data-correct='yes' id=\"id_15mcq4_opt_b\"><p>It occurs when an int expression produces a value outside of the range <code>Integer.MIN_VALUE</code> to <code>Integer.MAX_VALUE</code>.</p></li><li data-component=\"feedback\"></li>\n    \n    <li \n    data-component=\"answer\" \n     id=\"id_15mcq4_opt_c\"><p>It occurs when too many doubles are used in an expression, leading to round-off errors.</p></li><li data-component=\"feedback\"></li>\n    \n    <li \n    data-component=\"answer\" \n     id=\"id_15mcq4_opt_d\"><p>It occurs when a program attempts to divide by zero.</p></li><li data-component=\"feedback\"></li>\n    \n    </ul>\n    </div>","is_incorrect":false,"is_instructor":"true","is_logged_in":"true","latex_macros":"\n\n\\newcommand{\\lt}{<}\n\\newcommand{\\gt}{>}\n\\newcommand{\\amp}{&}\n","markup_system":"PreTeXt","name":"1.5.mcq.4","points":2,"qnumber":null,"question_type":"mchoice","readings":[],"score":0,"show_points":"true","sub_chapter_label":"topic-1-5-casting"},{"activities_required":null,"activity_info":"{}","allow_pairs":"true","base_url":"/ns/books/published/MHHS_APCSA_2027/","chapter_chapter_name":"Casting and Ranges of Values","chapter_chapter_num":5,"chapter_label":"unit1","chapter_name":"Using Objects and Methods","chapter_num":1,"comment":null,"downloads_enabled":"true","enable_compare_me":"true","has_grade":false,"how_graded":"Best Answer","htmlsrc":"<div class=\"runestone \">\n    <ul \n     data-component=\"multiplechoice\"\n     data-question_label=\"id_15mcq5\" data-multipleanswers=\"false\"  id=\"id_15mcq5\"  style=\"visibility: hidden;\">\n    <p><p>What is the likely result of evaluating the expression below, assuming standard Java int behavior?</p><pre class=\"line-numbers\"><code class=\"language-java\">int x = Integer.MAX_VALUE;\nint y = x + 1;\nSystem.out.println(y);</code></pre></p>\n\n    <li \n    data-component=\"answer\" \n     id=\"id_15mcq5_opt_a\"><p><code>y</code> will be larger than <code>Integer.MAX_VALUE</code> because ints expand automatically.</p></li><li data-component=\"feedback\"></li>\n    \n    <li \n    data-component=\"answer\" \n    data-correct='yes' id=\"id_15mcq5_opt_b\"><p><code>y</code> will wrap around to <code>Integer.MIN_VALUE</code> due to overflow.</p></li><li data-component=\"feedback\"></li>\n    \n    <li \n    data-component=\"answer\" \n     id=\"id_15mcq5_opt_c\"><p>The program will throw an <code>ArithmeticException</code>.</p></li><li data-component=\"feedback\"></li>\n    \n    <li \n    data-component=\"answer\" \n     id=\"id_15mcq5_opt_d\"><p>The program will fail to compile since <code>x + 1</code> exceeds int capacity.</p></li><li data-component=\"feedback\"></li>\n    \n    </ul>\n    </div>","is_incorrect":false,"is_instructor":"true","is_logged_in":"true","latex_macros":"\n\n\\newcommand{\\lt}{<}\n\\newcommand{\\gt}{>}\n\\newcommand{\\amp}{&}\n","markup_system":"PreTeXt","name":"1.5.mcq.5","points":2,"qnumber":null,"question_type":"mchoice","readings":[],"score":0,"show_points":"true","sub_chapter_label":"topic-1-5-casting"},{"activities_required":null,"activity_info":"{}","allow_pairs":"true","base_url":"/ns/books/published/MHHS_APCSA_2027/","chapter_chapter_name":"Casting and Ranges of Values","chapter_chapter_num":5,"chapter_label":"unit1","chapter_name":"Using Objects and Methods","chapter_num":1,"comment":null,"downloads_enabled":"true","enable_compare_me":"true","has_grade":false,"how_graded":"Best Answer","htmlsrc":"<div class=\"runestone \">\n    <ul \n     data-component=\"multiplechoice\"\n     data-question_label=\"id_15mcq6\" data-multipleanswers=\"false\"  id=\"id_15mcq6\"  style=\"visibility: hidden;\">\n    <p><p>Consider the following code:</p><pre class=\"line-numbers\"><code class=\"language-java\">double a = 9.7;\nint b = (int) a / 2;\ndouble c = a / 2;\nSystem.out.println(b + \" \" + c);</code></pre><p>What is printed when the code is executed?</p></p>\n\n    <li \n    data-component=\"answer\" \n     id=\"id_15mcq6_opt_a\"><p>4.85 4.85</p></li><li data-component=\"feedback\"></li>\n    \n    <li \n    data-component=\"answer\" \n     id=\"id_15mcq6_opt_b\"><p>4 4</p></li><li data-component=\"feedback\"></li>\n    \n    <li \n    data-component=\"answer\" \n     id=\"id_15mcq6_opt_c\"><p>5 4.85</p></li><li data-component=\"feedback\"></li>\n    \n    <li \n    data-component=\"answer\" \n    data-correct='yes' id=\"id_15mcq6_opt_d\"><p>4 4.85</p></li><li data-component=\"feedback\"></li>\n    \n    </ul>\n    </div>","is_incorrect":false,"is_instructor":"true","is_logged_in":"true","latex_macros":"\n\n\\newcommand{\\lt}{<}\n\\newcommand{\\gt}{>}\n\\newcommand{\\amp}{&}\n","markup_system":"PreTeXt","name":"1.5.mcq.6","points":3,"qnumber":null,"question_type":"mchoice","readings":[],"score":0,"show_points":"true","sub_chapter_label":"topic-1-5-casting"},{"activities_required":null,"activity_info":"{}","allow_pairs":"true","base_url":"/ns/books/published/MHHS_APCSA_2027/","chapter_chapter_name":"Casting and Ranges of Values","chapter_chapter_num":5,"chapter_label":"unit1","chapter_name":"Using Objects and Methods","chapter_num":1,"comment":null,"downloads_enabled":"true","enable_compare_me":"true","has_grade":false,"how_graded":"Best Answer","htmlsrc":"<div class=\"runestone \">\n    <ul \n     data-component=\"multiplechoice\"\n     data-question_label=\"id_15mcq7\" data-multipleanswers=\"false\"  id=\"id_15mcq7\"  style=\"visibility: hidden;\">\n    <p><p>Which of the following best explains why the expression below does <em>not</em> produce the mathematically expected value?</p><pre class=\"line-numbers\"><code class=\"language-java\">double d = 0.1 + 0.2;\nSystem.out.println(d);</code></pre></p>\n\n    <li \n    data-component=\"answer\" \n    data-correct='yes' id=\"id_15mcq7_opt_a\"><p>Some decimal fractions cannot be represented exactly in binary floating-point, causing a round-off error.</p></li><li data-component=\"feedback\"></li>\n    \n    <li \n    data-component=\"answer\" \n     id=\"id_15mcq7_opt_b\"><p>The <code>+</code> operator is not supported for doubles in Java.</p></li><li data-component=\"feedback\"></li>\n    \n    <li \n    data-component=\"answer\" \n     id=\"id_15mcq7_opt_c\"><p>The expression automatically casts to int before being stored in <code>d</code>.</p></li><li data-component=\"feedback\"></li>\n    \n    <li \n    data-component=\"answer\" \n     id=\"id_15mcq7_opt_d\"><p>The expression causes integer overflow because 0.1 and 0.2 are too small.</p></li><li data-component=\"feedback\"></li>\n    \n    </ul>\n    </div>","is_incorrect":false,"is_instructor":"true","is_logged_in":"true","latex_macros":"\n\n\\newcommand{\\lt}{<}\n\\newcommand{\\gt}{>}\n\\newcommand{\\amp}{&}\n","markup_system":"PreTeXt","name":"1.5.mcq.7","points":3,"qnumber":null,"question_type":"mchoice","readings":[],"score":0,"show_points":"true","sub_chapter_label":"topic-1-5-casting"},{"activities_required":null,"activity_info":"{}","allow_pairs":"true","base_url":"/ns/books/published/MHHS_APCSA_2027/","chapter_chapter_name":"Casting and Ranges of Values","chapter_chapter_num":5,"chapter_label":"unit1","chapter_name":"Using Objects and Methods","chapter_num":1,"comment":null,"downloads_enabled":"true","enable_compare_me":"true","has_grade":false,"how_graded":"Best Answer","htmlsrc":"<div class=\"runestone \">\n    <ul \n     data-component=\"multiplechoice\"\n     data-question_label=\"id_15mcq8\" data-multipleanswers=\"false\"  id=\"id_15mcq8\"  style=\"visibility: hidden;\">\n    <p><p>What happens in the following code?</p><pre class=\"line-numbers\"><code class=\"language-java\">int a = 2_000_000_000;\nint b = 1_000_000_000;\nint c = a + b;\nSystem.out.println(c);</code></pre></p>\n\n    <li \n    data-component=\"answer\" \n    data-correct='yes' id=\"id_15mcq8_opt_a\"><p><code>c</code> will contain a negative number due to integer overflow.</p></li><li data-component=\"feedback\"></li>\n    \n    <li \n    data-component=\"answer\" \n     id=\"id_15mcq8_opt_b\"><p><code>c</code> will correctly store <code>3_000_000_000</code> because Java automatically widens int to long.</p></li><li data-component=\"feedback\"></li>\n    \n    <li \n    data-component=\"answer\" \n     id=\"id_15mcq8_opt_c\"><p>A compile-time error occurs because the sum exceeds <code>Integer.MAX_VALUE</code>.</p></li><li data-component=\"feedback\"></li>\n    \n    <li \n    data-component=\"answer\" \n     id=\"id_15mcq8_opt_d\"><p>A run-time error occurs with <code>ArithmeticException</code>.</p></li><li data-component=\"feedback\"></li>\n    \n    </ul>\n    </div>","is_incorrect":false,"is_instructor":"true","is_logged_in":"true","latex_macros":"\n\n\\newcommand{\\lt}{<}\n\\newcommand{\\gt}{>}\n\\newcommand{\\amp}{&}\n","markup_system":"PreTeXt","name":"1.5.mcq.8","points":3,"qnumber":null,"question_type":"mchoice","readings":[],"score":0,"show_points":"true","sub_chapter_label":"topic-1-5-casting"},{"activities_required":null,"activity_info":"{}","allow_pairs":"true","base_url":"/ns/books/published/MHHS_APCSA_2027/","chapter_chapter_name":"Compound Assignment Operators","chapter_chapter_num":6,"chapter_label":"unit1","chapter_name":"Using Objects and Methods","chapter_num":1,"comment":null,"downloads_enabled":"true","enable_compare_me":"true","has_grade":false,"how_graded":"Best Answer","htmlsrc":"<div class=\"runestone \">\n    <ul \n     data-component=\"multiplechoice\"\n     data-question_label=\"id_16mcq1\" data-multipleanswers=\"false\"  id=\"id_16mcq1\"  style=\"visibility: hidden;\">\n    <p><p>Consider the following code segment:</p><pre class=\"line-numbers\"><code class=\"language-java\">int x = 10;\nx += 4;\nx *= 2;\nSystem.out.println(x);</code></pre><p>What is the output?</p></p>\n\n    <li \n    data-component=\"answer\" \n    data-correct='yes' id=\"id_16mcq1_opt_a\"><p>28</p></li><li data-component=\"feedback\"></li>\n    \n    <li \n    data-component=\"answer\" \n     id=\"id_16mcq1_opt_b\"><p>24</p></li><li data-component=\"feedback\"></li>\n    \n    <li \n    data-component=\"answer\" \n     id=\"id_16mcq1_opt_c\"><p>20</p></li><li data-component=\"feedback\"></li>\n    \n    <li \n    data-component=\"answer\" \n     id=\"id_16mcq1_opt_d\"><p>14</p></li><li data-component=\"feedback\"></li>\n    \n    </ul>\n    </div>","is_incorrect":false,"is_instructor":"true","is_logged_in":"true","latex_macros":"\n\n\\newcommand{\\lt}{<}\n\\newcommand{\\gt}{>}\n\\newcommand{\\amp}{&}\n","markup_system":"PreTeXt","name":"1.6.mcq.1","points":1,"qnumber":null,"question_type":"mchoice","readings":[],"score":0,"show_points":"true","sub_chapter_label":"topic-1-6-compound-operators"},{"activities_required":null,"activity_info":"{}","allow_pairs":"true","base_url":"/ns/books/published/MHHS_APCSA_2027/","chapter_chapter_name":"Compound Assignment Operators","chapter_chapter_num":6,"chapter_label":"unit1","chapter_name":"Using Objects and Methods","chapter_num":1,"comment":null,"downloads_enabled":"true","enable_compare_me":"true","has_grade":false,"how_graded":"Best Answer","htmlsrc":"<div class=\"runestone \">\n    <ul \n     data-component=\"multiplechoice\"\n     data-question_label=\"id_16mcq2\" data-multipleanswers=\"false\"  id=\"id_16mcq2\"  style=\"visibility: hidden;\">\n    <p><p>Which of the following code segments correctly decreases the value of <code>count</code> by 1?</p></p>\n\n    <li \n    data-component=\"answer\" \n     id=\"id_16mcq2_opt_a\"><p><code>count -;</code></p></li><li data-component=\"feedback\"></li>\n    \n    <li \n    data-component=\"answer\" \n     id=\"id_16mcq2_opt_b\"><p><code>count = -1;</code></p></li><li data-component=\"feedback\"></li>\n    \n    <li \n    data-component=\"answer\" \n     id=\"id_16mcq2_opt_c\"><p><code>count =- 1;</code></p></li><li data-component=\"feedback\"></li>\n    \n    <li \n    data-component=\"answer\" \n    data-correct='yes' id=\"id_16mcq2_opt_d\"><p><code>count--;</code></p></li><li data-component=\"feedback\"></li>\n    \n    </ul>\n    </div>","is_incorrect":false,"is_instructor":"true","is_logged_in":"true","latex_macros":"\n\n\\newcommand{\\lt}{<}\n\\newcommand{\\gt}{>}\n\\newcommand{\\amp}{&}\n","markup_system":"PreTeXt","name":"1.6.mcq.2","points":1,"qnumber":null,"question_type":"mchoice","readings":[],"score":0,"show_points":"true","sub_chapter_label":"topic-1-6-compound-operators"},{"activities_required":null,"activity_info":"{}","allow_pairs":"true","base_url":"/ns/books/published/MHHS_APCSA_2027/","chapter_chapter_name":"Compound Assignment Operators","chapter_chapter_num":6,"chapter_label":"unit1","chapter_name":"Using Objects and Methods","chapter_num":1,"comment":null,"downloads_enabled":"true","enable_compare_me":"true","has_grade":false,"how_graded":"Best Answer","htmlsrc":"<div class=\"runestone \">\n    <ul \n     data-component=\"multiplechoice\"\n     data-question_label=\"id_16mcq3\" data-multipleanswers=\"false\"  id=\"id_16mcq3\"  style=\"visibility: hidden;\">\n    <p><p>What is the result of the following code segment?</p><pre class=\"line-numbers\"><code class=\"language-java\">int a = 5;\na--;\na += 3;\na *= 2;\nSystem.out.println(a);</code></pre></p>\n\n    <li \n    data-component=\"answer\" \n     id=\"id_16mcq3_opt_a\"><p>10</p></li><li data-component=\"feedback\"></li>\n    \n    <li \n    data-component=\"answer\" \n     id=\"id_16mcq3_opt_b\"><p>12</p></li><li data-component=\"feedback\"></li>\n    \n    <li \n    data-component=\"answer\" \n     id=\"id_16mcq3_opt_c\"><p>14</p></li><li data-component=\"feedback\"></li>\n    \n    <li \n    data-component=\"answer\" \n    data-correct='yes' id=\"id_16mcq3_opt_d\"><p>16</p></li><li data-component=\"feedback\"></li>\n    \n    </ul>\n    </div>","is_incorrect":false,"is_instructor":"true","is_logged_in":"true","latex_macros":"\n\n\\newcommand{\\lt}{<}\n\\newcommand{\\gt}{>}\n\\newcommand{\\amp}{&}\n","markup_system":"PreTeXt","name":"1.6.mcq.3","points":2,"qnumber":null,"question_type":"mchoice","readings":[],"score":0,"show_points":"true","sub_chapter_label":"topic-1-6-compound-operators"},{"activities_required":null,"activity_info":"{}","allow_pairs":"true","base_url":"/ns/books/published/MHHS_APCSA_2027/","chapter_chapter_name":"Compound Assignment Operators","chapter_chapter_num":6,"chapter_label":"unit1","chapter_name":"Using Objects and Methods","chapter_num":1,"comment":null,"downloads_enabled":"true","enable_compare_me":"true","has_grade":false,"how_graded":"Best Answer","htmlsrc":"<div class=\"runestone \">\n    <ul \n     data-component=\"multiplechoice\"\n     data-question_label=\"id_16mcq4\" data-multipleanswers=\"false\"  id=\"id_16mcq4\"  style=\"visibility: hidden;\">\n    <p><p>What is the output of the following code segment?</p><pre class=\"line-numbers\"><code class=\"language-java\">int x = 8;\nint y = 3;\nx %= y + 1;\ny *= x++;\nSystem.out.println(x + \" \" + y);</code></pre></p>\n\n    <li \n    data-component=\"answer\" \n     id=\"id_16mcq4_opt_a\"><p>0 0</p></li><li data-component=\"feedback\"></li>\n    \n    <li \n    data-component=\"answer\" \n     id=\"id_16mcq4_opt_b\"><p>1 2</p></li><li data-component=\"feedback\"></li>\n    \n    <li \n    data-component=\"answer\" \n    data-correct='yes' id=\"id_16mcq4_opt_c\"><p>1 3</p></li><li data-component=\"feedback\"></li>\n    \n    <li \n    data-component=\"answer\" \n     id=\"id_16mcq4_opt_d\"><p>2 4</p></li><li data-component=\"feedback\"></li>\n    \n    </ul>\n    </div>","is_incorrect":false,"is_instructor":"true","is_logged_in":"true","latex_macros":"\n\n\\newcommand{\\lt}{<}\n\\newcommand{\\gt}{>}\n\\newcommand{\\amp}{&}\n","markup_system":"PreTeXt","name":"1.6.mcq.4","points":3,"qnumber":null,"question_type":"mchoice","readings":[],"score":0,"show_points":"true","sub_chapter_label":"topic-1-6-compound-operators"},{"activities_required":null,"activity_info":"{}","allow_pairs":"true","base_url":"/ns/books/published/MHHS_APCSA_2027/","chapter_chapter_name":"Compound Assignment Operators","chapter_chapter_num":6,"chapter_label":"unit1","chapter_name":"Using Objects and Methods","chapter_num":1,"comment":null,"downloads_enabled":"true","enable_compare_me":"true","has_grade":false,"how_graded":"Best Answer","htmlsrc":"<div class=\"runestone \">\n    <ul \n     data-component=\"multiplechoice\"\n     data-question_label=\"id_16mcq5\" data-multipleanswers=\"false\"  id=\"id_16mcq5\"  style=\"visibility: hidden;\">\n    <p><p>Consider the code segment:</p><pre class=\"line-numbers\"><code class=\"language-java\">int a = 4;\nint b = 2;\na += ++b;  \nb -= a--;  \nSystem.out.println(a + b);</code></pre><p>What is printed?</p></p>\n\n    <li \n    data-component=\"answer\" \n     id=\"id_16mcq5_opt_a\"><p>5</p></li><li data-component=\"feedback\"></li>\n    \n    <li \n    data-component=\"answer\" \n     id=\"id_16mcq5_opt_b\"><p>6</p></li><li data-component=\"feedback\"></li>\n    \n    <li \n    data-component=\"answer\" \n     id=\"id_16mcq5_opt_c\"><p>7</p></li><li data-component=\"feedback\"></li>\n    \n    <li \n    data-component=\"answer\" \n    data-correct='yes' id=\"id_16mcq5_opt_d\"><p>8</p></li><li data-component=\"feedback\"></li>\n    \n    </ul>\n    </div>","is_incorrect":false,"is_instructor":"true","is_logged_in":"true","latex_macros":"\n\n\\newcommand{\\lt}{<}\n\\newcommand{\\gt}{>}\n\\newcommand{\\amp}{&}\n","markup_system":"PreTeXt","name":"1.6.mcq.5","points":3,"qnumber":null,"question_type":"mchoice","readings":[],"score":0,"show_points":"true","sub_chapter_label":"topic-1-6-compound-operators"},{"activities_required":null,"activity_info":"{}","allow_pairs":"true","base_url":"/ns/books/published/MHHS_APCSA_2027/","chapter_chapter_name":"Compound Assignment Operators","chapter_chapter_num":6,"chapter_label":"unit1","chapter_name":"Using Objects and Methods","chapter_num":1,"comment":null,"downloads_enabled":"true","enable_compare_me":"true","has_grade":false,"how_graded":"Best Answer","htmlsrc":"<div class=\"runestone \">\n    <ul \n     data-component=\"multiplechoice\"\n     data-question_label=\"id_16mcq6\" data-multipleanswers=\"false\"  id=\"id_16mcq6\"  style=\"visibility: hidden;\">\n    <p><p>What will be the output of the following code segment?</p><pre class=\"line-numbers\"><code class=\"language-java\">int num = 12;\nnum /= 5;\nnum *= 3;\nnum--;\nSystem.out.println(num);</code></pre></p>\n\n    <li \n    data-component=\"answer\" \n     id=\"id_16mcq6_opt_a\"><p>4</p></li><li data-component=\"feedback\"></li>\n    \n    <li \n    data-component=\"answer\" \n     id=\"id_16mcq6_opt_b\"><p>5</p></li><li data-component=\"feedback\"></li>\n    \n    <li \n    data-component=\"answer\" \n    data-correct='yes' id=\"id_16mcq6_opt_c\"><p>6</p></li><li data-component=\"feedback\"></li>\n    \n    <li \n    data-component=\"answer\" \n     id=\"id_16mcq6_opt_d\"><p>7</p></li><li data-component=\"feedback\"></li>\n    \n    </ul>\n    </div>","is_incorrect":false,"is_instructor":"true","is_logged_in":"true","latex_macros":"\n\n\\newcommand{\\lt}{<}\n\\newcommand{\\gt}{>}\n\\newcommand{\\amp}{&}\n","markup_system":"PreTeXt","name":"1.6.mcq.6","points":3,"qnumber":null,"question_type":"mchoice","readings":[],"score":0,"show_points":"true","sub_chapter_label":"topic-1-6-compound-operators"},{"activities_required":null,"activity_info":"{}","allow_pairs":"true","base_url":"/ns/books/published/MHHS_APCSA_2027/","chapter_chapter_name":"Compound Assignment Operators","chapter_chapter_num":6,"chapter_label":"unit1","chapter_name":"Using Objects and Methods","chapter_num":1,"comment":null,"downloads_enabled":"true","enable_compare_me":"true","has_grade":false,"how_graded":"Best Answer","htmlsrc":"<div class=\"runestone \">\n    <ul \n     data-component=\"multiplechoice\"\n     data-question_label=\"id_16mcq7\" data-multipleanswers=\"false\"  id=\"id_16mcq7\"  style=\"visibility: hidden;\">\n    <p><p>Which of the following statements best explains the behavior of the compound assignment operator +=?</p></p>\n\n    <li \n    data-component=\"answer\" \n     id=\"id_16mcq7_opt_a\"><p>It adds the right-hand value but does not change the original variable until reassigned.</p></li><li data-component=\"feedback\"></li>\n    \n    <li \n    data-component=\"answer\" \n     id=\"id_16mcq7_opt_b\"><p>It only works if the variable on the left is declared as final.</p></li><li data-component=\"feedback\"></li>\n    \n    <li \n    data-component=\"answer\" \n     id=\"id_16mcq7_opt_c\"><p>It creates a new variable that stores the sum of the left and right values.</p></li><li data-component=\"feedback\"></li>\n    \n    <li \n    data-component=\"answer\" \n    data-correct='yes' id=\"id_16mcq7_opt_d\"><p>It adds the value on the right to the variable on the left and updates the variable with the new result.</p></li><li data-component=\"feedback\"></li>\n    \n    </ul>\n    </div>","is_incorrect":false,"is_instructor":"true","is_logged_in":"true","latex_macros":"\n\n\\newcommand{\\lt}{<}\n\\newcommand{\\gt}{>}\n\\newcommand{\\amp}{&}\n","markup_system":"PreTeXt","name":"1.6.mcq.7","points":2,"qnumber":null,"question_type":"mchoice","readings":[],"score":0,"show_points":"true","sub_chapter_label":"topic-1-6-compound-operators"},{"activities_required":null,"activity_info":"{}","allow_pairs":"true","base_url":"/ns/books/published/MHHS_APCSA_2027/","chapter_chapter_name":"Compound Assignment Operators","chapter_chapter_num":6,"chapter_label":"unit1","chapter_name":"Using Objects and Methods","chapter_num":1,"comment":null,"downloads_enabled":"true","enable_compare_me":"true","has_grade":false,"how_graded":"Best Answer","htmlsrc":"<div class=\"runestone \">\n    <ul \n     data-component=\"multiplechoice\"\n     data-question_label=\"id_16mcq8\" data-multipleanswers=\"false\"  id=\"id_16mcq8\"  style=\"visibility: hidden;\">\n    <p><p>Why might a programmer choose to use x++ instead of x += 1?</p></p>\n\n    <li \n    data-component=\"answer\" \n    data-correct='yes' id=\"id_16mcq8_opt_a\"><p>x++ is shorter and more readable when only adding 1 to a variable.</p></li><li data-component=\"feedback\"></li>\n    \n    <li \n    data-component=\"answer\" \n     id=\"id_16mcq8_opt_b\"><p>x++ can be used to add more than 1 at a time, unlike x += 1.</p></li><li data-component=\"feedback\"></li>\n    \n    <li \n    data-component=\"answer\" \n     id=\"id_16mcq8_opt_c\"><p>x++ preserves the original value of x without modification.</p></li><li data-component=\"feedback\"></li>\n    \n    <li \n    data-component=\"answer\" \n     id=\"id_16mcq8_opt_d\"><p>x++ automatically prevents integer overflow, unlike x += 1.</p></li><li data-component=\"feedback\"></li>\n    \n    </ul>\n    </div>","is_incorrect":false,"is_instructor":"true","is_logged_in":"true","latex_macros":"\n\n\\newcommand{\\lt}{<}\n\\newcommand{\\gt}{>}\n\\newcommand{\\amp}{&}\n","markup_system":"PreTeXt","name":"1.6.mcq.8","points":2,"qnumber":null,"question_type":"mchoice","readings":[],"score":0,"show_points":"true","sub_chapter_label":"topic-1-6-compound-operators"}]
[warn] No ad placements found.
[log] Timezone cookie matches, not sending timezone to server
[log] This page served by undefined
[log] triggering runestone:pre-login-complete
[log] Runestone pre-login complete
[log] Loading Runestone component: multiplechoice
[log] Loading Runestone component: answer
[log] Loading Runestone component: feedback
[log] Waiting on MathJax!! undefined
[log] Returning mjready promise: [object Promise]
[log] Waiting on MathJax!! undefined
[log] Returning mjready promise: [object Promise]
[log] Waiting on MathJax!! undefined
[log] Returning mjready promise: [object Promise]
[log] Waiting on MathJax!! undefined
[log] Returning mjready promise: [object Promise]
[log] Waiting on MathJax!! undefined
[log] Returning mjready promise: [object Promise]
[log] Waiting on MathJax!! undefined
[log] Returning mjready promise: [object Promise]
[log] Waiting on MathJax!! undefined
[log] Returning mjready promise: [object Promise]
[log] Waiting on MathJax!! undefined
[log] Returning mjready promise: [object Promise]
[log] Waiting on MathJax!! undefined
[log] Returning mjready promise: [object Promise]
[log] Waiting on MathJax!! undefined
[log] Returning mjready promise: [object Promise]
[log] Waiting on MathJax!! undefined
[log] Returning mjready promise: [object Promise]
[log] Waiting on MathJax!! undefined
[log] Returning mjready promise: [object Promise]
[log] Waiting on MathJax!! undefined
[log] Returning mjready promise: [object Promise]
[log] Waiting on MathJax!! undefined
[log] Returning mjready promise: [object Promise]
[log] Waiting on MathJax!! undefined
[log] Returning mjready promise: [object Promise]
[log] Waiting on MathJax!! undefined
[log] Returning mjready promise: [object Promise]
[log] Request Failed for /ns/logger/getCompletionStatus?lastPageUrl=%2Fassignment%2Fstudent%2FdoAssignment&isPtxBook=true
[log] Response from server: 200
[log] Response from server: 200
[log] Response from server: 200
[log] Response from server: 200
[log] Response from server: 200
[log] Response from server: 200
[log] adding video popouts
[log] setting up pretext
[log] Response from server: 200
[log] Response from server: 200
[log] Response from server: 200
[log] Response from server: 200
[log] Response from server: 200
[log] Response from server: 200
[log] Response from server: 200
[log] Response from server: 200
[log] Response from server: 200
[log] Data from server: "no data" calling repopulateFromStorage
[log] resolving checkServer with server data
[log] Data from server: "no data" calling repopulateFromStorage
[log] resolving checkServer with server data
[log] Data from server: "no data" calling repopulateFromStorage
[log] resolving checkServer with server data
[log] Data from server: "no data" calling repopulateFromStorage
[log] resolving checkServer with server data
[log] Data from server: "no data" calling repopulateFromStorage
[log] resolving checkServer with server data
[log] Data from server: "no data" calling repopulateFromStorage
[log] resolving checkServer with server data
[log] Data from server: "no data" calling repopulateFromStorage
[log] resolving checkServer with server data
[log] Data from server: "no data" calling repopulateFromStorage
[log] resolving checkServer with server data
[log] Response from server: 200
[log] Data from server: "no data" calling repopulateFromStorage
[log] resolving checkServer with server data
[log] Data from server: "no data" calling repopulateFromStorage
[log] resolving checkServer with server data
[log] Data from server: "no data" calling repopulateFromStorage
[log] resolving checkServer with server data
[log] Data from server: "no data" calling repopulateFromStorage
[log] resolving checkServer with server data
[log] Data from server: "no data" calling repopulateFromStorage
[log] resolving checkServer with server data
[log] Data from server: "no data" calling repopulateFromStorage
[log] resolving checkServer with server data
[log] Data from server: "no data" calling repopulateFromStorage
[log] resolving checkServer with server data
[log] Data from server: "no data" calling repopulateFromStorage
[log] resolving checkServer with server data
[log] MathJax Ready -- dequeing a typesetting run for id_15mcq1 undefined
[log] MathJax Ready -- dequeing a typesetting run for id_15mcq2 undefined
[log] MathJax Ready -- dequeing a typesetting run for id_15mcq3 undefined
[log] MathJax Ready -- dequeing a typesetting run for id_15mcq4 undefined
[log] MathJax Ready -- dequeing a typesetting run for id_15mcq5 undefined
[log] MathJax Ready -- dequeing a typesetting run for id_15mcq6 undefined
[log] MathJax Ready -- dequeing a typesetting run for id_15mcq7 undefined
[log] MathJax Ready -- dequeing a typesetting run for id_15mcq8 undefined
[log] MathJax Ready -- dequeing a typesetting run for id_16mcq1 undefined
[log] MathJax Ready -- dequeing a typesetting run for id_16mcq2 undefined
[log] MathJax Ready -- dequeing a typesetting run for id_16mcq3 undefined
[log] MathJax Ready -- dequeing a typesetting run for id_16mcq4 undefined
[log] MathJax Ready -- dequeing a typesetting run for id_16mcq5 undefined
[log] MathJax Ready -- dequeing a typesetting run for id_16mcq6 undefined
[log] MathJax Ready -- dequeing a typesetting run for id_16mcq7 undefined
[log] MathJax Ready -- dequeing a typesetting run for id_16mcq8 undefined
[log] Save logging event {"event":"mChoice","act":"answer:1:no","answer":"1","correct":"F","div_id":"id_16mcq5","course_name":"MHHS_APCSA_2027","clientLoginStatus":true,"timezoneoffset":4,"percent":0,"assignment_id":291675}
[log] MathJax Ready -- dequeing a typesetting run for id_16mcq5_feedback undefined
[log] Save logging event {"event":"mChoice","act":"answer:2:no","answer":"2","correct":"F","div_id":"id_16mcq5","course_name":"MHHS_APCSA_2027","clientLoginStatus":true,"timezoneoffset":4,"percent":0,"assignment_id":291675}
[log] MathJax Ready -- dequeing a typesetting run for id_16mcq5_feedback undefined
[log] Save logging event {"event":"mChoice","act":"answer:3:correct","answer":"3","correct":"T","div_id":"id_16mcq5","course_name":"MHHS_APCSA_2027","clientLoginStatus":true,"timezoneoffset":4,"percent":1,"assignment_id":291675}
[log] MathJax Ready -- dequeing a typesetting run for id_16mcq5_feedback undefined
[log] Save logging event {"event":"mChoice","act":"answer:0:no","answer":"0","correct":"F","div_id":"id_16mcq5","course_name":"MHHS_APCSA_2027","clientLoginStatus":true,"timezoneoffset":4,"percent":0,"assignment_id":291675}
[log] MathJax Ready -- dequeing a typesetting run for id_16mcq5_feedback undefined
[log] Save logging event {"event":"mChoice","act":"answer:1:no","answer":"1","correct":"F","div_id":"id_16mcq6","course_name":"MHHS_APCSA_2027","clientLoginStatus":true,"timezoneoffset":4,"percent":0,"assignment_id":291675}
[log] MathJax Ready -- dequeing a typesetting run for id_16mcq6_feedback undefined
[log] Save logging event {"event":"mChoice","act":"answer:1:no","answer":"1","correct":"F","div_id":"id_16mcq6","course_name":"MHHS_APCSA_2027","clientLoginStatus":true,"timezoneoffset":4,"percent":0,"assignment_id":291675}
[log] MathJax Ready -- dequeing a typesetting run for id_16mcq6_feedback undefined

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.