Banner

Q6

q6

This question I probably moved too fast because returning d1-d2 would only check one side for tolerances. I was also not too sure what Math.abs did but now that I look at it, it's absolute value so that would be the right answer.

Q19

q19

This is Demorgan's law and I completely forgot how the signs and distribution worked. However, now I know that you distribute the ! normally but the signs must change if a ! is distributed. For this reason, the answer would be B.

Q29

q29

In this question, it asks to select the code segment that has the same output as the code segment given(divisble by 4). The answer choice B that I chose would count by 4s but it won't print out the correct values as k is initialized to 1 instead of 4. Therefore, answer choice B is correct.

Q40

q40

This question was pretty confusing for me as it deals with recursion. I know that it recurs through the word and prints out the letters but I didn't know which order it was returned in. After looking at it a little bit more, I realized that it will return the word with 1 letter first then work its way down to len-1 letters. Therefore, the answer will be C instead of A.