Finals Week Submission

| Week | Lesson | Lesson | Lesson | | —– | —– | —– | —– | | Week 1 | Unit 1 - Primitives | Unit 2 - Objects | | | Week 2 | Unit 3 - Booleans / Ifs | Unit 4 - Iteration | Unit 5 - Classes |

Final Exam Reflection

  • I got 30/40. I think I could definitely do better than that, however I think that part of it was me trying to stay on pace with the AP exam timing, and I did not want to spend too long on concepts that I was unsure about. Additionally, there were a few problems that really tricked me, such as the one that returned the recursive function twice instead of just once. Overall, I think that though this is a decent score, I could definitely do more practice. I’ll pay more careful attention to certain parts of the problem that I may have usually glanced over. I will plan to study these concepts further, such as arraylists and loops (as they are the most time-intensive questions), and will hopefully do better on the next one as a result.

Question 4

image The correct answer that I should have picked was C, as the multiplication or division part is in integer type, which will round down to 2, even if it would have been 2.33333 if it had not been an integer.

Question 14

image I did not realize that when iterating through an arraylist using the enhanced for loop, that it already gets each vehicle and you do not need to use the get() function.

Question 15

image I chose I and II only, even though it was only I. It cannot be the second option because when it tries to check if data[k] > data[k + 1], it gets an out of bounds exception as data[k+1] on the last iteration is out of bounds.

Question 19

image The opposite of !(a != b) is only (a != b). Therefore, it would be applicable to use an OR operator with this opposite value here.

Question 25

image Out of these interfaces, I believed that III would also work as I thought that knowing both surface area and volume can be used in a formula to identify if the boxes could fit within each other. However, I neglected the fact that the ‘smaller’ box could just be really long and not fit in the larger box.

Question 30

image This returns only ilercom and not ilercomp, as the final index of the second part is to up to howFar, which would only be com.

Question 31

image In this case, I believed that the same array would be printed because I thought that passing it into the function does not actually change its values. However, it seems like passing it into the function still does change the values of it and thus would give the result.

Question 33

image On this one, I believed that incrementing the sum would eventually close the loop. However, because of the OR gate, it would continue on infinitely because k never increments and it would satisfy the while loop condition.

Question 34

image Only II works in this one, as in choice III, x and y are private variables and thus cannot be accessed and modified in that way by the missing code.

Question 39

image I did not notice that it was return recur(recur(n/3)); and not return recur(n/3);. As a result, it would actually go from 27 to 9 to 18 to 6 to 12 to 4 to 8 to 16.