Code Examples
A repository of 155 code examples for BeepBeep
|
Compute the cumulative average of a list of numbers. More...
Static Public Member Functions | |
static void | main (String[] args) |
Compute the cumulative average of a list of numbers.
The cumulative average is the average of all the numbers processed so far.
This example is similar to Average, except that the second queue is replaced by a fork and a TurnInto processor. Represented graphically, this example corresponds to the following chain of processors:
The output of this program should look like this:
The cumulative average is... 2.0, 4.5, 3.3333333, 4.5, 4.0, 4.6666665, 4.142857, 4.625, 4.3333335,
Definition at line 57 of file AverageFork.java.