jz21324 / Vcode

Apache License 2.0
0 stars 0 forks source link

Collegeboard MC 39 Questions #23

Open jz21324 opened 1 year ago

jz21324 commented 1 year ago

Grade: 35/39

Question My Answer Correct Answer Explanation
Question 11 D E I chose the answer D when it was actually E because The reverse of “nono” is “onon”, since these two strings are not equal, the method will return false. This 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”.
Question 19 D E In condition II, the while loop will execute one time, since 1, the value of x is less than or equal to 1, however, 1 is not even, so nothing will be printed.In condition I, the while loop will not execute, since 1, the value of x, is not less than 0, so nothing will be printed. In condition II, the while loop will execute one time, since 1, the value of x is less than or equal to 1, however, 1 is not even, so nothing will be printed.
Question 28 A B The outer loop iterates one fewer time than the length of the array. The inner loop is dependent on the outer loop, starting at the value of j + 1 and iterating to the end of the array. The first pass through the outer loop, the inner loop will iterate five times, meaning the / Compare values / expression will execute five times.
Question 37 B E Choice I iterates from startIndex to the end of the array words as expected, but when it adds elements to result it adds the current word followed by a second word starting at the end of the array words. This will result in duplicate words being added to result. Choice II starts at the end of the array words and adds each word to result working right to left until it reaches the startIndex.