I got a 55/66 on my 66 question quiz. Below are some questions that I got wrong and why:

66: In the given for loop, j is initially 1 and increases by 2 repeatedly as long as it is less than 10. In this while loop (the correct answer), j is initially 1 and increases by 2 repeatedly while it is less than 10. Both code segments produce the output 13579.44

53: The total variable should be initialized to 1 for both parts of the code to work properly. This is because it allows for the second part of the code snippet to run properly, as it manipulates the variable total.

35: The original code segment prints 10. This code segment prints 11 because the loop executes 11 times. The loop iterates 10 times. In each iteration, count is incremented by 1. Since the initial value of count is 0, the printed value of count is 10.

34: The original code segment prints the sum of twice the value of the elements in the array. This code segment prints a value that is twice the sum of the integers from 0 to arr.length - 1. The original code segment uses an enhanced for loop to iterate through the elements of array arr, uses variable sum to accumulate the sum of twice the value of the elements in the array, and prints the value of sum. This code segment produces the same output using a regular for loop. As the index k varies from 0 to arr.length - 1, twice the value of arr[k] accumulates in the variable sum.

32: Initializing the length count between lines 12 and 13 will allow the program to run as intended.

28: The method call will work as intended: since there are no instances of 1 in the list, the list will remain unchanged after the call. The method does not work as intended when there are consecutive occurrences of low_score in scores. When the first instance of 3 at index 3 is removed, the elements that follow it are shifted left, resulting in [8, 8, 4, 3, 6]. The next element, which is also equal to 3, moves to index 3. But j is incremented to 4 after the removal, so the second instance of 3 is not removed from the list.

20: The given code segment prints 1357, while this code segment prints 0246. The given code segment starts when k is 1 and prints every other value as long as k is less than or equal to 7. This code segment starts when k is 1 and prints every other value as long as k is less than or equal to 8. Both code segments print 1357.

19: The expressions are not equivalent when a has the value 4, b has the value 3, c has the value 2, and d has the value 1. By De Morgan's laws, the given expression is equivalent to (a < b) || (c < d).

=-b-&&-c-==-d-for-the-case-when-"cat"-should-be-printed." aria-hidden="true">18: In order to apply De Morgan’s laws and negate the condition in the if statement in the given code segment, the logical operator should be changed from || to &&. As an example, if a, b, c, and d have the values 1, 2, 2, and 2, respectively, then the given code segment would print "dog" and this code segment would print "cat". Since the original expression prints "dog" when a < b || c != d evaluates to true, an equivalent code segment would print "cat" when the negative of the expression, or !(a < b || c != d), evaluates to true. Applying De Morgan’s laws produces the equivalent Boolean expression a >= b && c == d for the case when "cat" should be printed.

14: The opposite of greater than is less than or equal. Therefore, the opposite of (b > 7) is (b <= 7). De Morgan’s Law states that !(p && q) is equivalent to !p || !q. By applying De Morgan’s Law to this expression, we negate the first expression !(!(a !=b)) and the second expression !(b >7) to form !(!(a != b)) || !(b > 7). In the first expression the two consecutive not operators (!) cancel each other out giving us (a != b). In the second expression, the opposite of > is <= giving us (b <= 7). The equivalent expression is (a != b) || (b <= 7).

5: Correct Sequence for De Morgans.