CollegeBoard Revisions/Reflection
CollegeBoard Revisions/Reflection
College Board MCQ Corrections.
Question: #13
The correct answer to this problem would be A, because the method should return false since the word “art” is not found in “rattrap”, “similar”, or “today”. When the method concatenates all three words together, all is assigned the value “rattrapsimilartoday”. The “ar” in “similar” gets concatenated with the “t” in “today”, resulting in the letter combinations for “art” to be in all, causing the method to incorrectly return true.
Question: #26
The correct answer to this problem would be E, because the algorithm assigns temp the letters of str in reverse by extracting each letter of str starting at the end and moving to the beginning. Each letter is appended to the end of temp. So, if str was “abc”, “c” would be appended followed by “b”, and then “a”, making temp equal to “cba”. This method will return true if str is equal to temp, which is a string with the letters of str in reverse. The string “noon” is the only string that is the same in reverse.
Question: #30
The correct answer to this problem would be D becausethe original expression prints "dog" when a < b || c != d evaluates to true, an equivalent code segment would print "cat" when the negative of the expression, or !(a < b || c != d), evaluates to true.
Question: #42
The correct answer to this problem would be D; because of De Morgan's laws, the given expression is equivalent to (a < b) || (c < d).
Question: #52
The correct answer to this problem would be E, because he first set of nested for loops sets each element in board to “O”. The next for loop starts val at 0 and increments by 1 until val is 4, when val is 5 the loop terminates. When val is even, board is not updated, so nothing happens when val is 0. When val is 1, row is assigned 1 and col is assigned 0. The boolean condition in the while loop is true, so board[1][0] is assigned “X”.