Proof of Completion (Score: 55/66)

Reflection

Questions

Q7

I mistakenly put only I when both are necessary to create a time-compiler error, so the answer is C

Q8

My mistake was that the && for bth false statements don’t turn out to true, making it seem D rather than B.

Q18

I said that Line 10 should be changed to sum += arr[row][col]; but in reality, the answer was Line 8 should be changed to for (int[] row : arr). There was no issue in line 10 if we initially just the for loop and make it into a special for loop.

Q24

The count doesnt include the last element in the array so if there is an a at the end, it will not function properly

Q25

It turns out that the code is just missing a return type because constructors dont have return types and the return type is only necessary in the code itself.

Q30

Since the array only goes to the 2nd to last term, it will not get the last term, 8 is the answer, not 7 as 7 is literally the first value. Make sure to look out for the first and last terms of an array when doing error problems. Common theme that the error is in the first or last entry in the array

Q32

D produces the same things because it has the same indexes but just goes backwards. B is definitely wrong because it literally starts and ends at different indexes

Q38

Only 2 has the same behavior, mostly an oversight on my part and I should’ve got this right, very easy question that only requires plugging in values into both and seeing if they are equal

Q39

2000 was a leap year but 1900 was not

Q40

First need to check if the initial num of vals is 0 because if so, you would just return whats already there. C is unnecessary to the code

Q53

It is very necessary to initialize the value of the total to be 1 initially so that the code works as intended, it isn’t needed that the while loops runs for x <= n

Takeaways

I need to focus on making sure that when I plug in different scenarios, I am writing down outputs. Consider doing a truth table like I learned in Discrete Math. Look at first and last indexes for errors in error questions. Make sure that when matching, the output, as well as the input, are identical to one another!