MC Mistakes & Reflections

  • Score: 43/52 (.9/1)
  • Total: .9+1.8=2.7/3
  • Time: 67 minutes

    Question 5

    image

  • I assumed that the row and column for loops were flipped, namely that each line would contain one row of array data
  • The loops were switched such that the outer for loop was looping through the columns
    • Therefore, each line corresponded to one column in the array, which would have yielded the right answer

Question 7

image

  • Again I misread the function, I assumed the result string put a “1” if the characters at the same position were equal in both strings, yielding my answeer
  • In the actual function, if the characters at the same position were equal in both strings, the same character was appended to the result
    • This results in the “1” at the end of the result string being replaced with a “0” rather than “1” yielding the correct answer

Question 11

image

  • Here, I thought that the numbers would be concatinated with the string, resulting in 12Z
  • The flaw in my logic is that first 1 and 2 would be added before being cocantinated with Z
    • This resulted in the answer of “3Z” rather than “12Z”

Question 14

image

  • Here, I was thinking that normally the outer for loop would reference arr rather than arr[0]
  • Since it was using columns, the existing reference to arr[0] is correct
  • The column index is not iterable, so that resulted in the actual problem, replacing the enhanced for loop to use the iterable arr

Question 22

image

  • Here was just a misread, I thought the array was 3x4 however it was actually a 4x4 leading to the correct answer of 16

Question 25

image

  • I did not fully iterate through this code in my head resulting in the right answer
  • If you do this problem thoroughly and on paper you will get the right answer

Question 35

image

  • In this case I saw the general purpose of the for loop and for which elements it would print
  • I misread the loop printing the value of the array rather than the index resulting in my wrong answer

Question 37

image

  • I misread the quetion as I thought that it appended str2 to str1
  • However, the actual order was str2 and then str1 resulting on str2 always having an index of 0

Question 38

image

  • I misread the for loop thinking it would reverse the whole string
  • The loop only goes for i > 0 which means it skips the first character resulting in the right answer

Overall

I think my weak areas was silly mistakes and rushing through questions. I had some time left so I could have used that to more throughly go through the questions. I could also stuedy array for loops a bit more because I made some mistakes on that