Total Score
Question 19
Answer D is incorrect because when you apply De Morgan’s Law the logic operator and (&&) becomes an or ( | ) and vice versa. Answer B is correct because De Morgan’s Law states that !(p && q) is equivalent to !p | !q. By applying De Morgan’s Law to this expression, we negate the first expression !(!(a !=b)) and the second expression !(b >7) to form !(!(a != b)) | !(b > 7). In the first expression the two consecutive not operators (!) cancel each other out giving us (a != b). In the second expression, the opposite of > is <= giving us (b <= 7). The equivalent expression is (a != b) | (b <= 7). |
Question 39
Answer C is incorrect because The value of recur(6) is 12. However, this call was made within another recursive call and is not the final return value. Answer D is correct because The call recur(27) returns the value of recur(recur(9)) since 27 is greater than 10. The call recur(9) returns 18, since 9 is less than or equal to 10. Therefore, recur(recur(9)) is recur(18). The call recur(18) returns recur(recur(6)) since 18 is greater than 10. The call recur(6) returns 12, since 6 is less than or equal to 10. Therefore, recur(recur(6)) is recur(12). The call recur(12) returns recur(recur(4)) since 12 is greater than 10. The call recur(4) returns 8, since 4 is less than or equal to 10. Therefore, recur(recur(4)) is recur(8). The call recur(8) returns 16, since 8 is less than or equal to 10. Therefore, recur(27)returns the value of 16.
Analysis
It looks like my units to focus on the most is Unit 2 and Unit 10, so my plan is to watch more collegeboard videos on those units. I also guessed on lots of unit 6 Array questions because I was skeptical on whether I was understanding the code correctly.