Checkpoint 22.8.1.
What is the flaw in the original program?
- The loop starts too early (skips one or more numbers at the start)
- We would want to include 100.
- The loop goes too far (adds one or more extra numbers at the end)
- If we stop BEFORE 101, we include 100.
- The loop stops too early (skips one or more numbers at the end)
- Correct. To read 100, we need the upper bound of the range to be 101 or 102.
- The loop is not actually iterating through even numbers
- Try using one of the strategies… You should see only even numbers