Answer
Step 1: Step 2: Step 3: Step 4: Step 5: Step 6: Step 7: Step 8: Step 9:
Start
Initialize sum and count to zero
Examine top card.
If it says “end of data” proceed to step 9; otherwise, proceed to next step. Add value from top card to sum.
Increase count by 1.
Discard top card
Return to Step 3.
Is the count greater than zero?
If yes, proceed to step 10.
If no, proceed to step 11.
Step 10: Calculate average = sum/count Step 11: End
Work Step by Step
Step 1: Step 2: Step 3: Step 4: Step 5: Step 6: Step 7: Step 8: Step 9:
Start
Initialize sum and count to zero
Examine top card.
If it says “end of data” proceed to step 9; otherwise, proceed to next step. Add value from top card to sum.
Increase count by 1.
Discard top card
Return to Step 3.
Is the count greater than zero?
If yes, proceed to step 10.
If no, proceed to step 11.
Step 10: Calculate average = sum/count Step 11: End