This one is incorrect because the expressions are not equivalent when a has the value true, b has the value false, and c has the value false. Thus, the answer E is correct and not D. Look at skill 4.c topic 3.6
Question 14
A
B
Similar to the previous question, answer A is correct because when a AND b are true, AND NOT C AND D are true, the whole thing evaluates to the same as the given expression. I confused the and with an or for the A and B expressions. topic 3.5 and 3.5
Question 14
C
B
The correct answer is B and not C because the opposite of !(a != b) is just (a != b), and thus my answer of a == b or b<=7 is incorrect because it switches the a and b term. topic 3.6
Question 19
B
A
The correct answer is A and not B because the expressions are not equivalent when a has the value 4, b has the value 3, c has the value 2, and d has the value 1. This is yet another de morgans law problem. topic 3.6
Question 26
C
A
The correct answer is A and not C because this loop header will fail to include the first array element in the sum. I messed up because I thought starting the index at one higher, and subtracting one from the index would fix the error but I see now that it wouldn't.
Question 27
A
B
The correct answer is B and not A because for this list, the method correctly removes the elements that were originally at index 0 and at index 3. Thus and set of numbers that i picked for answer A would not work.
Question 29
C
D
The correct answer is C and not D because when the value of num is 7, the code segment will print 7, as intended. This occurs when j is 0 and k is 0. The issue was that the outer for loop would not traverse the last row in the 2d array, and D fixed this because it shows that there is an error in it, whereas the others would not.
Question 49
D
C
The correct answer is D and not C because in option I, "W" is not printed because the expression a < b evaluates to false. I mistakenly picked I, but the correct answer was only III.
Question 52
C
B
The correct answer was C and not B because The raisePrice method is defined as having return type void, so it should not include a return statement. The revised code will not compile. This was a dumb mistake by me.
Question 61
A
D
The correct answer is D and not A because since the TennisPlayer class implements the Student interface, a variable of type Student can reference an object of type TennisPlayer. I confused this one and the correct answer is D because a student cannot be of type athlete without returning an error. topic 9.5
Corrections