Online worksheet ยท 4 of 4

Track a result across a collection - Online practice 4

Read the information, then answer the questions. An adult may read the instructions aloud. Show your working where asked.

Read before answering

List: [7,3,8]. Correct algorithm: set total=0 once; for each value, add it to total; after the loop return total. Faulty algorithm: set total=0 again at the beginning of EVERY iteration, then add that iteration's value. A mean additionally divides the total by the number of values.

Worksheet preview

  1. Trace the correct running totals for [7,3,8].
  2. Give the faulty final total and the exact correct mean for this non-empty list.
  3. What should be decided for an empty list?

This exercise is included in the free preview. Register free to complete it and download the preview PDFs. No payment is required.

Register free

Already registered? Sign in