Time taken total: 3 hours

I was at question 34 when 1.5 hours was over

Overall Score: 52/66

I think I did pretty well on this test, however I had to guess on a lot of the questions. And I ended up guessing right on a lot of them but wrong on a lot more of them. I also think I got a little lazy near the end, since lots of my mistakes were found there.

Weak areas of mine are definitely 2D arrays, looking at long paragraphs of code, and time management. I think since last time I improved a little on loops, but I also still need to work on that area as well.

Question My Answer Right Answer
1 B. I chose this because I thought code segment 1 would work, but it actually doesn’t E. the real answer is that none of the code segments work for many different reasons. It actually increases each by 1.
8 B. This one was a silly mistake and I misread the question when I was answering, and thought that they would evaluate to the same D. The real answer is that they will evaluate to the same false value when they have different values and different when A and B are the same truth value
16 A. I chose this answer because I thought that changing the col to be less than arr.length would be the answer and had to decide between 2 C. The reason why it needed to include a : is because it is intended to assign a row of col but col is not a 2D array
21 A. The private variable is actually allowed to be accessed because it uses a public constructor and method which can be called E. The real answer is this because the reset method returns a void type so it can’t have a value
34 E. I chose this but it was wrong because it will create an out of bounds exception because it tries to access an array value at its end index D. This is the correct answer because the index k varies from 0 to arr.length -1, twice the value of arr[k] and outputs the same code sum
39 B. This is wrong because the value 1984 is a multiple of 4, and not a multiple of 100, so the expression (val % 4) == 0 evaluates to true and the method returns true, as intended A. This is the right answer because this is an error because even though 1900 is a multiple of 100, it is not a multiple of 400, so the method should have returned false
42 C. This is wrong because the reverse of nnoo is oonn and the strings are not equal E. This is correct because it’s a palindrome
48 B. This is wrong because it outputs the wrong values, even though it’s the same amount E. This option is correct because it outputs the same values and can also be printed using a for loop with var k
49 B. This is wrong because “W” is not printed because the expression a > 0 evaluates to false. In option III, both a < b and a > 0 evaluate to true, so “W” is printed. C. This is correct because option 1 and 2 wont print out W due to the a>0 so it won’t evaluate to true and W will not be printed.
60 B. This is wrong because the first element of the returned array might not have the correct value. C. This option is correct because the last element of the array with the length of the result minus 1 might be the wrong value
61 A. This is wrong because the TennisPlayer class implements the Student interface, a variable of type Student can reference an object of type TennisPlayer. D. I got this wrong because I didn’t know what interface meant, but the Athlete class doesn’t implement the student interface
62 B. This is wrong because this set of values does not test the conditions when x is even and y is assigned the value 3. C. This is correct for the first conditional tests to see if x is even, if it is, y will be assigned the value 3.
65 C. This is wrong because it doesn’t have the correct value return for the classify method E. This value is correct because when it is plugged back into the method it returns the value of carClass
66 D. The given code segment prints 13579. This code segment prints nothing because the condition in the for loop is initially false B. The correct way is that in this while loop, j is initially 1 and increases by 2 repeatedly while it is less than 10.