Going into the Quiz

Since the last quiz, I gained a lot of experience from that, especially through the numeroud team teaches we had in the last 4 weeks. Although I did much better on this quiz, there is some questions I struggled with, mostly to fatigue or not reading the whole question correctly.

REFLECTION: For future quizzes, I’m going to work on completing the quiz in one sitting, ideally in the the time required which is 2 hours. I would also start diving into the student lessons and create a login page, synergizing all of the stuff I have been doing for the last 6 weeks.

Q15: Which of the following best compares the values displayed by programs A and B?

WRONG: A and B display the same values in different orders Correct: Identical values and orders

Didn’t notice in the while loop, the display and the operation were flipped, so the # was added before displaying the value.

Q28: Assume that the variables alpha and beta each are initialized with a numeric value. Which of the following code segments can be used to interchange the values of alpha and beta using the temporary variable temp ?

WRONG: I and II Correct: I and III

The code layout was confusing and as a result, I didn’t know that it asked for code that subs both terms for temp, which would have made things a lot easier.

Q29: Which scenario uses lossless compression?

WRONG: Device transmits audio as is Correct: Compress for sending, then restores it to the original.

In retrospect, I didn’t relalize this answer option existed, as the answer I chose I thought was right as lossless kepted all of the data, but thinking into it, there is no compression at all.

Q34: Which of the following code segments will move the robot to the gray square along the path indicated by the arrows?

WRONG: 3,1,0 Correct: 1,3,0

I saw two x’s in the problem, which I thought the boxes corresponded with the answer bank, which I found out the # of procedures had nothing to do with the answers. The answers only shows the amount of turns the robot does in each call of the procedure.

Q37: Drawing Line on a Coordinate Grid

WRONG: DrawLine (startX, startY, endX, endY) endX endX - 2 endY endY - 2 Correct: DrawLine (startX, startY, endX, endY) endY endY - 2

I should of recognized this as a loop/iteration, because the code is changing based on the end values, which the end x is never changing, and the end y is lowering by 2 every iteration.

Q67: For which of the following code segments will the call to NumOccurrences NOT return the intended value?

WRONG: treeList = “birch”, “maple”, “oak” numOccurances = treeList, “oak” treeList = “birch”, “maple”, “oak” numOccurances = treeList, “spruce” Correct: treeList = “birch”, “maple”, “birch” numOccurances = treeList, “birch” treeList = “birch”, “maple”, “birch” numOccurances = treeList, “maple”

Didn’t notice the count always resets to 0 when the code moves to the next element, which prevents the program from counting the number of identical elements in the whole list. This was the last question, so fatigue was really getting to me.