Pure Programmer
Blue Matrix


Cluster Map

Project: Average Filter

Write a filter program that accepts text representations of floating point values on the standard input, one per line. The program should then compute the average of the input values. Finally the program should output the value of the average to 16 decimal places on a single line so that it can easily be used by other programs.

Output
$ javac -Xlint AverageFilter.java $ java -ea AverageFilter < ../../data/text/FPList1.txt 5.202396991000000 $ javac -Xlint AverageFilter.java $ java -ea AverageFilter < ../../data/text/FPList2.txt 50.32408946776774 $ javac -Xlint AverageFilter.java $ java -ea AverageFilter < ../../data/text/FPList3.txt 499.0773230912989

Solution