66 Question Test Corrections
2014 Practice Exam MCQ
- Question 2
- Question 7
- Question 16
- Question 18
- Question 19
- Question 20
- Question 24
- Question 32
- Question 36
- Question 47
- Question 52
Question 2
- I got this question wrong because I didn’t read the answer choice properly. I did not notice that it had a -1 attached to the animals.length and ignored the rest of the options.
- Answer A is correct because the loop must iterate through the entire list and stop when the index i is equal to the length of the list, since indexes start from 0.
- I can watch 6.2 daily videos 1-3 to learn this concept.
Question 7
- I got this problem wrong because I didn’t notice that a1 could not be accessed outside its class due to the private keyword. Furthermore, i neglected that inheritance allowed methodA to be accessed in class B.
- Answer D is correct because methodB can’t be used in the parent class in which it doesn’t exist. Furthermore, a1 can’t be accessed in class B.
- I can watch 9.3 daily videos 1 and 2 to learn this concept.
Question 16
- I got this wrong because I didn’t realize that the original snippet was iterating through the number of columns in line 5. I assumed that it was iterating for rows and therefore needed to be changed to arr.length.
- Answer C is correct because row can only be iterated through an array, not a column.
- I can watch 8.2 daily vides 1-3 to learn this concept.
Question 18
- This answer is incorrect because I didn’t read and interpret the boolean values properly in the code snippet. I should have used sample values to see if the same result was achieved.
- Answer E is correct because it recognizes that the opposite of the given expression would print cat and uses that in the if condition.
- I can watch 3.6 videos 1 and 2 to learn this concept.
Question 19
- This answer is incorrect because I once again did not take the time to evalulate the booleans myself with sample values. I also did not think to apply deMorgans law.
- Answer A is correct because it utilizes deMorgans law.
- I can watch 3.6 videos 1 and 2 to learn this concept.
Question 20
- I got this question wrong because I did not notice the difference between < and <=. Furthermore, i didn’t notice that one of the snippets prints even numbers.
- Answer E is correct because the original snippet only prints odd numbers up till 7. While this loops k limit has been changed to 8, it has no impact since k is incremented by 2 and therefore prints the same.
- I can watch 4.2 daily videos 1-3 to learn this concept.
Question 24
- I got this question wrong because I did not realize that the <= in the first for loop would result in the loop going to an index that did not exist if a 0 was not found. The only array in which this applies was D.
- Option D is correct because it was the only array in which there was no 0, meaning the loop would have continued past arr.length-1 to a nonexistent index.
- I can watch 8.2 daily videos 1-3 to learn this concept.
Question 32
- I got this wrong because I did not realize that the option i select would result in the count being reset to 0 before being compared to the previous count.
- Option E is correct because it allows for the count to be compared to the max and then reset to avoid overcounting.
- I can watch 6.4 daily videos 1-3 to learn this concept.
Question 36
- I got this wrong because I did not know the answer.
- Option C is correct.
- I can watch 9.6 daily videos 1-3 to learn this concept.
Question 47
- I got this wrong because I did not remember the function of println properly and thought it would print the current statement on a new line.
- Option C is correct because it would create a new line after “two”
- I can watch 1.1 daily videos 1-3 to learn this concept.
Question 52
- I got this wrong because I didn’t realize that the return was not specified. Furthermore void methods have no return.
- Option B is correct because a void method should not return anything. Therefore it should modify price but not return a value.
- I can watch 5.5 videos 1 and 2 to learn this concept. s