/* mean - Numerator program to calculate the arithmetic mean of a series of numbers. Set the verbose variable to a non-zero value verbose = 1 to make queries and produce other prompts. Otherwise, this file can be used like a function. */ if (verbose) "Enter next number\n" "Enter 0 to end list\n" endif get val tot = tot + val items = items + 1 if (val != 0) do "mean" endif if (verbose) "Arithmetic mean = " endif tot / (items - 1) tot = 0 items = 0