Test Corrections

Question 13

Screen Shot 2023-03-08 at 12 42 05 PM

For this question I answered choice A of option 1 only of “The author wants to make the e-book available as a free download.” Although option 1 is correct, it is not the only correct option because option 3 also is correct. This is because under Creative Commons the author can stipulate what kind of modification is allowed by users, making option 3 correct as well as option 1.

Question 28

Screen Shot 2023-03-08 at 12 52 35 PM

For this question I answered choices B and C. However answer B was incorrect because the code segment will remove only the first 2 characters of oldString. Answer A is correct because to remove the first 2 characters of oldString, this code segment takes a substring starting at position 3. To remove the last 2 characters of oldString, the substring ends at the position that is 4 characters less than the length of oldString (since 4 characters are removed).

Question 36

Screen Shot 2023-03-08 at 12 59 41 PM

For this question I answered choice A of option 2 only, but looking back at it I didn’t realize that option 3 was also correct. Code segment II is correct because it correctly assigns “A” when the numeric score is greater than 90, or “B” if the numeric score is not greater than 90 but is greater than or equal to 80, or “C” otherwise. Code segment III is also correct too because it assigns “C” when the numeric score is less than 80, or “B” if the numeric score is not less than 80 but is less than or equal to 90, or “A” otherwise.

Question 37

Screen Shot 2023-03-12 at 11 09 13 PM

For this question I answered choice B of two, but the value “TWO” is displayed only when x is greater than 10 and y is greater than or equal to 10. For example, “TWO” will be displayed if x is 15 and y is 10. The correct answer is C because the value “THREE” is displayed whenever x is less than or equal to 10 and y is greater than 3.

Question 40

Screen Shot 2023-03-12 at 11 16 05 PM

For this question I answered choice A, but choice D is correct because in order for the robot to move from the gray square back to its original position, it must move forward two squares, turn right, move forward four squares, turn left, and move forward two squares. The same set of moves can be used in both directions, so no change is needed to the algorithm.

Question 42

Screen Shot 2023-03-12 at 11 28 28 PM

For this question I answered choice C, but choice B was the right answer because in order for a binary search on a list to work, the elements of the list must be sorted.

Question 48

Screen Shot 2023-03-12 at 11 29 47 PM

For this question I answered choice A and C, but C isn’t correct because random number generators can be used to simulate the variability that exists in the world, so results are not always the same. Validation of the results is usually accomplished by comparing the outcomes with those based on experimentation. This means that B is the other correct option because simulations are most useful when real-world events are impractical for experiments.

Reflection

Overall this test was relatively straight forward, but some of the questions had Riggi and I stumped because of how long confusing the questions are. However, some of the coding questions we actually understood because working together with Riggi it was very easy to go through the code together and figure out either the problem or the output.