test corrections HW
The correct answer is A, as the getA method in SomeClass takes int, and to get this method, obj.getA() is used. I just misread it and thought I was choosing the one that had the method, but accidentally chose myA instead.
This one I just got messed up with integers and doubles. I misread it and didn't pay attention enough to realize that x and y were integers. C is the correct answer as the first output will be skipped and the else will be done. They are integers, so it will round down to 2.
The answer is A, where 1 is the answer. I chose 1 and 2, and 2 is wrong because it leads to arrayindexoutofboundsexception and I didn't notice this.
I incorrectly remembered how De Morgan's Law worked. The answer was b and not d because the "and" has to be switched to an "or".
I just read the question wrong for this one. The answer is D, as it finds the positive difference between num and val and checks that is less than minDiff.
I thought line 5 wouldn't compile, as I though that the AudioBook object couldn't call toString. The answer is B is because you would have to let compiler know that the object in books is AudioBook.
I just didn't really understand 2d arrays well. D is the correct answer as once the loop ends, new Array will have {1,4,7}, {2,5,8}, {3,6,9}, which means the value will be 7.
I got my math mixed up for this one. The answer is E because the while loop only keeps looping when n is larger than 2, so it will always be greater than 2.
I chose choice 3, but x and y are private instances so they can't be accessed straight by circle. B is correct as 2 uses its parameters of a and b to be assigned to x and y respectively.
The answer is E as the code segment iterates 4 times to get to the value of 4752. Here, num is 0 and the loop will stop. I got quite confused with the math on this one and it was really difficult to do mentally.
I didn't get to the final recur value, I only got to recur(9). The answer is D as the answer will be recur(recur(9)). The answer is finally 16. So, I didn't get far enough.
I struggled mostly on the math parts and keeping track of the numbers. For example, a lot of the iteration ones the math can get kind of confusing when doing mentally. I'm not sure if we get a paper or not on the actual ap test, but if we don't it could get kind of tricky. I also didn't fully understand some concepts like 2d arrays and nested for loops. There were also some things I ended up just misreading and getting wrong