College Board Final Mc Reflection
Reflection: Although my logic was correct, I chose the answer choice with the wrong order of code. The actual answer involved appending the list first, which makes sense since the problem says that it is initially empty.
Reflection: With the answer I chose, the output would be: word 1 = yarn, word 2 = zebra, and word 3 = xylophone. I knew that a temp would be needed and assigned to word 3, but the correct choice would have been choice b rather than c, since it produced the correct order of updated values.
Reflection: When I saw the word “string,” I thought of the actual meaning, which is a word variable. However, this question was asking about a list index, which is the position of a list item. The position can’t be negative, contain a decimal, or be a word, so therefore the answer is 4.
Reflection: The logic for this code segment is to first set the variable x to 0, and the variable result also to 0. Then, in a loop, variables x and result are added to set the new result value. At the end of the loop, 1 is added to x. This is done until the value of x is greater than 5. Loop iterations are outlined below:
1st: x = 0, result = 0, new result = x + result = 0, new x = 1
2nd: x = 1, result = 0, new result = x + result = 1, new x = 2
3rd: x = 2, result = 1, new result = x + result = 3, new x = 3
4th: x = 3, result = 3, new result = x + result = 6, new x = 4
5th: x = 4, result = 6, new result = x + result = 10, new x = 5 ← this is where I stopped last time, so I incorrectly put the answer as 10
6th: x = 5, result = 10, new result = x + result = 15, new x = 6 ← answer is 15, since now x > 5
Reflection: Although my calculations for the first 3 answer choices were correct, I didn’t employ PEMDAS for value d, which was c + d/2, while my first choice was to do (c + d)/2.
Unsure
Reflection: I did not understand the logic for this question when I first read it, so this answer was
guess and just happened to be correct. I consulted an industry professional to try and better understand the logic. The lists j and k should both be within the length of numList. The program’s documentation is what is provided to the user of the program to keep in mind before using it. The user should make sure j and k are within the parameters listed and should know the purpose, to interchange j and k.
*However, the indices should be starting at 0, not 1
Reflection: The inner loop always starts with one element after the outer loop ( k ← j+1). Hence, the comparison is always with the subsequent elements at each iteration.
All the binary questions
Reflection: I need practice with binary to decimal conversions, which I will watch youtube videos for and learn