Question 32 asks what operations should be performed in areas labeled 'A' and 'B' in the flowchart in Figure 1 to calculate the average of 25 exam scores. Question 33 asks how the flowchart in Figure 2 should be modified to calculate the sum of even numbers from 0 to 100 (inclusive).
2025/5/5
1. Problem Description
Question 32 asks what operations should be performed in areas labeled 'A' and 'B' in the flowchart in Figure 1 to calculate the average of 25 exam scores.
Question 33 asks how the flowchart in Figure 2 should be modified to calculate the sum of even numbers from 0 to 100 (inclusive).
2. Solution Steps
Question 32:
In Figure 1, the flowchart calculates the average of exam scores.
- The flowchart initializes , , and .
- Inside the loop, it inputs the 'th exam score .
- At area A, the current exam score should be added to the running sum. Thus, the operation should be .
- The loop continues until .
- After the loop, area B calculates the average . Since the sum of the scores is stored in , and the number of scores is , the average is .
Question 33:
In Figure 2, the flowchart calculates the sum of numbers from 0 to
1
0
0. The flowchart initializes $SUM = 0$ and $I = 0$. The loop continues as long as $I \le 100$. Inside the loop, $SUM = SUM + I$ and $I = I + 1$. To calculate the sum of even numbers from 0 to 100:
- The initial value of should be the first even number,
0. So changing $I=0$ to $I=2$ is wrong.
- The increment should be 2 to only add even numbers: .
- The summation remains the same: . The number is only even in this summation.
3. Final Answer
Question 32:
(1)
Question 33:
(2) Change the increment statement 'I = I+1' into 'I = I+2'