40 Matching Annotations
  1. Last 7 days
    1. 5.6.2: Iterating through arrays in code.

      Lab Notes: Good practice to show you how to loop. Up and down max down to up changing numbers in an array from negative to possitive and more at the beginning...

    1. 4.8.1: While loops.

      I got all of these wrong because I was not carful to follow the numbers and especially what happens when the loop exits or does not enter the body.

    1. Suppose the first input was 0. Would (1.0 * valuesSum / numValues) be 0? Yes No

      answer == no Why? valuesSum and numValues would both be 0. valueSum is multiplied by 1.0, converting from integer to float. numValues is then implicitly converted to float. 0.0 / 0.0 results in a "not a number", as 0.0 / 0.0 is mathematically undefined.

  2. Jul 2026
    1. 500-599 are pay channels. Does this expression correctly detect the pay channel range? (userChannel >= 500) or (userChannel <= 599) Yes No

      I got this incorrect because of the and and or

    2. ich detects if x is in the range -4 to +4? (x < -5) and (x < 5) (x > -5) or (x < 5) (x > -5) and (x < 5) Correct The first expression checks that x is above -5 (so -4, -3, ...). The second checks that x is below 5 (so 4, 3, ...). and'ing yields -4, -3, ..., 3, 4. 3) Which de

      Not here that there is a difference between and and or

  3. Jun 2026